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

View File

@ -95,9 +95,12 @@ let
path = dirPath + "/${relPath}"; path = dirPath + "/${relPath}";
in in
nameValuePair (toPackageName name) (f path)) nameValuePair (toPackageName name) (f path))
(filter (attrNames
(name: name != "default.nix" && !hasPrefix "." name) (filterAttrs
(attrNames (readDir dirPath)))); (name: type:
(type == "regular" && hasSuffix ".nix" name && name != "default.nix") ||
(type == "directory" && !hasPrefix "." name))
(readDir dirPath))));
# https://tools.ietf.org/html/rfc5952 # https://tools.ietf.org/html/rfc5952
normalize-ip6-addr = normalize-ip6-addr =