diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-01-17 23:41:37 +0100 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-01-17 23:41:37 +0100 |
commit | d8e722985bac5f8448d5287840ee50517154443e (patch) | |
tree | d1befab571cd238568045bf371a09d5db593c67c /pkgs/stdenv | |
parent | deaef8abaf312723300e1c156346573eedfdb70a (diff) | |
download | nixlib-d8e722985bac5f8448d5287840ee50517154443e.tar nixlib-d8e722985bac5f8448d5287840ee50517154443e.tar.gz nixlib-d8e722985bac5f8448d5287840ee50517154443e.tar.bz2 nixlib-d8e722985bac5f8448d5287840ee50517154443e.tar.lz nixlib-d8e722985bac5f8448d5287840ee50517154443e.tar.xz nixlib-d8e722985bac5f8448d5287840ee50517154443e.tar.zst nixlib-d8e722985bac5f8448d5287840ee50517154443e.zip |
Add config option ‘allowUnfree’
If set to false, mkDerivation will throw an exception if a package has an unfree license. ‘release-lib.nix’ uses this to enforce that we don't build unfree packages as part of the Nixpkgs channel. Since this is set through Nixpkgs' ‘config’ argument, it's more finegrained than $HYDRA_DISALLOW_UNFREE.
Diffstat (limited to 'pkgs/stdenv')
-rw-r--r-- | pkgs/stdenv/generic/default.nix | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix index 852be9612fb5..b6836ca8d79c 100644 --- a/pkgs/stdenv/generic/default.nix +++ b/pkgs/stdenv/generic/default.nix @@ -10,7 +10,7 @@ let lib = import ../../lib; - disallowUnfree = builtins.getEnv "HYDRA_DISALLOW_UNFREE" == "1"; + allowUnfree = config.allowUnfree or true && builtins.getEnv "HYDRA_DISALLOW_UNFREE" != "1"; stdenvGenerator = setupScript: rec { @@ -41,7 +41,7 @@ let # Add a utility function to produce derivations that use this # stdenv and its shell. mkDerivation = attrs: - if disallowUnfree && attrs.meta.license or "" == "unfree" then + if !allowUnfree && attrs.meta.license or "" == "unfree" then throw "package ‘${attrs.name}’ has an unfree license, refusing to evaluate" else (derivation ( |