summary refs log tree commit diff
path: root/lib/attrsets.nix
diff options
context:
space:
mode:
Diffstat (limited to 'lib/attrsets.nix')
-rw-r--r--lib/attrsets.nix14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/attrsets.nix b/lib/attrsets.nix
index 32994432d53..72430522f7d 100644
--- a/lib/attrsets.nix
+++ b/lib/attrsets.nix
@@ -473,6 +473,20 @@ rec {
   /* Pick the outputs of packages to place in buildInputs */
   chooseDevOutputs = drvs: builtins.map getDev drvs;
 
+  /* Make various Nix tools consider the contents of the resulting
+     attribute set when looking for what to build, find, etc.
+
+     This function only affects a single attribute set; it does not
+     apply itself recursively for nested attribute sets.
+   */
+  recurseIntoAttrs =
+    attrs: attrs // { recurseForDerivations = true; };
+
+  /* Undo the effect of recurseIntoAttrs.
+   */
+  dontRecurseIntoAttrs =
+    attrs: attrs // { recurseForDerivations = false; };
+
   /*** deprecated stuff ***/
 
   zipWithNames = zipAttrsWithNames;