summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2022-12-09 00:28:58 +0100
committertv <tv@krebsco.de>2022-12-09 01:34:31 +0100
commiteb3285feea223f3aa2a54beeccbe3a9135067616 (patch)
tree80a1cca2e35a53a0f4ca258d5ad06e2ab1eaed3c /lib
parentb1d1322e25459f1f7c79a866b2abf06fc5535e33 (diff)
lib.mapNixDir: admit just files with .nix suffix
Diffstat (limited to 'lib')
-rw-r--r--lib/default.nix9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/default.nix b/lib/default.nix
index 7c3b0370e..d65c891a3 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
+ (name: type:
+ (type == "regular" && hasSuffix ".nix" name && name != "default.nix") ||
+ (type == "directory" && !hasPrefix "." name))
+ (readDir dirPath))));
# https://tools.ietf.org/html/rfc5952
normalize-ip6-addr =