Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion nixos/modules/hardware/all-firmware.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions pkgs/stdenv/generic/check-meta.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 [];
Expand All @@ -34,10 +34,10 @@ let
hasBlocklistedLicense = assert areLicenseListsValid; attrs:
hasLicense attrs && lib.lists.any (l: builtins.elem l blocklist) (lib.lists.toList attrs.meta.license);

allowBroken = config.allowBroken or false
allowBroken = config.allowBroken
|| builtins.getEnv "NIXPKGS_ALLOW_BROKEN" == "1";

allowUnsupportedSystem = config.allowUnsupportedSystem or false
allowUnsupportedSystem = config.allowUnsupportedSystem
|| builtins.getEnv "NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM" == "1";

isUnfree = licenses: lib.lists.any (l: !l.free or true) licenses;
Expand Down
36 changes: 36 additions & 0 deletions pkgs/top-level/config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,42 @@ 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.
'';
};

allowBroken = mkOption {
type = types.bool;
default = false;
# getEnv part is in check-meta.nix
defaultText = literalExpression ''false || builtins.getEnv "NIXPKGS_ALLOW_BROKEN" == "1"'';
description = ''
Whether to allow broken packages.

See <link xlink:href="https://nixos.org/manual/nixpkgs/stable/#sec-allow-broken">Installing broken packages</link> in the NixOS manual.
'';
};

allowUnsupportedSystem = mkOption {
type = types.bool;
default = false;
# getEnv part is in check-meta.nix
defaultText = literalExpression ''false || builtins.getEnv "NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM" == "1"'';
description = ''
Whether to allow unsupported packages.

See <link xlink:href="https://nixos.org/manual/nixpkgs/stable/#sec-allow-unsupported-system">Installing packages on unsupported systems</link> in the NixOS manual.
'';
};

};

in {
Expand Down