diff --git a/lib/types.nix b/lib/types.nix index a334db5c7247..45b0ae5042ce 100644 --- a/lib/types.nix +++ b/lib/types.nix @@ -420,7 +420,7 @@ rec { mkOptionType rec { name = "coercedTo"; description = "${finalType.description} or ${coercedType.description}"; - check = x: finalType.check x || coercedType.check x; + check = x: finalType.check x || (coercedType.check x && finalType.check (coerceFunc x)); merge = loc: defs: let coerceVal = val: