summaryrefslogtreecommitdiffstats
path: root/lib/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'lib/default.nix')
-rw-r--r--lib/default.nix10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/default.nix b/lib/default.nix
index 7c3b0370..149b97a7 100644
--- a/lib/default.nix
+++ b/lib/default.nix
@@ -95,9 +95,12 @@ let
path = dirPath + "/${relPath}";
in
nameValuePair (toPackageName name) (f path))
- (filter
- (name: name != "default.nix" && !hasPrefix "." name)
- (attrNames (readDir dirPath))));
+ (attrNames
+ (filterAttrs isNixDirEntry (readDir dirPath))));
+
+ isNixDirEntry = name: type:
+ (type == "regular" && hasSuffix ".nix" name && name != "default.nix") ||
+ (type == "directory" && !hasPrefix "." name);
# https://tools.ietf.org/html/rfc5952
normalize-ip6-addr =
@@ -191,3 +194,4 @@ let
in
lib
+// { inherit lib; }