Manual: Fix indent of config section
This commit is contained in:
parent
e115e3fd76
commit
6bd0519918
@ -4,85 +4,106 @@
|
|||||||
|
|
||||||
<title><filename>~/.nixpkgs/config.nix</filename>: global configuration</title>
|
<title><filename>~/.nixpkgs/config.nix</filename>: global configuration</title>
|
||||||
|
|
||||||
<para>
|
<para>Nix packages can be configured to allow or deny certain options.</para>
|
||||||
Nix packages can be configured to allow or deny certain options.
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<para>
|
<para>To apply the configuration edit
|
||||||
To apply the configuration edit <filename>~/.nixpkgs/config.nix</filename>
|
<filename>~/.nixpkgs/config.nix</filename> and set it like
|
||||||
and set it like
|
|
||||||
<programlisting>{
|
<programlisting>
|
||||||
|
{
|
||||||
allowUnfree = true;
|
allowUnfree = true;
|
||||||
}</programlisting>
|
}
|
||||||
and will allow the Nix package manager to install unfree licensed packages.
|
</programlisting>
|
||||||
|
|
||||||
The configuration as listed also applies to NixOS under <option>nixpkgs.config</option> set.
|
and will allow the Nix package manager to install unfree licensed packages.</para>
|
||||||
</para>
|
|
||||||
|
<para>The configuration as listed also applies to NixOS under
|
||||||
|
<option>nixpkgs.config</option> set.</para>
|
||||||
|
|
||||||
<itemizedlist>
|
<itemizedlist>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>Allow installing of packages that are distributed under
|
||||||
Allow installing of packages that are distributed under unfree license by setting
|
unfree license by setting <programlisting>allowUnfree =
|
||||||
<programlisting>allowUnfree = true;</programlisting>
|
true;</programlisting> or deny them by setting it to
|
||||||
or deny them by setting it to <literal>false</literal>.
|
<literal>false</literal>.</para>
|
||||||
</para>
|
|
||||||
<para>
|
<para>Same can be achieved by setting the environment variable:
|
||||||
Same can be achieved by setting the environment variable:
|
|
||||||
<programlisting>$ export NIXPKGS_ALLOW_UNFREE=1</programlisting>
|
<programlisting>
|
||||||
|
$ export NIXPKGS_ALLOW_UNFREE=1
|
||||||
|
</programlisting>
|
||||||
|
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>Whenever unfree packages are not allowed, single packages
|
||||||
Whenever unfree packages are not allowed, single packages can
|
can still be allowed by a predicate function that accepts package
|
||||||
still be allowed by a predicate function that accepts package
|
|
||||||
as an argument and should return a boolean:
|
as an argument and should return a boolean:
|
||||||
<programlisting>allowUnfreePredicate = (pkg: ...);</programlisting>
|
|
||||||
|
<programlisting>
|
||||||
|
allowUnfreePredicate = (pkg: ...);
|
||||||
|
</programlisting>
|
||||||
|
|
||||||
Example to allow flash player only:
|
Example to allow flash player only:
|
||||||
<programlisting>allowUnfreePredicate = (pkg: pkgs.lib.hasPrefix "flashplayer-" pkg.name);</programlisting>
|
|
||||||
|
<programlisting>
|
||||||
|
allowUnfreePredicate = (pkg: pkgs.lib.hasPrefix "flashplayer-" pkg.name);
|
||||||
|
</programlisting>
|
||||||
|
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>Whenever unfree packages are not allowed, packages can still
|
||||||
Whenever unfree packages are not allowed, packages can still be
|
be whitelisted by their license:
|
||||||
whitelisted by their license:
|
|
||||||
<programlisting>whitelistedLicenses = with stdenv.lib.licenses; [ amd wtfpl ];</programlisting>
|
<programlisting>
|
||||||
|
whitelistedLicenses = with stdenv.lib.licenses; [ amd wtfpl ];
|
||||||
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>In addition to whitelisting licenses which are denied by the
|
||||||
In addition to whitelisting licenses which are denied by the
|
|
||||||
<literal>allowUnfree</literal> setting, you can also explicitely
|
<literal>allowUnfree</literal> setting, you can also explicitely
|
||||||
deny installation of packages which have a certain license:
|
deny installation of packages which have a certain license:
|
||||||
<programlisting>blacklistedLicenses = with stdenv.lib.licenses; [ agpl3 gpl3 ];</programlisting>
|
|
||||||
|
<programlisting>
|
||||||
|
blacklistedLicenses = with stdenv.lib.licenses; [ agpl3 gpl3 ];
|
||||||
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
</itemizedlist>
|
</itemizedlist>
|
||||||
|
|
||||||
<para>
|
<para>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.</para>
|
||||||
<filename>lib/licenses.nix</filename> of the nix package tree.
|
|
||||||
</para>
|
|
||||||
|
<!--============================================================-->
|
||||||
|
|
||||||
<section xml:id="sec-modify-via-packageOverrides"><title>Modify
|
<section xml:id="sec-modify-via-packageOverrides"><title>Modify
|
||||||
packages via <literal>packageOverrides</literal></title>
|
packages via <literal>packageOverrides</literal></title>
|
||||||
|
|
||||||
<para>
|
<para>You can define a function called
|
||||||
|
<varname>packageOverrides</varname> in your local
|
||||||
|
<filename>~/.nixpkgs/config</filename> to overide nix packages. It
|
||||||
|
must be a function that takes pkgs as an argument and return modified
|
||||||
|
set of packages.
|
||||||
|
|
||||||
You can define a function called <varname>packageOverrides</varname>
|
<programlisting>
|
||||||
in your local <filename>~/.nixpkgs/config</filename> to overide nix
|
{
|
||||||
packages. It must be a function that takes pkgs as an argument and
|
|
||||||
return modified set of packages.
|
|
||||||
|
|
||||||
<programlisting>{
|
|
||||||
packageOverrides = pkgs: rec {
|
packageOverrides = pkgs: rec {
|
||||||
foo = pkgs.foo.override { ... };
|
foo = pkgs.foo.override { ... };
|
||||||
};
|
};
|
||||||
}</programlisting>
|
}
|
||||||
|
</programlisting>
|
||||||
|
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|
||||||
</chapter>
|
</chapter>
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
<chapter xmlns="http://docbook.org/ns/docbook"
|
<chapter xmlns="http://docbook.org/ns/docbook"
|
||||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||||
xml:id="chap-language-support">
|
xml:id="chap-language-support">
|
||||||
|
Loading…
Reference in New Issue
Block a user