1
0
Fork 0
This commit is contained in:
Lukas Wurzinger 2024-08-31 01:17:38 +02:00
parent e7c8d4d565
commit be422948c7
3 changed files with 8 additions and 54 deletions

View file

@ -19,6 +19,8 @@
flake = {
nixosConfigurations = let
hostsDir = "hosts";
commonNixosSystem = name:
nixpkgs.lib.nixosSystem {
specialArgs = {
@ -29,14 +31,14 @@
inputs.agenix.nixosModules.default
./common
./hosts/${name}
./${hostsDir}/${name}
({lib, ...}: {networking.hostName = lib.mkDefault name;})
];
};
genHosts = nixpkgs.lib.pipe (builtins.readDir ./hosts) [
(nixpkgs.lib.filterAttrs (name: type: type == "directory" && name != "default.nix"))
genHosts = nixpkgs.lib.pipe (builtins.readDir ./${hostsDir}) [
(nixpkgs.lib.filterAttrs (name: type: type == "directory"))
builtins.attrNames
nixpkgs.lib.genAttrs
];