initial commit

This commit is contained in:
Jonas Rabenstein 2025-01-05 16:35:55 +01:00
commit 5679c003d8
26 changed files with 296 additions and 0 deletions

View 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