Unfree software: Difference between revisions

imported>Samueldr
m Minor nitpicks
DoggoBit (talk | contribs)
m Standalone Home Manager: Fix nowiki tag
 
(38 intermediate revisions by 16 users not shown)
Line 1: Line 1:
__NOTOC__{{#tweekihide:firstHeading}}<onlyinclude>
{{expansion}}
== How can I install a proprietary or unfree package? ==


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'':
Unfree software refers to software that has restrictive licensing on modification and/or redistribution. This type of software cannot be freely provided or distributed in an official capacity, which means that unfree software is neither built by [[Hydra]], nor cached on the official [[Binary Cache|binary cache]]. Despite this, Nixpkgs offers a very large collection of unfree software as derivations, however they cannot be used by default without configuring Nixpkgs and opting in to unfree software usage.


<syntaxhighlight lang="nix">
[https://nixos.org/manual/nixpkgs/stable/#sec-allow-unfree Nixpkgs manual on allowing unfree packages]
{
 
  ...
== Allowing unfree software ==
  allowUnfree = true;
By default, nix will refuse to evaluate any [[Derivations|derivation]] containing unfree software, prompting the user to read the manual for more details. This behaviour can be configured in different ways depending on the context of the derivation.
}
</syntaxhighlight>


If you want to enable unfree packages system-wide, then set in your <code>/etc/nixos/configuration.nix</code>:
=== Unfree software using Home Manager ===
Depending on your [[Home Manager]] installation, there are multiple ways to allow unfree software.


<syntaxhighlight lang="nix">
==== Standalone Home Manager ====
If your Home Manager configuration isn't integrated into your [[NixOS]] configuration (i.e. you switch generations using <code>home-manager switch</code> and not by rebuilding the whole system), then you may allow unfree software by setting the nixpkgs option in your config:
{{File|3=<nowiki>{ ... }:
{
{
   ...
   ...
   nixpkgs.config.allowUnfree = true;
   nixpkgs.config.allowUnfree = true;
}
}</nowiki>|name=home.nix|lang=nix}}
</syntaxhighlight>
[[Category:Software]]
'''Note that this alone will not allow you to search for or install packages with nix-env.'''
[[Category:Nixpkgs]]
 
For temporary allowing unfree packages you can set the environment variable ''NIXPKGS_ALLOW_UNFREE'', e.g.
 
<syntaxhighlight lang="bash">NIXPKGS_ALLOW_UNFREE=1 nix-env</syntaxhighlight>
 
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.
</onlyinclude>