refactor(host): simplify local names
This commit is contained in:
@@ -13,7 +13,7 @@ let
|
|||||||
mkHost =
|
mkHost =
|
||||||
{
|
{
|
||||||
root,
|
root,
|
||||||
hostName,
|
name,
|
||||||
}:
|
}:
|
||||||
lib.nixosSystem {
|
lib.nixosSystem {
|
||||||
inherit specialArgs;
|
inherit specialArgs;
|
||||||
@@ -28,11 +28,10 @@ let
|
|||||||
repositoryModules
|
repositoryModules
|
||||||
|
|
||||||
# TODO: refactor
|
# TODO: refactor
|
||||||
registryAssembly.module
|
registryAssembly.module (root + "/${name}")
|
||||||
(root + "/${hostName}")
|
|
||||||
|
|
||||||
{
|
{
|
||||||
networking.hostName = hostName;
|
networking.hostName = name;
|
||||||
modules.host.enable = true;
|
modules.host.enable = true;
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
@@ -42,7 +41,11 @@ in
|
|||||||
mkHosts =
|
mkHosts =
|
||||||
{ root }:
|
{ root }:
|
||||||
let
|
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
|
in
|
||||||
lib.genAttrs hostNames (hostName: mkHost { inherit root hostName; });
|
lib.genAttrs names (
|
||||||
|
name:
|
||||||
|
mkHost { inherit root name; }
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user