Unfree packages cannot be installed: selector matches no derivations

Hi! Recently installed nixos on a system tracking 21.11. I’m having issues installing unfree packages, Minecraft specifically:

[xxx@xxx:~/projects/twl-nix]$ nix-env -i minecraft
error: selector 'minecraft' matches no derivations

I have:

  1. allowUnfree enabled at the user level:

    [xxx@xxx:~/projects/twl-nix]$ cat ~/.config/nixpkgs/config.nix
    { allowUnfree = true; }
    
  2. allowUnfree enabled at the system level:

    [xxx@xxx:~/projects/twl-nix]$ sudo nixos-option nixpkgs.config
    Value:
    { allowUnfree = true; }
    
    Default:
    { }
    

Ive also tried installing at the system level (sudo).

Any ideas what I’m doing wrong? I’ve tried the usual troubleshooting steps (updating the channel nixos-rebuild, etc)

Thanks!

try: $ nix-env -iA nixos.minecraft

2 Likes

That worked!!! Why did it work though?

it’s an implementation detail:

image

nix-env -i would match if you provide it minecraft-launcher, whereas nix-env -iA would match if you provide it minecraft

generally you want to use -iA because it’s faster

1 Like