config: Deprecate allowBrokenPredicate in favor of problems.handlers
This commit is contained in:
@@ -41,11 +41,11 @@ There are several ways to try compiling a package which has been marked as broke
|
||||
$ export NIXPKGS_ALLOW_BROKEN=1
|
||||
```
|
||||
|
||||
- For permanently allowing broken packages that match some condition to be built, you may add `allowBrokenPredicate` to your user's configuration file with the desired condition, for example:
|
||||
- For permanently allowing broken packages with a specific name to be built, you may add a corresponding `problems.handlers` to your user's configuration file, for example:
|
||||
|
||||
```nix
|
||||
{
|
||||
allowBrokenPredicate = pkg: builtins.elem (pkgs.lib.getName pkg) [ "hello" ];
|
||||
problems.handlers.hello.broken = "warn"; # or "ignore"
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -118,7 +118,13 @@ rec {
|
||||
# TODO: Consider deprecating this or making it generic for all problems
|
||||
allowBroken = config.allowBroken || builtins.getEnv "NIXPKGS_ALLOW_BROKEN" == "1";
|
||||
|
||||
allowBrokenPredicate = config.allowBrokenPredicate or (x: false);
|
||||
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;
|
||||
in
|
||||
attrs: attrs.meta.broken or false && !allowBroken && !allowBrokenPredicate attrs;
|
||||
value.message = "This package is broken.";
|
||||
|
||||
Reference in New Issue
Block a user