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

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;};
};