refactor(host): simplify local names
This commit is contained in:
@@ -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; }
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user