refactor(host): simplify local names

This commit is contained in:
2026-08-28 18:38:56 -04:00
parent 276e7a02a6
commit 5a8147401b

View File

@@ -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; }
);
}