diff --git a/flake.nix b/flake.nix index 3d95352..fe5d6d4 100755 --- a/flake.nix +++ b/flake.nix @@ -42,17 +42,21 @@ lib = inputs.nixpkgs.lib; gen = import ./generator.nix { inherit inputs; }; systemsDir = ./systems; + isIgnoredSystemDir = name: lib.hasPrefix "_" name || lib.hasPrefix "." name; systemNames = lib.attrNames (lib.filterAttrs - (name: type: type == "directory" && builtins.pathExists (systemsDir + "/${name}/cfg.nix")) + (name: type: + type == "directory" + && !isIgnoredSystemDir name + && builtins.pathExists (systemsDir + "/${name}/cfg.nix")) (builtins.readDir systemsDir)); hostsByType = systemType: lib.filter (host: (import (systemsDir + "/${host}/cfg.nix")).syscfg.type == systemType) systemNames; generateHosts = systemType: - builtins.listToAttrs (map - (host: lib.nameValuePair host (gen.generate { inherit host; })) - (hostsByType systemType)); + lib.genAttrs + (hostsByType systemType) + (host: gen.generate { inherit host; }); in { devShells = import ./shells { inherit inputs; };