From eb3285feea223f3aa2a54beeccbe3a9135067616 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 9 Dec 2022 00:28:58 +0100 Subject: lib.mapNixDir: admit just files with .nix suffix --- lib/default.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'lib') 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 = -- cgit v1.2.3