diff options
author | Vladimír Čunát <vcunat@gmail.com> | 2014-06-15 17:55:35 +0200 |
---|---|---|
committer | Vladimír Čunát <vcunat@gmail.com> | 2014-06-15 17:55:35 +0200 |
commit | 9757785295b95aa67d0c824dae73721fe47e7d5b (patch) | |
tree | 9dfebfef885900bc44d537d13b6c08c807262c67 /pkgs/stdenv/generic/default.nix | |
parent | de12094b0e97e36485a26abce86a014d4bddd0de (diff) | |
parent | 0d71d2b631a1c31763806e6878c88db9f0a53e52 (diff) | |
download | nixlib-9757785295b95aa67d0c824dae73721fe47e7d5b.tar nixlib-9757785295b95aa67d0c824dae73721fe47e7d5b.tar.gz nixlib-9757785295b95aa67d0c824dae73721fe47e7d5b.tar.bz2 nixlib-9757785295b95aa67d0c824dae73721fe47e7d5b.tar.lz nixlib-9757785295b95aa67d0c824dae73721fe47e7d5b.tar.xz nixlib-9757785295b95aa67d0c824dae73721fe47e7d5b.tar.zst nixlib-9757785295b95aa67d0c824dae73721fe47e7d5b.zip |
Merge recent master
Diffstat (limited to 'pkgs/stdenv/generic/default.nix')
-rw-r--r-- | pkgs/stdenv/generic/default.nix | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix index cba456313f39..c34d30d92e01 100644 --- a/pkgs/stdenv/generic/default.nix +++ b/pkgs/stdenv/generic/default.nix @@ -18,6 +18,15 @@ let allowUnfree = config.allowUnfree or false || builtins.getEnv "NIXPKGS_ALLOW_UNFREE" == "1"; + # Alow granular checks to allow only some unfree packages + # Example: + # {pkgs, ...}: + # { + # allowUnfree = false; + # allowUnfreePredicate = (x: pkgs.lib.hasPrefix "flashplayero-" x.name); + # } + allowUnfreePredicate = config.allowUnfreePredicate or (x: false); + allowBroken = config.allowBroken or false || builtins.getEnv "NIXPKGS_ALLOW_BROKEN" == "1"; unsafeGetAttrPos = builtins.unsafeGetAttrPos or (n: as: null); @@ -67,7 +76,7 @@ let unsafeGetAttrPos "name" attrs; pos' = if pos != null then "‘" + pos.file + ":" + toString pos.line + "’" else "«unknown-file»"; in - if !allowUnfree && (let l = lib.lists.toList attrs.meta.license or []; in lib.lists.elem "unfree" l || lib.lists.elem "unfree-redistributable" l) then + if !allowUnfree && (let l = lib.lists.toList attrs.meta.license or []; in lib.lists.elem "unfree" l || lib.lists.elem "unfree-redistributable" l) && !(allowUnfreePredicate attrs) then throw '' Package ‘${attrs.name}’ in ${pos'} has an unfree license, refusing to evaluate. You can set { nixpkgs.config.allowUnfree = true; } |