@@ -2,21 +2,18 @@
22 xmlns:xlink="http://www.w3.org/1999/xlink"
33 xml:id="chap-packageconfig">
44
5−<title>nixpkgs global configuration</title>
5+<title><filename>~/.nixpkgs/config.nix</filename>: global configuration</title>
66
77 <para>
8− Nix packages can be configured to allow or deny certain
9− options.
8+ Nix packages can be configured to allow or deny certain options.
109 </para>
1110
1211 <para>
1312 To apply the configuration edit <filename>~/.nixpkgs/config.nix</filename>
1413 and set it like
15− <programlisting>
16− {
17− allowUnfree = true;
18− }
19− </programlisting>
14+<programlisting>{
15+ allowUnfree = true;
16+}</programlisting>
2017 and will allow the Nix package manager to install unfree licensed packages.
2118
2219 The configuration as listed also applies to NixOS under <option>nixpkgs.config</option> set.
@@ -26,16 +23,12 @@
2623 <listitem>
2724 <para>
2825 Allow installing of packages that are distributed under unfree license by setting
29− <programlisting>
30− allowUnfree = true;
31− </programlisting>
26+ <programlisting>allowUnfree = true;</programlisting>
3227 or deny them by setting it to <literal>false</literal>.
3328 </para>
3429 <para>
3530 Same can be achieved by setting the environment variable:
36− <programlisting>
37− export NIXPKGS_ALLOW_UNFREE=1
38− </programlisting>
31+ <programlisting>$ export NIXPKGS_ALLOW_UNFREE=1</programlisting>
3932 </para>
4033 </listitem>
4134
@@ -44,14 +37,10 @@
4437 Whenever unfree packages are not allowed, single packages can
4538 still be allowed by a predicate function that accepts package
4639 as an argument and should return a boolean:
47− <programlisting>
48− allowUnfreePredicate = (pkg: ...);
49− </programlisting>
40+ <programlisting>allowUnfreePredicate = (pkg: ...);</programlisting>
5041
5142 Example to allow flash player only:
52− <programlisting>
53− allowUnfreePredicate = (pkg: pkgs.lib.hasPrefix "flashplayer-" pkg.name);
54− </programlisting>
43+ <programlisting>allowUnfreePredicate = (pkg: pkgs.lib.hasPrefix "flashplayer-" pkg.name);</programlisting>
5544 </para>
5645 </listitem>
5746
@@ -59,9 +48,7 @@
5948 <para>
6049 Whenever unfree packages are not allowed, packages can still be
6150 whitelisted by their license:
62− <programlisting>
63− whitelistedLicenses = with stdenv.lib.licenses; [ amd wtfpl ];
64− </programlisting>
51+ <programlisting>whitelistedLicenses = with stdenv.lib.licenses; [ amd wtfpl ];</programlisting>
6552 </para>
6653 </listitem>
6754
@@ -70,9 +57,7 @@
7057 In addition to whitelisting licenses which are denied by the
7158 <literal>allowUnfree</literal> setting, you can also explicitely
7259 deny installation of packages which have a certain license:
73− <programlisting>
74− blacklistedLicenses = with stdenv.lib.licenses; [ agpl3 gpl3 ];
75− </programlisting>
60+ <programlisting>blacklistedLicenses = with stdenv.lib.licenses; [ agpl3 gpl3 ];</programlisting>
7661 </para>
7762 </listitem>
7863 </itemizedlist>
@@ -82,4 +67,4 @@
8267 <filename>lib/licenses.nix</filename> of the nix package tree.
8368 </para>
8469
85−</chapter>
70+</chapter>