Document about packageOverrides
This commit is contained in:
parent
6bfc1f7380
commit
8a78dcc00f
@ -4,6 +4,8 @@
|
|||||||
|
|
||||||
<title><filename>~/.nixpkgs/config.nix</filename>: global configuration</title>
|
<title><filename>~/.nixpkgs/config.nix</filename>: global configuration</title>
|
||||||
|
|
||||||
|
<section><title>Allow unfree software</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Nix packages can be configured to allow or deny certain options.
|
Nix packages can be configured to allow or deny certain options.
|
||||||
</para>
|
</para>
|
||||||
@ -66,5 +68,37 @@
|
|||||||
A complete list of licenses can be found in the file
|
A complete list of licenses can be found in the file
|
||||||
<filename>lib/licenses.nix</filename> of the nix package tree.
|
<filename>lib/licenses.nix</filename> of the nix package tree.
|
||||||
</para>
|
</para>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section><title>Overriding existing packages</title>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
<filename>~/.nixpkgs/config.nix</filename> enables the user to
|
||||||
|
override package names without creating a fork of the Nixpkgs.
|
||||||
|
This is accomplished by defining a function called
|
||||||
|
<varname>packageOverrides</varname>. It takes the set of
|
||||||
|
packages, usually called <varname>pkgs</varname>, and returns a
|
||||||
|
modified set of packages.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
Here is an example. Say we want to install
|
||||||
|
<varname>xbmc</varname> but we want to use another Python
|
||||||
|
version when running <varname>xbmc</varname>.
|
||||||
|
|
||||||
|
<programlisting>
|
||||||
|
packageOverrides = pkgs: rec {
|
||||||
|
xbmc = pkgs.xbmc.override {
|
||||||
|
python = pkgs.python26;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
</programlisting>
|
||||||
|
|
||||||
|
Further information is available at the <command
|
||||||
|
xlink:href="https://nixos.org/wiki/Nix_Modifying_Packages">Nix
|
||||||
|
wiki</command>
|
||||||
|
|
||||||
|
</para>
|
||||||
|
|
||||||
|
</section>
|
||||||
|
|
||||||
</chapter>
|
</chapter>
|
Loading…
x
Reference in New Issue
Block a user