summary refs log tree commit diff
path: root/doc/functions/library/attrsets.xml
diff options
context:
space:
mode:
authorRobert Hensing <roberth@users.noreply.github.com>2020-03-01 11:05:34 +0100
committerGitHub <noreply@github.com>2020-03-01 11:05:34 +0100
commite38a01db5d8afe312d684e8c2ddbdb4e11d9307f (patch)
tree8e57912a3d467cbaab77fd558fdc7f71230734ab /doc/functions/library/attrsets.xml
parent02ca096a85eced0d653004ae95f7cc6d8597b13e (diff)
parenta96f37db10fb2892d0420a7ef51c5b157d9e58dd (diff)
downloadnixpkgs-e38a01db5d8afe312d684e8c2ddbdb4e11d9307f.tar
nixpkgs-e38a01db5d8afe312d684e8c2ddbdb4e11d9307f.tar.gz
nixpkgs-e38a01db5d8afe312d684e8c2ddbdb4e11d9307f.tar.bz2
nixpkgs-e38a01db5d8afe312d684e8c2ddbdb4e11d9307f.tar.lz
nixpkgs-e38a01db5d8afe312d684e8c2ddbdb4e11d9307f.tar.xz
nixpkgs-e38a01db5d8afe312d684e8c2ddbdb4e11d9307f.tar.zst
nixpkgs-e38a01db5d8afe312d684e8c2ddbdb4e11d9307f.zip
Merge pull request #68491 from roberth/fix-dontRecurseIntoAttrs
Fix dontRecurseIntoAttrs + add to lib + doc
Diffstat (limited to 'doc/functions/library/attrsets.xml')
-rw-r--r--doc/functions/library/attrsets.xml44
1 files changed, 44 insertions, 0 deletions
diff --git a/doc/functions/library/attrsets.xml b/doc/functions/library/attrsets.xml
index b1ea05a2381..3c5823c2589 100644
--- a/doc/functions/library/attrsets.xml
+++ b/doc/functions/library/attrsets.xml
@@ -1667,4 +1667,48 @@ recursiveUpdate
 ]]></programlisting>
   </example>
  </section>
+
+ <section xml:id="function-library-lib.attrsets.recurseIntoAttrs">
+  <title><function>lib.attrsets.recurseIntoAttrs</function></title>
+
+  <subtitle><literal>recurseIntoAttrs :: AttrSet -> AttrSet</literal>
+  </subtitle>
+
+  <xi:include href="./locations.xml" xpointer="lib.attrsets.recurseIntoAttrs" />
+
+  <para>
+   Make various Nix tools consider the contents of the resulting
+   attribute set when looking for what to build, find, etc.
+  </para>
+
+  <para>
+   This function only affects a single attribute set; it does not apply itself recursively for nested attribute sets.
+  </para>
+
+  <variablelist>
+   <varlistentry>
+    <term>
+     <varname>attrs</varname>
+    </term>
+    <listitem>
+     <para>
+      An attribute set to scan for derivations.
+     </para>
+    </listitem>
+   </varlistentry>
+  </variablelist>
+
+  <example xml:id="function-library-lib.attrsets.recurseIntoAttrs-example">
+   <title>Making Nix look inside an attribute set</title>
+<programlisting><![CDATA[
+{ pkgs ? import <nixpkgs> {} }:
+{
+  myTools = pkgs.lib.recurseIntoAttrs {
+    inherit (pkgs) hello figlet;
+  };
+}
+]]></programlisting>
+  </example>
+ </section>
+
 </section>