From NixOS Wiki
Jump to: navigation, search
(no reboot required for nixpkgs.config.allowUnfree = true;)
Line 23: Line 23:
 
}
 
}
 
</syntaxhighlight>
 
</syntaxhighlight>
'''Note that this alone will not allow you to search for or install packages with nix-env without the user configed. You must reboot for unfree to take effect.''' See the previous section.
+
'''Note that this alone will not allow you to search for or install packages with nix-env without the user configured.''' See the previous section. No reboot is required for unfree to take effect, however you need to run <code>nixos-rebuild switch</code> just like for all other changes to your systems <code>configuration.nix</code>
  
 
=== Temporary allowing ===
 
=== Temporary allowing ===

Revision as of 21:13, 14 January 2019

How can I install a proprietary or unfree package?

Configuration for a user

You won't be able to install or search for an unfree package as a user, unless you explicitly enable it in ~/.config/nixpkgs/config.nix (the file and folder may need to be created):

{
  # [...]
  allowUnfree = true;
}

System-level configuration (NixOS)

When using NixOS, it is possible to enable unfree for eg. environment.systemPackages with the following setting in your /etc/nixos/configuration.nix:

{
  # [...]
  nixpkgs.config.allowUnfree = true;
}

Note that this alone will not allow you to search for or install packages with nix-env without the user configured. See the previous section. No reboot is required for unfree to take effect, however you need to run nixos-rebuild switch just like for all other changes to your systems configuration.nix

Temporary allowing

For temporary allowing unfree packages you can set the environment variable NIXPKGS_ALLOW_UNFREE, e.g.

NIXPKGS_ALLOW_UNFREE=1 nix-env

More precision

For whitelisting only specific unfree packages or unfree licenses see the "Installing unfree packages" section of the Nixpkgs manual.

Note that we are not able to test or build unfree software on Hydra due to policy. Most unfree licenses prohibit us from either executing or distributing the software.