doc: fix programlistin formatting

This commit is contained in:
Domen Kožar 2015-02-15 18:29:52 +01:00
parent ef8aaa5571
commit 934f97281f

View File

@ -2,21 +2,18 @@
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xlink="http://www.w3.org/1999/xlink"
xml:id="chap-packageconfig"> xml:id="chap-packageconfig">
<title>nixpkgs global configuration</title> <title><filename>~/.nixpkgs/config.nix</filename>: global configuration</title>
<para> <para>
Nix packages can be configured to allow or deny certain Nix packages can be configured to allow or deny certain options.
options.
</para> </para>
<para> <para>
To apply the configuration edit <filename>~/.nixpkgs/config.nix</filename> To apply the configuration edit <filename>~/.nixpkgs/config.nix</filename>
and set it like and set it like
<programlisting> <programlisting>{
{
allowUnfree = true; allowUnfree = true;
} }</programlisting>
</programlisting>
and will allow the Nix package manager to install unfree licensed packages. and will allow the Nix package manager to install unfree licensed packages.
The configuration as listed also applies to NixOS under <option>nixpkgs.config</option> set. The configuration as listed also applies to NixOS under <option>nixpkgs.config</option> set.
@ -26,16 +23,12 @@
<listitem> <listitem>
<para> <para>
Allow installing of packages that are distributed under unfree license by setting Allow installing of packages that are distributed under unfree license by setting
<programlisting> <programlisting>allowUnfree = true;</programlisting>
allowUnfree = true;
</programlisting>
or deny them by setting it to <literal>false</literal>. or deny them by setting it to <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> <programlisting>$ export NIXPKGS_ALLOW_UNFREE=1</programlisting>
export NIXPKGS_ALLOW_UNFREE=1
</programlisting>
</para> </para>
</listitem> </listitem>
@ -44,14 +37,10 @@
Whenever unfree packages are not allowed, single packages can Whenever unfree packages are not allowed, single packages 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> <programlisting>allowUnfreePredicate = (pkg: ...);</programlisting>
allowUnfreePredicate = (pkg: ...);
</programlisting>
Example to allow flash player only: Example to allow flash player only:
<programlisting> <programlisting>allowUnfreePredicate = (pkg: pkgs.lib.hasPrefix "flashplayer-" pkg.name);</programlisting>
allowUnfreePredicate = (pkg: pkgs.lib.hasPrefix "flashplayer-" pkg.name);
</programlisting>
</para> </para>
</listitem> </listitem>
@ -59,9 +48,7 @@
<para> <para>
Whenever unfree packages are not allowed, packages can still be Whenever unfree packages are not allowed, packages can still be
whitelisted by their license: whitelisted by their license:
<programlisting> <programlisting>whitelistedLicenses = with stdenv.lib.licenses; [ amd wtfpl ];</programlisting>
whitelistedLicenses = with stdenv.lib.licenses; [ amd wtfpl ];
</programlisting>
</para> </para>
</listitem> </listitem>
@ -70,9 +57,7 @@
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> <programlisting>blacklistedLicenses = with stdenv.lib.licenses; [ agpl3 gpl3 ];</programlisting>
blacklistedLicenses = with stdenv.lib.licenses; [ agpl3 gpl3 ];
</programlisting>
</para> </para>
</listitem> </listitem>
</itemizedlist> </itemizedlist>