summary refs log tree commit diff
path: root/pkgs/stdenv
diff options
context:
space:
mode:
authorzimbatm <zimbatm@zimbatm.com>2019-11-03 17:40:43 +0000
committerGitHub <noreply@github.com>2019-11-03 17:40:43 +0000
commit71184f8e157672789602d3f28bdd3c8079800687 (patch)
treee5edbe7780c58167826c3ab0e6406ef145ba7111 /pkgs/stdenv
parent59edabf8ca74bc8a86f03cabad79bf5a6e272d0a (diff)
downloadnixpkgs-71184f8e157672789602d3f28bdd3c8079800687.tar
nixpkgs-71184f8e157672789602d3f28bdd3c8079800687.tar.gz
nixpkgs-71184f8e157672789602d3f28bdd3c8079800687.tar.bz2
nixpkgs-71184f8e157672789602d3f28bdd3c8079800687.tar.lz
nixpkgs-71184f8e157672789602d3f28bdd3c8079800687.tar.xz
nixpkgs-71184f8e157672789602d3f28bdd3c8079800687.tar.zst
nixpkgs-71184f8e157672789602d3f28bdd3c8079800687.zip
stdenv/check-meta: getEnv if the attribute is unset (#72376)
There were two issues:

* builtins.getEnv was called deep into the nixpkgs tree making it hard
  to discover. This is solved by moving the call into
  pkgs/top-level/impure.nix
* when the config was explicitly set by the user to false, it would
  still try and load the environment variable. This meant that it was
  not possible to guarantee the same outcome on two different systems.
Diffstat (limited to 'pkgs/stdenv')
-rw-r--r--pkgs/stdenv/generic/check-meta.nix11
1 files changed, 4 insertions, 7 deletions
diff --git a/pkgs/stdenv/generic/check-meta.nix b/pkgs/stdenv/generic/check-meta.nix
index 6bd6a9bf41e..85a1051ceed 100644
--- a/pkgs/stdenv/generic/check-meta.nix
+++ b/pkgs/stdenv/generic/check-meta.nix
@@ -13,8 +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
-    || builtins.getEnv "NIXPKGS_ALLOW_UNFREE" == "1";
+  allowUnfree = config.allowUnfree or false;
 
   whitelist = config.whitelistedLicenses or [];
   blacklist = config.blacklistedLicenses or [];
@@ -41,11 +40,9 @@ let
   hasBlacklistedLicense = assert areLicenseListsValid; attrs:
     hasLicense attrs && lib.lists.any (l: builtins.elem l blacklist) (lib.lists.toList attrs.meta.license);
 
-  allowBroken = config.allowBroken or false
-    || builtins.getEnv "NIXPKGS_ALLOW_BROKEN" == "1";
+  allowBroken = config.allowBroken or false;
 
-  allowUnsupportedSystem = config.allowUnsupportedSystem or false
-    || builtins.getEnv "NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM" == "1";
+  allowUnsupportedSystem = config.allowUnsupportedSystem or false;
 
   isUnfree = licenses: lib.lists.any (l: !l.free or true) licenses;
 
@@ -73,7 +70,7 @@ let
   hasAllowedInsecure = attrs:
     (attrs.meta.knownVulnerabilities or []) == [] ||
     allowInsecurePredicate attrs ||
-    builtins.getEnv "NIXPKGS_ALLOW_INSECURE" == "1";
+    config.allowInsecure or false;
 
   showLicense = license: toString (map (l: l.shortName or "unknown") (lib.lists.toList license));