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 = {
2023-11-27 17:15:44 +01: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 3 . 1 1 " ; } ;
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
2023-06-16 02:14:51 +02:00
} ; outputs = inputs @ { self , . . . }: inputs . functions . lib . importRepo inputs ./. ( repo @ { overlays , . . . }: let
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):
2023-11-30 13:32:16 +01:00
( repo // { packages = lib . fun . packagesFromOverlay { inherit inputs ; exclude = [ " l i b b l o c k d e v " ] ; } ; } ) # 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):
2023-11-30 13:32:16 +01:00
( lib . self . mkSystemsFlake { inherit inputs ; 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):
( lib . self . mkSystemsFlake { inherit inputs ; 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
] ) ; }