about summary refs log tree commit diff
path: root/lib/types.nix
diff options
context:
space:
mode:
authorRobert Hensing <robert@roberthensing.nl>2022-03-10 20:25:49 +0100
committerRobert Hensing <robert@roberthensing.nl>2022-03-10 20:25:49 +0100
commit55ee7ab4a6b5281cf1c352bc714b07c59c4546ee (patch)
tree88e1047bc4f89890be69997da44acdb5e5bb715c /lib/types.nix
parent87fce11f62f21409321ce0f2441f03901c9c8a9f (diff)
lib.types.optionType: Only merge when necessary
Diffstat (limited to 'lib/types.nix')
-rw-r--r--lib/types.nix4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/types.nix b/lib/types.nix
index 3fcac9c31b313..2e7261f7553c6 100644
--- a/lib/types.nix
+++ b/lib/types.nix
@@ -535,7 +535,9 @@ rec {
       description = "optionType";
       check = value: value._type or null == "option-type";
       merge = loc: defs:
-        let
+        if length defs == 1
+        then (head defs).value
+        else let
           # Prepares the type definitions for mergeOptionDecls, which
           # annotates submodules types with file locations
           optionModules = map ({ value, file }: