diff --git a/flake/host.nix b/flake/host.nix index 9711464..2627cc2 100644 --- a/flake/host.nix +++ b/flake/host.nix @@ -13,7 +13,7 @@ let mkHost = { root, - hostName, + name, }: lib.nixosSystem { inherit specialArgs; @@ -28,11 +28,10 @@ let repositoryModules # TODO: refactor - registryAssembly.module - (root + "/${hostName}") + registryAssembly.module (root + "/${name}") { - networking.hostName = hostName; + networking.hostName = name; modules.host.enable = true; } ]; @@ -42,7 +41,11 @@ in mkHosts = { root }: let - hostNames = lib.attrNames (lib.filterAttrs (_name: type: type == "directory") (builtins.readDir root)); + directories = lib.filterAttrs (_name: type: type == "directory") (builtins.readDir root); + names = lib.attrNames directories; in - lib.genAttrs hostNames (hostName: mkHost { inherit root hostName; }); + lib.genAttrs names ( + name: + mkHost { inherit root name; } + ); }