Formatting

This commit is contained in:
Eelco Dolstra 2014-06-25 16:51:18 +02:00
parent 37889e2b5e
commit 0a8605ded1

View File

@ -23,7 +23,7 @@ let
# {pkgs, ...}: # {pkgs, ...}:
# { # {
# allowUnfree = false; # allowUnfree = false;
# allowUnfreePredicate = (x: pkgs.lib.hasPrefix "flashplayero-" x.name); # allowUnfreePredicate = (x: pkgs.lib.hasPrefix "flashplayer-" x.name);
# } # }
allowUnfreePredicate = config.allowUnfreePredicate or (x: false); allowUnfreePredicate = config.allowUnfreePredicate or (x: false);
@ -74,7 +74,9 @@ let
unsafeGetAttrPos "name" attrs; unsafeGetAttrPos "name" attrs;
pos' = if pos != null then "" + pos.file + ":" + toString pos.line + "" else "«unknown-file»"; pos' = if pos != null then "" + pos.file + ":" + toString pos.line + "" else "«unknown-file»";
in in
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 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 '' throw ''
Package ${attrs.name} in ${pos'} has an unfree license, refusing to evaluate. You can set Package ${attrs.name} in ${pos'} has an unfree license, refusing to evaluate. You can set
{ nixpkgs.config.allowUnfree = true; } { nixpkgs.config.allowUnfree = true; }