stdenv/problems: use early knowledge of allowBroken and allowBrokenPredicate

(cherry picked from commit 5616e3d925)
This commit is contained in:
Eman Resu 2026-05-25 21:51:56 -04:00 committed by github-actions[bot]
commit bd8250ab96

View file

@ -121,14 +121,16 @@ rec {
allowBroken = config.allowBroken || builtins.getEnv "NIXPKGS_ALLOW_BROKEN" == "1";
allowBrokenPredicate =
if config ? allowBrokenPredicate then
lib.warnIf (lib.oldestSupportedReleaseIsAtLeast 2605)
"config.allowBrokenPredicate is deprecated, use config.problems.handlers.myPackage.broken = \"warn\" for individual packages instead."
config.allowBrokenPredicate
else
x: false;
lib.warnIf (lib.oldestSupportedReleaseIsAtLeast 2605)
"config.allowBrokenPredicate is deprecated, use config.problems.handlers.myPackage.broken = \"warn\" for individual packages instead."
config.allowBrokenPredicate;
in
attrs: attrs.meta.broken or false && !allowBroken && !allowBrokenPredicate attrs;
if allowBroken then
attrs: false
else if config ? allowBrokenPredicate then
attrs: attrs.meta.broken or false && !allowBrokenPredicate attrs
else
attrs: attrs.meta.broken or false;
value.message = "This package is broken.";
}
];