From ebe8fab999e6333953849cf300b89ed7e9b968be Mon Sep 17 00:00:00 2001 From: Alexander Kjeldaas Date: Mon, 14 Apr 2014 09:22:31 +0200 Subject: [PATCH] Make the user aware of the allowUnfree option. --- pkgs/stdenv/generic/default.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix index 3a475933d24f..035e15169327 100644 --- a/pkgs/stdenv/generic/default.nix +++ b/pkgs/stdenv/generic/default.nix @@ -58,7 +58,16 @@ let 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 - throw "package ‘${attrs.name}’ in ${pos'} has an unfree license, refusing to evaluate" + throw ''package ‘${attrs.name}’ in ${pos'} has an unfree license, refusing to evaluate. + You can set + { nixpkgs.config.allowUnfree = true; } + in configuration.nix to override this. + If you use nix standalnd, you can add + { config.allowUnfree = true; } + to ~/.nixpkgs/config.nix or pass + --arg config '{ allowUnfree = true; }' + on the command line. + '' else if !allowBroken && attrs.meta.broken or false then throw "you can't use package ‘${attrs.name}’ in ${pos'} because it has been marked as broken" else if !allowBroken && attrs.meta.platforms or null != null && !lib.lists.elem result.system attrs.meta.platforms then