mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-26 00:43:20 +00:00
* A utility function `optionalAttrs', similar to optional and
optionalString but for attribute sets. svn path=/nixpkgs/trunk/; revision=17002
This commit is contained in:
parent
9d15693163
commit
5b7f46ea43
@ -161,4 +161,9 @@ rec {
|
||||
/* Check whether the argument is a derivation. */
|
||||
isDerivation = x: isAttrs x && x ? type && x.type == "derivation";
|
||||
|
||||
|
||||
/* If the Boolean `cond' is true, return the attribute set `as',
|
||||
otherwise an empty attribute set. */
|
||||
optionalAttrs = cond: as: if cond then as else {};
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user