This reverts commit 71184f8e157672789602d3f28bdd3c8079800687.
This commit is contained in:
parent
f397750416
commit
cf8a2d0225
@ -13,7 +13,8 @@ let
|
|||||||
# for why this defaults to false, but I (@copumpkin) want to default it to true soon.
|
# for why this defaults to false, but I (@copumpkin) want to default it to true soon.
|
||||||
shouldCheckMeta = config.checkMeta or false;
|
shouldCheckMeta = config.checkMeta or false;
|
||||||
|
|
||||||
allowUnfree = config.allowUnfree or false;
|
allowUnfree = config.allowUnfree or false
|
||||||
|
|| builtins.getEnv "NIXPKGS_ALLOW_UNFREE" == "1";
|
||||||
|
|
||||||
whitelist = config.whitelistedLicenses or [];
|
whitelist = config.whitelistedLicenses or [];
|
||||||
blacklist = config.blacklistedLicenses or [];
|
blacklist = config.blacklistedLicenses or [];
|
||||||
@ -40,9 +41,11 @@ let
|
|||||||
hasBlacklistedLicense = assert areLicenseListsValid; attrs:
|
hasBlacklistedLicense = assert areLicenseListsValid; attrs:
|
||||||
hasLicense attrs && lib.lists.any (l: builtins.elem l blacklist) (lib.lists.toList attrs.meta.license);
|
hasLicense attrs && lib.lists.any (l: builtins.elem l blacklist) (lib.lists.toList attrs.meta.license);
|
||||||
|
|
||||||
allowBroken = config.allowBroken or false;
|
allowBroken = config.allowBroken or false
|
||||||
|
|| builtins.getEnv "NIXPKGS_ALLOW_BROKEN" == "1";
|
||||||
|
|
||||||
allowUnsupportedSystem = config.allowUnsupportedSystem or false;
|
allowUnsupportedSystem = config.allowUnsupportedSystem or false
|
||||||
|
|| builtins.getEnv "NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM" == "1";
|
||||||
|
|
||||||
isUnfree = licenses: lib.lists.any (l: !l.free or true) licenses;
|
isUnfree = licenses: lib.lists.any (l: !l.free or true) licenses;
|
||||||
|
|
||||||
@ -70,7 +73,7 @@ let
|
|||||||
hasAllowedInsecure = attrs:
|
hasAllowedInsecure = attrs:
|
||||||
(attrs.meta.knownVulnerabilities or []) == [] ||
|
(attrs.meta.knownVulnerabilities or []) == [] ||
|
||||||
allowInsecurePredicate attrs ||
|
allowInsecurePredicate attrs ||
|
||||||
config.allowInsecure or false;
|
builtins.getEnv "NIXPKGS_ALLOW_INSECURE" == "1";
|
||||||
|
|
||||||
showLicense = license: toString (map (l: l.shortName or "unknown") (lib.lists.toList license));
|
showLicense = license: toString (map (l: l.shortName or "unknown") (lib.lists.toList license));
|
||||||
|
|
||||||
|
@ -10,14 +10,6 @@ let
|
|||||||
# Return ‘x’ if it evaluates, or ‘def’ if it throws an exception.
|
# Return ‘x’ if it evaluates, or ‘def’ if it throws an exception.
|
||||||
try = x: def: let res = tryEval x; in if res.success then res.value else def;
|
try = x: def: let res = tryEval x; in if res.success then res.value else def;
|
||||||
|
|
||||||
defaultConfig = {
|
|
||||||
# These attributes are used in pkgs/stdenv/generic/check-meta.nix
|
|
||||||
allowBroken = builtins.getEnv "NIXPKGS_ALLOW_BROKEN" == "1";
|
|
||||||
allowInsecure = builtins.getEnv "NIXPKGS_ALLOW_INSECURE" == "1";
|
|
||||||
allowUnfree = builtins.getEnv "NIXPKGS_ALLOW_UNFREE" == "1";
|
|
||||||
allowUnsupportedSystem = builtins.getEnv "NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM" == "1";
|
|
||||||
};
|
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
{ # We combine legacy `system` and `platform` into `localSystem`, if
|
{ # We combine legacy `system` and `platform` into `localSystem`, if
|
||||||
@ -90,10 +82,7 @@ in
|
|||||||
assert args ? localSystem -> !(args ? system || args ? platform);
|
assert args ? localSystem -> !(args ? system || args ? platform);
|
||||||
|
|
||||||
import ./. (builtins.removeAttrs args [ "system" "platform" ] // {
|
import ./. (builtins.removeAttrs args [ "system" "platform" ] // {
|
||||||
inherit overlays crossSystem crossOverlays;
|
inherit config overlays crossSystem crossOverlays;
|
||||||
|
|
||||||
config = defaultConfig // config;
|
|
||||||
|
|
||||||
# Fallback: Assume we are building packages on the current (build, in GNU
|
# Fallback: Assume we are building packages on the current (build, in GNU
|
||||||
# Autotools parlance) system.
|
# Autotools parlance) system.
|
||||||
localSystem = if builtins.isString localSystem then localSystem
|
localSystem = if builtins.isString localSystem then localSystem
|
||||||
|
Loading…
x
Reference in New Issue
Block a user