diff options
Diffstat (limited to 'doc/manual/writing-nix-expressions.xml')
-rw-r--r-- | doc/manual/writing-nix-expressions.xml | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/doc/manual/writing-nix-expressions.xml b/doc/manual/writing-nix-expressions.xml index 71cd84b072b4..873dc21a5292 100644 --- a/doc/manual/writing-nix-expressions.xml +++ b/doc/manual/writing-nix-expressions.xml @@ -871,6 +871,17 @@ This will evaluate to <literal>123</literal> if coerced to a string and <literal>456</literal> otherwise (again assuming <literal>bar</literal> is antiquotable).</para> +<para>In the special case where an attribute name inside of a set declaration +evaluates to <literal>"${null}"</literal> (which is normally an error, as +<literal>null</literal> is not antiquotable), that attribute is simply not +added to the set: + +<programlisting> +{ ${if foo then "bar" else null} = true; }</programlisting> + +This will evaluate to <literal>{}</literal> if <literal>foo</literal> +evaluates to <literal>false</literal>.</para> + </simplesect> |