git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #171248 from Artturin/addtoconfig1
commite982910064a560df26bc64c3d431f293d89382d3 authorArtturi <Artturin@artturin.com> dateTue 3 May 2022, 15:44 (5 years ago) parent8d03b249f05fc6
3 files changed+40−4
nixos/modules/hardware/all-firmware.nix+1−1 pkgs/stdenv/generic/check-meta.nix+3−3 pkgs/top-level/config.nix+36
nixos/modules/hardware/all-firmware.nix+1−1
@@ -72,7 +72,7 @@ in {
7272 })
7373 (mkIf cfg.enableAllFirmware {
7474 assertions = [{
75− assertion = !cfg.enableAllFirmware || (config.nixpkgs.config.allowUnfree or false);
75+ assertion = !cfg.enableAllFirmware || config.nixpkgs.config.allowUnfree;
7676 message = ''
7777 the list of hardware.enableAllFirmware contains non-redistributable licensed firmware files.
7878 This requires nixpkgs.config.allowUnfree to be true.
pkgs/stdenv/generic/check-meta.nix+3−3
@@ -13,7 +13,7 @@ let
1313 # for why this defaults to false, but I (@copumpkin) want to default it to true soon.
1414 shouldCheckMeta = config.checkMeta or false;
1515
16− allowUnfree = config.allowUnfree or false
16+ allowUnfree = config.allowUnfree
1717 || builtins.getEnv "NIXPKGS_ALLOW_UNFREE" == "1";
1818
1919 allowlist = config.allowlistedLicenses or config.whitelistedLicenses or [];
@@ -34,10 +34,10 @@ let
3434 hasBlocklistedLicense = assert areLicenseListsValid; attrs:
3535 hasLicense attrs && lib.lists.any (l: builtins.elem l blocklist) (lib.lists.toList attrs.meta.license);
3636
37− allowBroken = config.allowBroken or false
37+ allowBroken = config.allowBroken
3838 || builtins.getEnv "NIXPKGS_ALLOW_BROKEN" == "1";
3939
40− allowUnsupportedSystem = config.allowUnsupportedSystem or false
40+ allowUnsupportedSystem = config.allowUnsupportedSystem
4141 || builtins.getEnv "NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM" == "1";
4242
4343 isUnfree = licenses: lib.lists.any (l: !l.free or true) licenses;
pkgs/top-level/config.nix+36
@@ -58,6 +58,42 @@ let
5858 '';
5959 };
6060
61+ allowUnfree = mkOption {
62+ type = types.bool;
63+ default = false;
64+ # getEnv part is in check-meta.nix
65+ defaultText = literalExpression ''false || builtins.getEnv "NIXPKGS_ALLOW_UNFREE" == "1"'';
66+ description = ''
67+ Whether to allow unfree packages.
68+
69+ See <link xlink:href="https://nixos.org/manual/nixpkgs/stable/#sec-allow-unfree">Installing unfree packages</link> in the NixOS manual.
70+ '';
71+ };
72+
73+ allowBroken = mkOption {
74+ type = types.bool;
75+ default = false;
76+ # getEnv part is in check-meta.nix
77+ defaultText = literalExpression ''false || builtins.getEnv "NIXPKGS_ALLOW_BROKEN" == "1"'';
78+ description = ''
79+ Whether to allow broken packages.
80+
81+ See <link xlink:href="https://nixos.org/manual/nixpkgs/stable/#sec-allow-broken">Installing broken packages</link> in the NixOS manual.
82+ '';
83+ };
84+
85+ allowUnsupportedSystem = mkOption {
86+ type = types.bool;
87+ default = false;
88+ # getEnv part is in check-meta.nix
89+ defaultText = literalExpression ''false || builtins.getEnv "NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM" == "1"'';
90+ description = ''
91+ Whether to allow unsupported packages.
92+
93+ See <link xlink:href="https://nixos.org/manual/nixpkgs/stable/#sec-allow-unsupported-system">Installing packages on unsupported systems</link> in the NixOS manual.
94+ '';
95+ };
96+
6197 };
6298
6399in {