From a96f37db10fb2892d0420a7ef51c5b157d9e58dd Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Wed, 11 Sep 2019 14:51:28 +0200 Subject: [PATCH] Document attrsets.recurseIntoAttrs --- doc/functions/library/attrsets.xml | 44 ++++++++++++++++++++++++++++++ lib/attrsets.nix | 3 ++ pkgs/top-level/all-packages.nix | 2 -- 3 files changed, 47 insertions(+), 2 deletions(-) diff --git a/doc/functions/library/attrsets.xml b/doc/functions/library/attrsets.xml index 65d0b40e2e8..8fe2e324b3b 100644 --- a/doc/functions/library/attrsets.xml +++ b/doc/functions/library/attrsets.xml @@ -1728,4 +1728,48 @@ recursiveUpdate ]]> + +
+ <function>lib.attrsets.recurseIntoAttrs</function> + + recurseIntoAttrs :: AttrSet -> AttrSet + + + + + + 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. + + + + + + attrs + + + + An attribute set to scan for derivations. + + + + + + + Making Nix look inside an attribute set + {} }: +{ + myTools = pkgs.lib.recurseIntoAttrs { + inherit (pkgs) hello figlet; + }; +} +]]> + +
+ diff --git a/lib/attrsets.nix b/lib/attrsets.nix index 607a22393f8..ae6e4e7c851 100644 --- a/lib/attrsets.nix +++ b/lib/attrsets.nix @@ -475,6 +475,9 @@ rec { /* 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; }; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 5fa010558ca..5a1b52938d1 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -62,8 +62,6 @@ in inherit (lib) lowPrio hiPrio appendToName makeOverridable; - # 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