Auto import host files

This commit is contained in:
SebastianStork 2025-04-06 22:14:39 +02:00
parent cd4e3ab2c1
commit 3ce9e298d4
5 changed files with 8 additions and 23 deletions

View file

@ -10,6 +10,12 @@ let
specialArgs = { inherit inputs self; };
modules =
let
hostFiles =
"${self}/hosts/${hostName}"
|> builtins.readDir
|> lib.filterAttrs (fileName: type: (fileName |> lib.hasSuffix ".nix") && type == "regular")
|> builtins.attrNames
|> map (fileName: "${self}/hosts/${hostName}/${fileName}");
userFiles =
"${self}/users"
|> builtins.readDir
@ -20,7 +26,8 @@ let
in
lib.flatten [
{ networking = { inherit hostName; }; }
"${self}/hosts/${hostName}"
"${self}/hosts/shared.nix"
hostFiles
userFiles
];
};