From 5a8147401b2ca75e52146366dfd602b9e5fb770f Mon Sep 17 00:00:00 2001 From: alexion Date: Fri, 28 Aug 2026 18:38:56 -0400 Subject: [PATCH] refactor(host): simplify local names --- flake/host.nix | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) 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; } + ); }