diff --git a/doc/functions/library/attrsets.xml b/doc/functions/library/attrsets.xml index 222b4a88291..8206142d7df 100644 --- a/doc/functions/library/attrsets.xml +++ b/doc/functions/library/attrsets.xml @@ -1300,4 +1300,57 @@ lib.attrsets.isDerivation "foobar" + +
+ <function>lib.attrsets.optionalAttrs</function> + + optionalAttrs :: Bool -> AttrSet + + + + + + Conditionally return an attribute set or an empty attribute set. + + + + + + cond + + + + Condition under which the as attribute set is + returned. + + + + + + as + + + + The attribute set to return if cond is true. + + + + + + + Return the provided attribute set when <varname>cond</varname> is true + { my = "set"; } + ]]> + + + + Return an empty attribute set when <varname>cond</varname> is false + { } + ]]> + +