lib.mapNixDir: admit just files with .nix suffix

This commit is contained in:
tv 2022-12-09 00:28:58 +01:00
parent b1d1322e25
commit eb3285feea
1 changed files with 6 additions and 3 deletions

View File

@ -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 =