80 lines
2.1 KiB
Nix
80 lines
2.1 KiB
Nix
# github.com/brianmcgee has lots of great ideas for going above and beyond for this
|
|
{
|
|
description = "Greg's homepage";
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
|
devshell.url = "github:numtide/devshell";
|
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
|
flake-root.url = "github:srid/flake-root";
|
|
process-compose.url = "github:Platonic-Systems/process-compose-flake";
|
|
treefmt-nix.url = "github:numtide/treefmt-nix";
|
|
};
|
|
|
|
outputs = { devshell, flake-parts, flake-root, process-compose, treefmt-nix, ... }@inputs:
|
|
flake-parts.lib.mkFlake { inherit inputs; } {
|
|
imports = [
|
|
inputs.devshell.flakeModule
|
|
inputs.flake-root.flakeModule
|
|
inputs.treefmt-nix.flakeModule
|
|
];
|
|
flake = {
|
|
# Universal things
|
|
};
|
|
systems = [
|
|
"x86_64-linux"
|
|
"aarch64-linux"
|
|
];
|
|
perSystem = { config, pkgs, self', system, ... }: let
|
|
lib = pkgs.lib;
|
|
in {
|
|
_module.args.pkgs = import inputs.nixpkgs {
|
|
inherit system;
|
|
config.allowUnfree = true;
|
|
};
|
|
# https://numtide.github.io/devshell/intro.html
|
|
devshells.default = {
|
|
# These commands will be shown in the motd that users read
|
|
# upon entering the shell
|
|
commands = [
|
|
];
|
|
};
|
|
|
|
# This is not special, this is just flakes
|
|
packages = let
|
|
src = ./.;
|
|
in {
|
|
cache = pkgs.writeShellApplication {
|
|
name = "cache-isos";
|
|
runtimeInputs = with pkgs; [
|
|
minio-client
|
|
packer
|
|
];
|
|
text = let
|
|
#getIso = t: pkgs.runCommand "t.txt" {
|
|
#nativeInputs = [ pkgs.packer ];
|
|
#} "echo var.iso.url | ${pkgs.packer}/bin/packer console -var-file=\"${t}\" -config-type=hcl2 ${src}/sources/";
|
|
#isos = lib.attrsets.mapAttrsToList (t: builtins.readFile (getIso t)) templates;
|
|
#processIsos = builtins.concatStringsSep "\n" (builtins.map (i: "echo ${i}") isos);
|
|
in ''
|
|
packer init sources/
|
|
rm -f cache/*latest* cache/*Rawhide*
|
|
'';
|
|
};
|
|
};
|
|
|
|
# https://numtide.github.io/treefmt/
|
|
treefmt.config = {
|
|
inherit (config.flake-root) projectRootFile;
|
|
package = pkgs.treefmt;
|
|
|
|
programs = {
|
|
deadnix.enable = true;
|
|
};
|
|
|
|
settings.formatter = {
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|