options: Learn how to merge identical integer values.

svn path=/nixpkgs/trunk/; revision=20581
This commit is contained in:
Ludovic Courtès 2010-03-11 22:03:49 +00:00
parent 529e1900ca
commit 4b7ff33c26

View file

@ -195,6 +195,8 @@ rec {
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.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.";
mergeTypedOption = typeName: predicate: merge: list: