about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--lib/attrsets.nix6
-rw-r--r--lib/default.nix3
-rw-r--r--pkgs/top-level/all-packages.nix6
3 files changed, 11 insertions, 4 deletions
diff --git a/lib/attrsets.nix b/lib/attrsets.nix
index d374d229f5975..4b73735fd8500 100644
--- a/lib/attrsets.nix
+++ b/lib/attrsets.nix
@@ -473,6 +473,12 @@ 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.
+   */
+  recurseIntoAttrs =
+    attrs: attrs // { recurseForDerivations = true; };
+
   /*** deprecated stuff ***/
 
   zipWithNames = zipAttrsWithNames;
diff --git a/lib/default.nix b/lib/default.nix
index 18d2dfae1e183..34c72a3512eee 100644
--- a/lib/default.nix
+++ b/lib/default.nix
@@ -70,7 +70,8 @@ let
       genAttrs isDerivation toDerivation optionalAttrs
       zipAttrsWithNames zipAttrsWith zipAttrs recursiveUpdateUntil
       recursiveUpdate matchAttrs overrideExisting getOutput getBin
-      getLib getDev chooseDevOutputs zipWithNames zip;
+      getLib getDev chooseDevOutputs zipWithNames zip
+      recurseIntoAttrs;
     inherit (lists) singleton forEach foldr fold foldl foldl' imap0 imap1
       concatMap flatten remove findSingle findFirst any all count
       optional optionals toList range partition zipListsWith zipLists
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index cd36574e12403..c50e8eaca23b9 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -62,9 +62,9 @@ in
 
   inherit (lib) lowPrio hiPrio appendToName makeOverridable;
 
-  # Applying this to an attribute set will cause nix-env to look
-  # inside the set for derivations.
-  recurseIntoAttrs = attrs: attrs // { recurseForDerivations = true; };
+  # Make various Nix tools consider the contents of the resulting
+  # attribute set when looking for what to build, find, etc.
+  inherit (lib) recurseIntoAttrs;
 
   # This is intended to be the reverse of recurseIntoAttrs, as it is
   # defined now it exists mainly for documentation purposes, but you