2022-05-09 13:20:43 +02:00
|
|
|
{ description = (
|
2023-06-16 02:14:51 +02:00
|
|
|
"Fully automated NixOS CLI installer"
|
2022-05-09 13:20:43 +02:00
|
|
|
); inputs = {
|
|
|
|
|
2023-11-27 17:15:44 +01:00
|
|
|
nixpkgs = { url = "github:NixOS/nixpkgs/nixos-23.11"; };
|
2023-06-16 02:14:51 +02:00
|
|
|
functions = { url = "github:NiklasGollenstede/nix-functions"; inputs.nixpkgs.follows = "nixpkgs"; };
|
|
|
|
config.url = "path:./example/defaultConfig";
|
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 = [ "libblockdev" ]; }; }) # 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 = "aarch64-linux"; renameOutputs = name: "arm:${name}"; }) # nixosConfigurations.arm:* apps.*-linux.arm:* devShells.*-linux.arm:* packages.*-linux.arm:all-systems
|
2022-05-09 13:20:43 +02:00
|
|
|
|
|
|
|
]); }
|