summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--lib/types.nix5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/types.nix b/lib/types.nix
index a5b9d59e30f..4d336c1d946 100644
--- a/lib/types.nix
+++ b/lib/types.nix
@@ -159,10 +159,7 @@ in rec {
         attrOnly = attrsOf elemType;
       in mkOptionType {
         name = "list or attribute set of ${elemType.name}s";
-        check = x:
-          if isList x       then listOnly.check x
-          else if isAttrs x then attrOnly.check x
-          else false;
+        check = x: isList x || isAttrs x;
         merge = loc: defs: attrOnly.merge loc (imap convertIfList defs);
         getSubOptions = prefix: elemType.getSubOptions (prefix ++ ["<name?>"]);
         getSubModules = elemType.getSubModules;