diff --git a/read-tree.nix b/read-tree.nix index b2f161e88..2e182dfbd 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