mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-10 08:39:08 +03:00
config.allowUnfree: define as option
This commit is contained in:
parent
a585b1c709
commit
1c49b81263
@ -72,7 +72,7 @@ in {
|
||||
})
|
||||
(mkIf cfg.enableAllFirmware {
|
||||
assertions = [{
|
||||
assertion = !cfg.enableAllFirmware || (config.nixpkgs.config.allowUnfree or false);
|
||||
assertion = !cfg.enableAllFirmware || config.nixpkgs.config.allowUnfree;
|
||||
message = ''
|
||||
the list of hardware.enableAllFirmware contains non-redistributable licensed firmware files.
|
||||
This requires nixpkgs.config.allowUnfree to be true.
|
||||
|
@ -13,7 +13,7 @@ let
|
||||
# for why this defaults to false, but I (@copumpkin) want to default it to true soon.
|
||||
shouldCheckMeta = config.checkMeta or false;
|
||||
|
||||
allowUnfree = config.allowUnfree or false
|
||||
allowUnfree = config.allowUnfree
|
||||
|| builtins.getEnv "NIXPKGS_ALLOW_UNFREE" == "1";
|
||||
|
||||
allowlist = config.allowlistedLicenses or config.whitelistedLicenses or [];
|
||||
|
@ -58,6 +58,18 @@ let
|
||||
'';
|
||||
};
|
||||
|
||||
allowUnfree = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
# getEnv part is in check-meta.nix
|
||||
defaultText = literalExpression ''false || builtins.getEnv "NIXPKGS_ALLOW_UNFREE" == "1"'';
|
||||
description = ''
|
||||
Whether to allow unfree packages.
|
||||
|
||||
See <link xlink:href="https://nixos.org/manual/nixpkgs/stable/#sec-allow-unfree">Installing unfree packages</link> in the NixOS manual.
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
in {
|
||||
|
Loading…
Reference in New Issue
Block a user