diff options
Diffstat (limited to 'read-tree.nix')
-rw-r--r-- | read-tree.nix | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/read-tree.nix b/read-tree.nix index b2f161e885e1..2e182dfbdeef 100644 --- a/read-tree.nix +++ b/read-tree.nix @@ -72,10 +72,12 @@ let in listToAttrs (imported ++ dirs); importOr = path: dir: f: - let contents = f path (attrsToList dir); + let + allContents = f path (attrsToList dir); + dirOnlyContents = f path (filter (f: f.value == "directory") (attrsToList dir)); in if dir ? "default.nix" - then import path (argsWithPath args (pathParts path)) // contents - else contents; + then import path (argsWithPath args (pathParts path)) // dirOnlyContents + else allContents; readTree = path: importOr path (readDir path) traverse; in readTree initPath |