Unfree software: Difference between revisions
Update code |
Tomodachi94 (talk | contribs) m Tomodachi94 moved page Unfree Software to Unfree software: use sentance case |
||
(7 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 both NixOS system level configuration and | === Per-package (preferred) === | ||
This method works for both NixOS system level configuration and [[Home Manager]]: | |||
{{file|/etc/nixos/configuration.nix|nix|<nowiki> | {{file|/etc/nixos/configuration.nix|nix|<nowiki> | ||
{ | { | ||
allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ | nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ | ||
"vscode" | "vscode" | ||
]; | ]; | ||
Line 15: | Line 16: | ||
=== 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> | {{file|/etc/nixos/configuration.nix|nix|<nowiki> | ||
Line 23: | Line 24: | ||
</nowiki>}} | </nowiki>}} | ||
=== Command | === Command line === | ||
You won't be able to install or search for an unfree package as a user unless you explicitly enable it: | You won't be able to install or search for an unfree package as a user unless you explicitly enable it: | ||
Line 29: | Line 30: | ||
{{file|~/.config/nixpkgs/config.nix|nix|<nowiki> | {{file|~/.config/nixpkgs/config.nix|nix|<nowiki> | ||
{ | { | ||
allowUnfree = true; | |||
} | } | ||
</nowiki>}} | </nowiki>}} | ||
=== | === Temporarily allowing === | ||
For temporary allowing unfree packages, you can use an environment variable: | For temporary allowing unfree packages, you can use an environment variable: | ||
Line 44: | Line 45: | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
$ NIXPKGS_ALLOW_UNFREE=1 nix run --impure | $ NIXPKGS_ALLOW_UNFREE=1 nix run nixpkgs#vscode --impure | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=== See also == | == 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]] |
Latest revision as of 05:59, 21 June 2024
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.
Using unfree packages
Per-package (preferred)
This method works for both NixOS system level configuration and Home Manager:
/etc/nixos/configuration.nix
{
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
"vscode"
];
}
For all packages
This method works for both NixOS system level configuration and Home Manager:
/etc/nixos/configuration.nix
{
nixpkgs.config.allowUnfree = true;
}
Command line
You won't be able to install or search for an unfree package as a user unless you explicitly enable it:
~/.config/nixpkgs/config.nix
{
allowUnfree = true;
}
Temporarily allowing
For temporary allowing unfree packages, you can use an environment variable:
$ NIXPKGS_ALLOW_UNFREE=1 nix-shell -p vscode
Note for the new nix3-style commands, you need to pass --impure
as well:
$ NIXPKGS_ALLOW_UNFREE=1 nix run nixpkgs#vscode --impure
Hydra
Hydra does not build unfree software, and unfree software is unavailable in cache.nixos.org
.