diff options
Diffstat (limited to 'hosts/default.nix')
-rw-r--r-- | hosts/default.nix | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/hosts/default.nix b/hosts/default.nix new file mode 100644 index 0000000..deba17c --- /dev/null +++ b/hosts/default.nix @@ -0,0 +1,41 @@ +{ nixpkgs }: + +let + mkHost = system: hostname: modules: { + "${hostname}" = nixpkgs.lib.nixosSystem { + inherit system; + modules = [ ../modules ../users ] ++ modules; + specialArgs = { + inherit hostname nixpkgs; + }; + }; + }; + + inherit (nixpkgs.lib.attrsets) + mergeAttrsList; + inherit (builtins) + concatLists + attrValues + mapAttrs + map; + + hosts = systemsHosts: + mergeAttrsList + (concatLists + (attrValues + (mapAttrs + (system: hostnames: + map (h: mkHost system h [./${h}]) hostnames) + systemsHosts))); + + hostsImport = file: + import file { + inherit nixpkgs mkHost hosts; + }; +in +hosts { + "x86_64-linux" = [ + "thyme" + ]; +} // +hostsImport ./ades |