diff options
author | Graham Christensen <graham@grahamc.com> | 2018-10-12 16:53:50 -0400 |
---|---|---|
committer | Graham Christensen <graham@grahamc.com> | 2018-10-12 16:54:34 -0400 |
commit | 0eb3b93e1ae4ee6cea97768a1f24f90a88635753 (patch) | |
tree | 0af9154cb077f82c9c8915a28154f2da934184af /doc | |
parent | c100a456b1da162ea010e5880cded268aa68cec6 (diff) | |
download | nixlib-0eb3b93e1ae4ee6cea97768a1f24f90a88635753.tar nixlib-0eb3b93e1ae4ee6cea97768a1f24f90a88635753.tar.gz nixlib-0eb3b93e1ae4ee6cea97768a1f24f90a88635753.tar.bz2 nixlib-0eb3b93e1ae4ee6cea97768a1f24f90a88635753.tar.lz nixlib-0eb3b93e1ae4ee6cea97768a1f24f90a88635753.tar.xz nixlib-0eb3b93e1ae4ee6cea97768a1f24f90a88635753.tar.zst nixlib-0eb3b93e1ae4ee6cea97768a1f24f90a88635753.zip |
nixpkgs docs: document recursivelyUpdate
Diffstat (limited to 'doc')
-rw-r--r-- | doc/functions/library/attrsets.xml | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/doc/functions/library/attrsets.xml b/doc/functions/library/attrsets.xml index a6fa2ea0e295..65d0b40e2e82 100644 --- a/doc/functions/library/attrsets.xml +++ b/doc/functions/library/attrsets.xml @@ -1671,4 +1671,61 @@ lib.attrsets.recursiveUpdateUntil (path: l: r: path == ["foo"]) ]]></programlisting> </example> </section> + + <section xml:id="function-library-lib.attrsets.recursiveUpdate"> + <title><function>lib.attrsets.recursiveUpdate</function></title> + + <subtitle><literal>recursiveUpdate :: AttrSet -> AttrSet -> AttrSet</literal> + </subtitle> + + <xi:include href="./locations.xml" xpointer="lib.attrsets.recursiveUpdate" /> + + <para> + A recursive variant of the update operator <literal>//</literal>. The + recursion stops when one of the attribute values is not an attribute set, in + which case the right hand side value takes precedence over the left hand + side value. + </para> + + <variablelist> + <varlistentry> + <term> + <varname>lhs</varname> + </term> + <listitem> + <para> + The left hand attribute set of the merge. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <varname>rhs</varname> + </term> + <listitem> + <para> + The right hand attribute set of the merge. + </para> + </listitem> + </varlistentry> + </variablelist> + + <example xml:id="function-library-lib.attrsets.recursiveUpdate-example"> + <title>Recursively merging two attribute sets</title> +<programlisting><![CDATA[ +recursiveUpdate + { + boot.loader.grub.enable = true; + boot.loader.grub.device = "/dev/hda"; + } + { + boot.loader.grub.device = ""; + } +=> { + boot.loader.grub.enable = true; + boot.loader.grub.device = ""; +} +]]></programlisting> + </example> + </section> </section> |