2022-05-09 13:20:43 +02:00
{ description = (
2023-06-16 02:14:51 +02:00
" F u l l y a u t o m a t e d N i x O S C L I i n s t a l l e r "
2022-05-09 13:20:43 +02:00
) ; inputs = {
2024-05-31 22:41:35 +02:00
nixpkgs = { url = " g i t h u b : N i x O S / n i x p k g s / n i x o s - 2 4 . 0 5 " ; } ;
2023-06-16 02:14:51 +02:00
functions = { url = " g i t h u b : N i k l a s G o l l e n s t e d e / n i x - f u n c t i o n s " ; inputs . nixpkgs . follows = " n i x p k g s " ; } ;
2023-12-01 12:29:05 +01:00
config . url = " g i t h u b : N i k l a s G o l l e n s t e d e / n i x o s - i n s t a l l e r ? d i r = e x a m p l e / d e f a u l t C o n f i g " ; # "path:./example/defaultConfig"; # (The latter only works on each host after using this flake directly (not as dependency or another flake). The former effectively points to the last commit, i.e. it takes two commits to apply changes to the default config.)
2022-05-09 13:20:43 +02:00
2024-08-28 13:12:07 +02:00
} ; outputs = inputs @ { self , . . . }: inputs . functions . lib . importRepo inputs ./. ( repo' : let
repo = repo' . override { applyToPackages = pkgs : packages : builtins . removeAttrs packages [ " l i b b l o c k d e v " ] ; } ;
2023-06-16 02:14:51 +02:00
lib = repo . lib . __internal__ ;
in [ # Run »nix flake show --allow-import-from-derivation« to see what this merges to:
2022-05-09 13:20:43 +02:00
2023-06-16 02:14:51 +02:00
## Exports (things to reuse in other flakes):
2024-08-28 13:12:07 +02:00
repo # lib.* nixosModules.* overlays.* packages.*
2022-05-09 13:20:43 +02:00
2023-06-16 02:14:51 +02:00
## Examples:
# The example host definitions from ./hosts/, plus their installers (apps):
2024-08-28 13:12:07 +02:00
( lib . self . mkSystemsFlake { inherit inputs ; hosts . dir = " ${ self } / e x a m p l e / h o s t s " ; asDefaultPackage = true ; } ) # nixosConfigurations.* apps.*-linux.* devShells.*-linux.* packages.*-linux.all-systems/default
2023-06-16 02:14:51 +02:00
# The same cross-compiled from aarch64 (just to show how that works):
2024-08-28 13:12:07 +02:00
( lib . self . mkSystemsFlake { inherit inputs ; hosts . dir = " ${ self } / e x a m p l e / h o s t s " ; buildPlatform = " a a r c h 6 4 - l i n u x " ; renameOutputs = name : " a r m : ${ name } " ; } ) # nixosConfigurations.arm:* apps.*-linux.arm:* devShells.*-linux.arm:* packages.*-linux.arm:all-systems
2022-05-09 13:20:43 +02:00
] ) ; }