diff options
Diffstat (limited to 'pkgs/stdenv/generic/check-meta.nix')
-rw-r--r-- | pkgs/stdenv/generic/check-meta.nix | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/pkgs/stdenv/generic/check-meta.nix b/pkgs/stdenv/generic/check-meta.nix index b754230b0be..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 []; @@ -36,16 +35,14 @@ let attrs ? meta.license; hasWhitelistedLicense = assert areLicenseListsValid; attrs: - hasLicense attrs && builtins.elem attrs.meta.license whitelist; + hasLicense attrs && lib.lists.any (l: builtins.elem l whitelist) (lib.lists.toList attrs.meta.license); hasBlacklistedLicense = assert areLicenseListsValid; attrs: - hasLicense attrs && builtins.elem attrs.meta.license blacklist; + 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,9 +70,9 @@ let hasAllowedInsecure = attrs: (attrs.meta.knownVulnerabilities or []) == [] || allowInsecurePredicate attrs || - builtins.getEnv "NIXPKGS_ALLOW_INSECURE" == "1"; + config.allowInsecure or false; - showLicense = license: license.shortName or "unknown"; + showLicense = license: toString (map (l: l.shortName or "unknown") (lib.lists.toList license)); pos_str = meta: meta.position or "«unknown-file»"; |