Unfree software: Difference between revisions
imported>GetPsyched m Typo in commit |
m Category:Nixpkgs added Tags: Mobile edit Mobile web edit |
||
(11 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
'''Unfree software''', sometimes called '''nonfree software''', is software that cannot be freely modified or distributed. [[Nixpkgs]] provides packages for unfree software, but additional configuration is required before they can be used. | |||
=== Per-package ( | == Using unfree packages == | ||
This method works for NixOS system level configuration and Home | === Per-package (preferred) === | ||
< | This method works for both NixOS system level configuration and [[Home Manager]]: | ||
nixpkgs.config.allowUnfreePredicate = pkg: | {{file|/etc/nixos/configuration.nix|nix|<nowiki> | ||
{ | |||
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ | |||
"vscode" | |||
]; | |||
} | } | ||
</ | |||
</nowiki>}} | |||
=== For all packages === | === For all packages === | ||
This method works for NixOS system | This method works for both NixOS system level configuration and [[Home Manager]]: | ||
< | {{file|/etc/nixos/configuration.nix|nix|<nowiki> | ||
{ | { | ||
nixpkgs.config.allowUnfree = true; | nixpkgs.config.allowUnfree = true; | ||
} | } | ||
</ | </nowiki>}} | ||
=== Command line === | |||
You won't be able to install or search for an unfree package as a user unless you explicitly enable it: | |||
< | {{file|~/.config/nixpkgs/config.nix|nix|<nowiki> | ||
{ | { | ||
allowUnfree = true; | |||
} | } | ||
</ | </nowiki>}} | ||
=== | === Temporarily allowing === | ||
For temporary allowing unfree packages, you can use an environment variable: | |||
<syntaxhighlight lang=" | <syntaxhighlight lang="bash"> | ||
$ NIXPKGS_ALLOW_UNFREE=1 nix-shell -p vscode | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Note for the new nix3-style commands, you need to pass <code>--impure</code> as well: | |||
== | <syntaxhighlight lang="bash"> | ||
$ NIXPKGS_ALLOW_UNFREE=1 nix run nixpkgs#vscode --impure | |||
</syntaxhighlight> | |||
== Hydra == | |||
[[Hydra]] does not build unfree software, and unfree software is unavailable in <code>cache.nixos.org</code>. | |||
== | == See also == | ||
* [https://nixos.org/nixpkgs/manual/#sec-allow-unfree Nixpkgs manual on allowing unfree packages] | |||
[[Category:Software]] | |||
[[Category:Nixpkgs]] | |||