config: add and document {allow,block}listedLicenses

Signed-off-by: Connor Baker <ConnorBaker01@gmail.com>
This commit is contained in:
Connor Baker 2025-08-31 16:39:33 +01:00 committed by Connor Baker
parent 494a8d96a8
commit f5deefd463
2 changed files with 32 additions and 2 deletions

View file

@ -64,8 +64,8 @@ let
in
if envVar != "" then envVar != "0" else config.allowNonSource or true;
allowlist = config.allowlistedLicenses or config.whitelistedLicenses or [ ];
blocklist = config.blocklistedLicenses or config.blacklistedLicenses or [ ];
allowlist = config.allowlistedLicenses;
blocklist = config.blocklistedLicenses;
areLicenseListsValid =
if mutuallyExclusive allowlist blocklist then

View file

@ -229,6 +229,36 @@ let
'';
};
allowlistedLicenses = mkOption {
description = ''
Allow licenses that are specifically acceptable. `allowlistedLicenses` only applies to unfree licenses unless
`allowUnfree` is enabled. It is not a generic allowlist for all types of licenses.
'';
default = [ ];
type = types.listOf (types.attrsOf types.anything);
example = literalExpression ''
with lib.licenses; [
amd
wtfpl
]
'';
};
blocklistedLicenses = mkOption {
description = ''
Block licenses that are specifically unacceptable. Unlike `allowlistedLicenses`, `blocklistedLicenses`
applies to all licenses.
'';
default = [ ];
type = types.listOf (types.attrsOf types.anything);
example = literalExpression ''
with lib.licenses; [
agpl3Only
gpl3Only
]
'';
};
cudaSupport = mkMassRebuild {
feature = "build packages with CUDA support by default";
};