diff options
author | Graham Christensen <graham@grahamc.com> | 2018-10-12 15:29:52 -0400 |
---|---|---|
committer | Graham Christensen <graham@grahamc.com> | 2018-10-12 16:06:11 -0400 |
commit | f85a4ba9c30434f9e0a2e2a57489543304d29f42 (patch) | |
tree | cb6b3cdfe9becbca263405bcc941a7938687a0ca /doc/functions | |
parent | ef05e1057b91647b7c2662437fd658e8b0286e80 (diff) |
nixpkgs docs: document isDerivation
Diffstat (limited to 'doc/functions')
-rw-r--r-- | doc/functions/library/attrsets.xml | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/doc/functions/library/attrsets.xml b/doc/functions/library/attrsets.xml index 78d05589aa8f..f671c5f4e4be 100644 --- a/doc/functions/library/attrsets.xml +++ b/doc/functions/library/attrsets.xml @@ -1231,4 +1231,47 @@ lib.attrsets.genAttrs [ "foo" "bar" ] (name: "x_${name}") ]]></programlisting> </example> </section> + + <section xml:id="function-library-lib.attrsets.isDerivation"> + <title><function>lib.attrsets.isDerivation</function></title> + + <subtitle><literal>isDerivation :: Any -> Bool</literal> + </subtitle> + + <xi:include href="./locations.xml" xpointer="lib.attrsets.isDerivation" /> + + <para> + Check whether the argument is a derivation. Any set with <code>{ type = + "derivation"; }</code> counts as a derivation. + </para> + + <variablelist> + <varlistentry> + <term> + <varname>value</varname> + </term> + <listitem> + <para> + The value which is possibly a derivation. + </para> + </listitem> + </varlistentry> + </variablelist> + + <example xml:id="function-library-lib.attrsets.isDerivation-example-true"> + <title>A package is a derivation</title> +<programlisting><![CDATA[ +lib.attrsets.isDerivation (import <nixpkgs> {}).ruby +=> true + ]]></programlisting> + </example> + + <example xml:id="function-library-lib.attrsets.isDerivation-example-false"> + <title>Anything else is not a derivation</title> +<programlisting><![CDATA[ +lib.attrsets.isDerivation "foobar" +=> false + ]]></programlisting> + </example> + </section> </section> |