From f932910323bf7188f70c49789ce85392c36e06b4 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 19 Aug 2014 13:13:51 +0200 Subject: [PATCH] =?UTF-8?q?types.nix:=20Add=20=E2=80=98either=E2=80=99=20t?= =?UTF-8?q?ype?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/types.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/types.nix b/lib/types.nix index f5700ab0269..0e2b6515e16 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.