Simplify host imports

This commit is contained in:
SebastianStork 2025-10-11 21:40:42 +02:00
parent 7a250a2ea8
commit de18f587c7
11 changed files with 50 additions and 50 deletions

View file

@ -9,28 +9,13 @@ let
hostName:
inputs.nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs self; };
modules =
let
hostFiles =
"${self}/hosts/${hostName}"
|> lib.filesystem.listFilesRecursive
|> lib.filter (lib.hasSuffix ".nix");
userFiles =
"${self}/users"
|> builtins.readDir
|> lib.filterAttrs (_: type: type == "directory")
|> lib.attrNames
|> map (user: "${self}/users/${user}/@${hostName}/default.nix")
|> lib.filter (path: lib.pathExists path);
in
[
{ networking = { inherit hostName; }; }
"${self}/hosts/common.nix"
"${self}/users/seb/default.nix"
]
++ hostFiles
++ userFiles;
modules = [
{ networking = { inherit hostName; }; }
"${self}/hosts/common.nix"
"${self}/hosts/${hostName}"
"${self}/users/seb"
]
++ lib.optional (lib.pathExists "${self}/users/seb/@${hostName}") "${self}/users/seb/@${hostName}";
};
mkDeployNode = hostname: {