From 7063762d13524286c73085a3c986b2595ed5e10e Mon Sep 17 00:00:00 2001 From: Johannes Kirschbauer Date: Fri, 30 May 2025 16:23:32 +0200 Subject: [PATCH] lib/types: add doc warning to addCheck --- lib/types.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/types.nix b/lib/types.nix index 715da842ac01..5ef16ef2a0a3 100644 --- a/lib/types.nix +++ b/lib/types.nix @@ -1455,8 +1455,14 @@ let nestedTypes.coercedType = coercedType; nestedTypes.finalType = finalType; }; + /** + Augment the given type with an additional type check function. - # Augment the given type with an additional type check function. + :::{.warning} + This function has some broken behavior see: [#396021](https://github.com/NixOS/nixpkgs/issues/396021) + Fixing is not trivial, we appreciate any help! + ::: + */ addCheck = elemType: check: elemType // { check = x: elemType.check x && check x; }; };