nix-env silently fails to install unfree packages when allowUnfree = false; and returns success:
$ nix-env -iA nixpkgs.unrar
$ echo $?
0
$ nix build nixpkgs.unrar
error: Package ‘unrar-5.5.8’ in <nixpkgs>/pkgs/tools/archivers/unrar/default.nix:39 has an unfree license (‘unfreeRedistributable’), refusing to evaluate.
a) For `nixos-rebuild` you can set
{ nixpkgs.config.allowUnfree = true; }
in configuration.nix to override this.
b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
{ allowUnfree = true; }
to ~/.config/nixpkgs/config.nix.
(use '--show-trace' to show detailed location information)
Feels like it should display the same error that nix build does.
nix-envsilently fails to install unfree packages whenallowUnfree = false;and returns success:Feels like it should display the same error that
nix builddoes.