Skip to content

nix-env silently fails to install unfree packages #1963

@obadz

Description

@obadz

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.

Metadata

Metadata

Assignees

Labels

UXThe way in which users interact with Nix. Higher level than UI.bugcliThe old and/or new command line interface

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions