diff --git a/pkgs/lib/default.nix b/pkgs/lib/default.nix index a99f09c80df..8093c67a692 100644 --- a/pkgs/lib/default.nix +++ b/pkgs/lib/default.nix @@ -201,6 +201,7 @@ rec { # Return a list or an empty list, dependening on a boolean value. optionals = cond: elems: if cond then elems else []; + optionalString = cond: string: if cond then string else ""; # Return a list of integers from `first' up to and including `last'. range = first: last: