fix(readTree): Apply .skip-subtree to Nix-file children as well

This behaviour was previously confusing, since readTree's data
structure treats children from Nix files and directories as identical
but only one of them would be affected by .skip-subtree

The "subtree" to be skipped here refers to all children of the
structure.

Change-Id: Idf596c9823f09cc2acf49523916bde4b801b8519
This commit is contained in:
Vincent Ambo 2021-12-07 12:54:50 +03:00 committed by tazjin
parent 14bf3f3cd9
commit 2fa157ccd6

View file

@ -100,7 +100,8 @@ let
}) (filter filterDir (attrNames dir));
# Import Nix files
nixFiles = filter (f: f != null) (map nixFileName (attrNames dir));
nixFiles = if hasAttr ".skip-subtree" dir then []
else filter (f: f != null) (map nixFileName (attrNames dir));
nixChildren = map (c: let
p = joinChild (c + ".nix");
childParts = parts ++ [ c ];