[Backport release-24.11] doc: change allowInsecurePredicate example to a useful one (#357899)

This commit is contained in:
Aleksana 2024-11-21 21:07:42 +08:00 committed by GitHub
commit 96dcda230c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -154,11 +154,13 @@ There are several ways to tweak how Nix handles a package which has been marked
The `allowInsecurePredicate` option is a function which accepts a package and returns a boolean, much like `allowUnfreePredicate`.
The following configuration example only allows insecure packages with very short names:
The following configuration example allows any version of the `ovftool` package:
```nix
{
allowInsecurePredicate = pkg: builtins.stringLength (lib.getName pkg) <= 5;
allowInsecurePredicate = pkg: builtins.elem (lib.getName pkg) [
"ovftool"
];
}
```