FAQ: Difference between revisions

imported>Makefu
imported>Samueldr
Line 314: Line 314:
* the package is part of an attribute set and <code>nix-env</code> doesn't recurse into this set (see ''pkgs.recurseIntoAttrs''), use <code>nix-env -qaP -A haskellPackages</code> for listing these entries
* the package is part of an attribute set and <code>nix-env</code> doesn't recurse into this set (see ''pkgs.recurseIntoAttrs''), use <code>nix-env -qaP -A haskellPackages</code> for listing these entries


== How can I install a proprietary or unfree package? ==
{{:FAQ/unfree}}
 
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'':
 
<syntaxhighlight lang="nix">
{
  ...
  allowUnfree = true;
}
</syntaxhighlight>
 
If you want to enable unfree packages system-wide, then set in your <code>/etc/nixos/configuration.nix</code>:
 
<syntaxhighlight lang="nix">
{
  ...
  nixpkgs.config.allowUnfree = true;
}
</syntaxhighlight>
'''Note that this alone will not allow you to search for or install packages with nix-env.'''
 
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.


== How can I install a package from unstable while remaining on the stable channel? ==
== How can I install a package from unstable while remaining on the stable channel? ==