initial commit
This commit is contained in:
commit
5679c003d8
26 changed files with 296 additions and 0 deletions
18
export/nixosConfigurations.nix
Normal file
18
export/nixosConfigurations.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{ nixosUsers ? {}, nixosGroups ? {}, nixosModules, hmModules ? { default = {}; }, ...}@flake: { ... }@inputs: { host, ... }@imports: let
|
||||
host' = name: snippets: let
|
||||
system = { namespace?"fbs42", nixpkgs?"nixpkgs" }: inputs.${nixpkgs}.lib.nixosSystem {
|
||||
specialArgs = { inherit inputs flake; namespace = if builtins.isList namespace then namespace else [ namespace ]; };
|
||||
modules = builtins.concatLists (map (base: builtins.attrValues (flake.lib.scan { base = "${base}/host/${name}"; })) flake.lib.schema.base)
|
||||
++ [ { config.networking.hostName = name; } ]
|
||||
++ [ nixosModules.default ]
|
||||
++ [ inputs.home-manager.nixosModules.default ]
|
||||
++ [ { config.home-manager.sharedModules = [ hmModules.default ]; } ]
|
||||
++ builtins.attrValues nixosUsers
|
||||
++ builtins.attrValues nixosGroups
|
||||
;
|
||||
};
|
||||
|
||||
cfg = assert builtins.length snippets == 1; builtins.head snippets;
|
||||
in system cfg;
|
||||
|
||||
in builtins.mapAttrs host' host
|
||||
Loading…
Add table
Add a link
Reference in a new issue