summaryrefslogtreecommitdiff
path: root/util/importAll.nix
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--util/importAll.nix6
1 files changed, 4 insertions, 2 deletions
diff --git a/util/importAll.nix b/util/importAll.nix
index c4a092e..678cf06 100644
--- a/util/importAll.nix
+++ b/util/importAll.nix
@@ -4,11 +4,13 @@ with builtins; with lib;
# http://chriswarbo.net/projects/nixos/useful_hacks.html
let
+ basename = removeSuffix ".nix";
+
isMatch = name: type: (hasSuffix ".nix" name || type == "directory")
- && ! elem name exclude;
+ && ! elem name (map basename exclude);
entry = name: _: {
- name = removeSuffix ".nix" name;
+ name = basename name;
value = import (root + "/${name}");
};
in