34 lines
1.2 KiB
Nix
34 lines
1.2 KiB
Nix
{ nixosUsers ? {}, nixosGroups ? {}, nixosModules, hmModules ? { default = {}; }, ...}@flake: { ... }@inputs: { host, ... }@imports: let
|
|
host' = name: snippets: let
|
|
|
|
overlay = self: super: {
|
|
makeModulesClosure = x: super.makeModulesClosure (x // { allowMissing = true; });
|
|
};
|
|
|
|
common = { modulesPath, lib, ... }: {
|
|
config.nixpkgs.overlays = [ overlay ];
|
|
config.networking.hostName = lib.mkForce name;
|
|
config.home-manager = {
|
|
sharedModules = [ hmModules.default ] ;
|
|
};
|
|
|
|
imports = [
|
|
#(modulesPath + "/installer/cd-dvd/installation-cd-minimal-new-kernel-no-zfs.nix")
|
|
#(modulesPath + "/installer/sd-card/sd-image-aarch64.nix")
|
|
(modulesPath + "/installer/sd-card/sd-image-raspberrypi.nix")
|
|
nixosModules.default
|
|
inputs.home-manager.nixosModules.default
|
|
];
|
|
};
|
|
|
|
system = inputs.nixpkgs.lib.nixosSystem {
|
|
specialArgs = { inherit inputs flake; };
|
|
modules = [ common ]
|
|
++ snippets
|
|
++ builtins.attrValues nixosUsers
|
|
++ builtins.attrValues nixosGroups
|
|
;
|
|
};
|
|
in system.config.system.build.sdImage;
|
|
|
|
in builtins.mapAttrs host' host
|