diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-08-19 13:13:51 +0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-08-19 18:24:37 +0200 |
commit | f932910323bf7188f70c49789ce85392c36e06b4 (patch) | |
tree | bd659b920227481ec0c42994a2cde739f9859644 /lib | |
parent | e51ae0ecd3d4280397924d71a997726e97b284c4 (diff) |
types.nix: Add ‘either’ type
Diffstat (limited to 'lib')
-rw-r--r-- | lib/types.nix | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/types.nix b/lib/types.nix index f5700ab0269a3..0e2b6515e1655 100644 --- a/lib/types.nix +++ b/lib/types.nix @@ -200,6 +200,12 @@ rec { merge = mergeOneOption; }; + either = t1: t2: mkOptionType { + name = "${t1.name} or ${t2.name}"; + check = x: t1.check x || t2.check x; + merge = mergeOneOption; + }; + # Obsolete alternative to configOf. It takes its option # declarations from the ‘options’ attribute of containing option # declaration. |