mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-21 13:10:33 +00:00
options: Learn how to merge identical integer values.
svn path=/nixpkgs/trunk/; revision=20581
This commit is contained in:
parent
529e1900ca
commit
4b7ff33c26
|
@ -195,6 +195,8 @@ rec {
|
||||||
else if all isAttrs list then fold lib.mergeAttrs {} list
|
else if all isAttrs list then fold lib.mergeAttrs {} list
|
||||||
else if all builtins.isBool list then fold lib.or false list
|
else if all builtins.isBool list then fold lib.or false list
|
||||||
else if all builtins.isString list then lib.concatStrings list
|
else if all builtins.isString list then lib.concatStrings list
|
||||||
|
else if all builtins.isInt list && all (x: x == head list) list
|
||||||
|
then head list
|
||||||
else throw "Cannot merge values.";
|
else throw "Cannot merge values.";
|
||||||
|
|
||||||
mergeTypedOption = typeName: predicate: merge: list:
|
mergeTypedOption = typeName: predicate: merge: list:
|
||||||
|
|
Loading…
Reference in a new issue