abstractions ?

This commit is contained in:
Daylin Morgan 2024-01-23 12:50:40 -06:00
parent 21395ede95
commit aa35b92429
Signed by: daylin
GPG Key ID: C1E52E7DD81DF79F
1 changed files with 3 additions and 2 deletions

View File

@ -7,12 +7,13 @@
inherit (nixpkgs.lib) hasSuffix nixosSystem;
inherit (nixpkgs.lib.filesystem) listFilesRecursive;
in rec {
isNixFile = path: hasSuffix ".nix" path;
mkSystem = hostname:
nixosSystem {
system = "x86_64-linux";
modules =
builtins.filter
(path: hasSuffix ".nix" path) (listFilesRecursive (../. + "/hosts/${hostname}"));
builtins.filter isNixFile (listFilesRecursive (../. + "/hosts/${hostname}"));
specialArgs = {inherit inputs;};
};