diff options
author | Ludovic Courtès <ludo@gnu.org> | 2010-03-11 22:03:49 +0000 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2010-03-11 22:03:49 +0000 |
commit | 4b7ff33c2693438c22b5ca31985a7d41d3cf631e (patch) | |
tree | 3fb5acdf3c7cd244595a9eec9d4d2252cbb1c04a /pkgs/lib/options.nix | |
parent | 529e1900ca22ef26d6f47cea635877d613829c82 (diff) | |
download | nixpkgs-4b7ff33c2693438c22b5ca31985a7d41d3cf631e.tar nixpkgs-4b7ff33c2693438c22b5ca31985a7d41d3cf631e.tar.gz nixpkgs-4b7ff33c2693438c22b5ca31985a7d41d3cf631e.tar.bz2 nixpkgs-4b7ff33c2693438c22b5ca31985a7d41d3cf631e.tar.lz nixpkgs-4b7ff33c2693438c22b5ca31985a7d41d3cf631e.tar.xz nixpkgs-4b7ff33c2693438c22b5ca31985a7d41d3cf631e.tar.zst nixpkgs-4b7ff33c2693438c22b5ca31985a7d41d3cf631e.zip |
options: Learn how to merge identical integer values.
svn path=/nixpkgs/trunk/; revision=20581
Diffstat (limited to 'pkgs/lib/options.nix')
-rw-r--r-- | pkgs/lib/options.nix | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/pkgs/lib/options.nix b/pkgs/lib/options.nix index 2c5e7aa208d..edcbfaa4830 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: |