From 2fa157ccd6e1aa8a0bdeda3a9b720bc6b8f5910e Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 7 Dec 2021 12:54:50 +0300 Subject: 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 --- nix/readTree/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'nix/readTree') diff --git a/nix/readTree/default.nix b/nix/readTree/default.nix index 2ad8e40f6c28..5468d41fd2c7 100644 --- a/nix/readTree/default.nix +++ b/nix/readTree/default.nix @@ -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 ]; -- cgit 1.4.1