-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add licenseCheckPredicate for arbitrary license checks #72079
Conversation
This can be used to implement custom whitelisting and blacklisting, e.g. to allow exceptions for certain packages.
@@ -230,6 +231,8 @@ let | |||
{ valid = false; reason = "unfree"; errormsg = "has an unfree license (‘${showLicense attrs.meta.license}’)"; } | |||
else if hasBlacklistedLicense attrs then | |||
{ valid = false; reason = "blacklisted"; errormsg = "has a blacklisted license (‘${showLicense attrs.meta.license}’)"; } | |||
else if hasLicense attrs && !(licenseCheckPredicate attrs) then | |||
{ valid = false; reason = "blacklisted"; errormsg = "failed licenseCheckPredicate (‘${showLicense attrs.meta.license}’)"; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I decided to reuse the "blacklisted"
reason string here because I wasn't sure if something else handles these strings elsewhere. Alternatively we could have a new one like "license-check-failed"
or something.
Thank you for your contributions.
|
I marked this as stale due to inactivity. → More info |
Motivation for this change
This can be used to implement custom whitelisting and blacklisting,
e.g. to allow exceptions for certain packages.
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)Notify maintainers
cc @