From 4b7ff33c2693438c22b5ca31985a7d41d3cf631e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 11 Mar 2010 22:03:49 +0000 Subject: [PATCH] options: Learn how to merge identical integer values. svn path=/nixpkgs/trunk/; revision=20581 --- pkgs/lib/options.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/lib/options.nix b/pkgs/lib/options.nix index 2c5e7aa208d5..edcbfaa48305 100644 --- a/pkgs/lib/options.nix +++ b/pkgs/lib/options.nix @@ -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: