Unfree software: Difference between revisions
allowUnfree works in home-manager post issue #2942 |
m Category:Nixpkgs added Tags: Mobile edit Mobile web edit |
||
(4 intermediate revisions by 2 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 [[Home | === 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 12: | Line 13: | ||
</nowiki>}} | </nowiki>}} | ||
=== For all packages === | === For all packages === | ||
This method works for both NixOS system level configuration and [[Home | 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 21: | Line 23: | ||
} | } | ||
</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 30: | Line 33: | ||
} | } | ||
</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 43: | Line 47: | ||
$ NIXPKGS_ALLOW_UNFREE=1 nix run nixpkgs#vscode --impure | $ NIXPKGS_ALLOW_UNFREE=1 nix run nixpkgs#vscode --impure | ||
</syntaxhighlight> | </syntaxhighlight> | ||
* [https://nixos.org/nixpkgs/manual/#sec-allow-unfree Nixpkgs manual | == 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:Software]] | ||
[[Category:Nixpkgs]] |