From ea872088f3479234de3d9fd3f3f79080313ca5b0 Mon Sep 17 00:00:00 2001 From: Eman Resu <78693624+quatquatt@users.noreply.github.com> Date: Thu, 7 May 2026 18:15:44 -0400 Subject: [PATCH] lib/types: only filter if we're actually getting an error --- lib/types.nix | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/types.nix b/lib/types.nix index 237d229058ff..d8afe7415d72 100644 --- a/lib/types.nix +++ b/lib/types.nix @@ -4,6 +4,7 @@ let inherit (lib) + all elem flip hasContext @@ -111,10 +112,15 @@ let checkDefsForError = check: loc: defs: - let - invalidDefs = filter (def: !check def.value) defs; - in - if invalidDefs != [ ] then { message = "Definition values: ${showDefs invalidDefs}"; } else null; + if all (def: check def.value) defs then + null + else + let + invalidDefs = filter (def: !check def.value) defs; + in + { + message = "Definition values: ${showDefs invalidDefs}"; + }; # Check that a type with v2 merge has a coherent check attribute. # Throws an error if the type uses an ad-hoc `type // { check }` override.