git.iko.soy/typeable/nixpkgs
on master help sign in
doc: Disable wrapping source (#68181)

doc: Disable wrapping source

commitc28659e2fbe37841bf2528a79759d13bf6ce87ef authorJan Tojnar <jtojnar@gmail.com> dateWed 18 Sep 2019, 22:33 (7 years ago) parentcde50a4ea6e877
170 files changed+2999−10013
doc/coding-conventions.xml+70−236 doc/configuration.xml+44−140 doc/contributing.xml+5−10 doc/cross-compilation.xml+53−337 doc/functions.xml+1−2 doc/functions/appimagetools.xml+8−24 doc/functions/debug.xml+2−9 doc/functions/dockertools.xml+54−170 doc/functions/fetchers.xml+16−62 doc/functions/fhs-environments.xml+9−29 doc/functions/generators.xml+5−20 doc/functions/library.xml+1−2 doc/functions/library/asserts.xml+4−9 doc/functions/library/attrsets.xml+42−103 doc/functions/nix-gitignore.xml+5−19 doc/functions/ocitools.xml+6−20 doc/functions/overrides.xml+17−78 doc/functions/prefer-remote-fetch.xml+2−6 doc/functions/shell.xml+1−3 doc/functions/snaptools.xml+8−23 doc/functions/trivial-builders.xml+6−40 doc/languages-frameworks/beam.xml+36−127 doc/languages-frameworks/bower.xml+19−52 doc/languages-frameworks/coq.xml+4−16 doc/languages-frameworks/gnome.xml+30−155 doc/languages-frameworks/go.xml+19−54 doc/languages-frameworks/index.xml+1−6 doc/languages-frameworks/java.xml+9−31 doc/languages-frameworks/lua.xml+4−16 doc/languages-frameworks/ocaml.xml+4−28 doc/languages-frameworks/perl.xml+18−80 doc/languages-frameworks/qt.xml+13−47 doc/languages-frameworks/ruby.xml+5−32 doc/languages-frameworks/texlive.xml+8−19 doc/meta.xml+36−128 doc/multiple-output.xml+30−128 doc/overlays.xml+19−74 doc/package-notes.xml+47−215 doc/package-specific-user-notes.xml+28−147 doc/platform-notes.xml+6−28 doc/quick-start.xml+36−108 doc/release-notes.xml+55−205 doc/reviewing-contributions.xml+42−118 doc/stdenv.xml+238−1061 doc/submitting-changes.xml+39−132 nixos/doc/manual/administration/boot-problems.xml+6−26 nixos/doc/manual/administration/cleaning-store.xml+8−24 nixos/doc/manual/administration/container-networking.xml+5−21 nixos/doc/manual/administration/containers.xml+3−16 nixos/doc/manual/administration/control-groups.xml+6−27 nixos/doc/manual/administration/declarative-containers.xml+6−25 nixos/doc/manual/administration/imperative-containers.xml+12−45 nixos/doc/manual/administration/logging.xml+4−15 nixos/doc/manual/administration/maintenance-mode.xml+1−3 nixos/doc/manual/administration/network-problems.xml+2−11 nixos/doc/manual/administration/rebooting.xml+3−8 nixos/doc/manual/administration/rollback.xml+3−12 nixos/doc/manual/administration/running.xml+1−2 nixos/doc/manual/administration/service-mgmt.xml+5−21 nixos/doc/manual/administration/store-corruption.xml+4−13 nixos/doc/manual/administration/troubleshooting.xml+1−2 nixos/doc/manual/administration/user-sessions.xml+3−12 nixos/doc/manual/configuration/abstractions.xml+12−36 nixos/doc/manual/configuration/ad-hoc-network-config.xml+1−4 nixos/doc/manual/configuration/ad-hoc-packages.xml+5−21 nixos/doc/manual/configuration/adding-custom-packages.xml+6−17 nixos/doc/manual/configuration/config-file.xml+14−57 nixos/doc/manual/configuration/config-syntax.xml+2−12 nixos/doc/manual/configuration/configuration.xml+1−5 nixos/doc/manual/configuration/customizing-packages.xml+8−46 nixos/doc/manual/configuration/declarative-packages.xml+6−17 nixos/doc/manual/configuration/file-systems.xml+4−24 nixos/doc/manual/configuration/firewall.xml+4−11 nixos/doc/manual/configuration/ipv4-config.xml+4−11 nixos/doc/manual/configuration/ipv6-config.xml+4−9 nixos/doc/manual/configuration/kubernetes.xml+12−62 nixos/doc/manual/configuration/linux-kernel.xml+15−44 nixos/doc/manual/configuration/luks-file-systems.xml+3−9 nixos/doc/manual/configuration/matrix.xml+8−65 nixos/doc/manual/configuration/modularity.xml+13−50 nixos/doc/manual/configuration/network-manager.xml+5−17 nixos/doc/manual/configuration/networking.xml+1−2 nixos/doc/manual/configuration/package-mgmt.xml+3−10 nixos/doc/manual/configuration/profiles.xml+3−10 nixos/doc/manual/configuration/profiles/all-hardware.xml+2−8 nixos/doc/manual/configuration/profiles/base.xml+1−5 nixos/doc/manual/configuration/profiles/clone-config.xml+2−8 nixos/doc/manual/configuration/profiles/demo.xml+1−5 nixos/doc/manual/configuration/profiles/docker-container.xml+1−6 nixos/doc/manual/configuration/profiles/graphical.xml+2−9 nixos/doc/manual/configuration/profiles/hardened.xml+3−11 nixos/doc/manual/configuration/profiles/headless.xml+1−5 nixos/doc/manual/configuration/profiles/installation-device.xml+6−19 nixos/doc/manual/configuration/profiles/minimal.xml+1−7 nixos/doc/manual/configuration/profiles/qemu-guest.xml+2−5 nixos/doc/manual/configuration/ssh.xml+2−5 nixos/doc/manual/configuration/summary.xml+2−6 nixos/doc/manual/configuration/user-mgmt.xml+10−43 nixos/doc/manual/configuration/wireless.xml+5−13 nixos/doc/manual/configuration/x-windows.xml+40−111 nixos/doc/manual/configuration/xfce.xml+5−16 nixos/doc/manual/development/assertions.xml+3−15 nixos/doc/manual/development/building-nixos.xml+3−8 nixos/doc/manual/development/building-parts.xml+8−23 nixos/doc/manual/development/importing-modules.xml+2−5 nixos/doc/manual/development/meta-attributes.xml+5−14 nixos/doc/manual/development/nixos-tests.xml+2−7 nixos/doc/manual/development/option-declarations.xml+19−61 nixos/doc/manual/development/option-def.xml+8−26 nixos/doc/manual/development/option-types.xml+47−161 nixos/doc/manual/development/releases.xml+54−72 nixos/doc/manual/development/replace-modules.xml+4−18 nixos/doc/manual/development/running-nixos-tests-interactively.xml+4−10 nixos/doc/manual/development/running-nixos-tests.xml+3−10 nixos/doc/manual/development/sources.xml+9−39 nixos/doc/manual/development/testing-installer.xml+2−4 nixos/doc/manual/development/writing-documentation.xml+18−56 nixos/doc/manual/development/writing-modules.xml+13−56 nixos/doc/manual/development/writing-nixos-tests.xml+29−84 nixos/doc/manual/installation/changing-config.xml+13−40 nixos/doc/manual/installation/installation.xml+1−2 nixos/doc/manual/installation/installing-behind-a-proxy.xml+4−11 nixos/doc/manual/installation/installing-from-other-distro.xml+40−112 nixos/doc/manual/installation/installing-pxe.xml+5−20 nixos/doc/manual/installation/installing-usb.xml+3−12 nixos/doc/manual/installation/installing-virtualbox-guest.xml+7−22 nixos/doc/manual/installation/installing.xml+53−177 nixos/doc/manual/installation/obtaining.xml+9−29 nixos/doc/manual/installation/upgrading.xml+17−65 nixos/doc/manual/man-configuration.xml+1−4 nixos/doc/manual/man-nixos-build-vms.xml+12−29 nixos/doc/manual/man-nixos-enter.xml+7−15 nixos/doc/manual/man-nixos-generate-config.xml+15−49 nixos/doc/manual/man-nixos-install.xml+28−67 nixos/doc/manual/man-nixos-option.xml+10−17 nixos/doc/manual/man-nixos-rebuild.xml+90−219 nixos/doc/manual/man-nixos-version.xml+6−17 nixos/doc/manual/manual.xml+6−15 nixos/doc/manual/release-notes/release-notes.xml+1−2 nixos/doc/manual/release-notes/rl-1404.xml+17−66 nixos/doc/manual/release-notes/rl-1412.xml+19−62 nixos/doc/manual/release-notes/rl-1509.xml+45−163 nixos/doc/manual/release-notes/rl-1603.xml+41−164 nixos/doc/manual/release-notes/rl-1609.xml+35−126 nixos/doc/manual/release-notes/rl-1703.xml+45−148 nixos/doc/manual/release-notes/rl-1709.xml+65−227 nixos/doc/manual/release-notes/rl-1803.xml+56−210 nixos/doc/manual/release-notes/rl-1809.xml+69−242 nixos/doc/manual/release-notes/rl-1903.xml+82−366 nixos/doc/manual/release-notes/rl-1909.xml+325−406 nixos/doc/manual/release-notes/rl-2003.xml+2−5 nixos/doc/xmlformat.conf−1 nixos/modules/i18n/input-method/default.xml+20−54 nixos/modules/programs/digitalbitbox/doc.xml+9−24 nixos/modules/programs/plotinus.xml+4−9 nixos/modules/programs/zsh/oh-my-zsh.xml+13−49 nixos/modules/security/acme.xml+7−23 nixos/modules/security/hidepid.xml+3−8 nixos/modules/services/databases/foundationdb.xml+39−158 nixos/modules/services/databases/postgresql.xml+13−26 nixos/modules/services/desktops/flatpak.xml+7−18 nixos/modules/services/editors/emacs.xml+51−170 nixos/modules/services/hardware/trezord.xml+2−8 nixos/modules/services/misc/gitlab.xml+8−26 nixos/modules/services/misc/taskserver/doc.xml+18−56 nixos/modules/services/misc/weechat.xml+5−16 nixos/modules/services/monitoring/prometheus/exporters.xml+12−39 nixos/modules/services/networking/dnscrypt-proxy.xml+3−11 nixos/modules/services/web-apps/matomo-doc.xml+11−45 nixos/modules/services/web-apps/nextcloud.xml+14−41
doc/coding-conventions.xml+70−236
@@ -8,24 +8,17 @@
88 <itemizedlist>
99 <listitem>
1010 <para>
11− Use 2 spaces of indentation per indentation level in Nix expressions, 4
12− spaces in shell scripts.
11+ Use 2 spaces of indentation per indentation level in Nix expressions, 4 spaces in shell scripts.
1312 </para>
1413 </listitem>
1514 <listitem>
1615 <para>
17− Do not use tab characters, i.e. configure your editor to use soft tabs.
18− For instance, use <literal>(setq-default indent-tabs-mode nil)</literal>
19− in Emacs. Everybody has different tab settings so it’s asking for
20− trouble.
16+ Do not use tab characters, i.e. configure your editor to use soft tabs. For instance, use <literal>(setq-default indent-tabs-mode nil)</literal> in Emacs. Everybody has different tab settings so it’s asking for trouble.
2117 </para>
2218 </listitem>
2319 <listitem>
2420 <para>
25− Use <literal>lowerCamelCase</literal> for variable names, not
26− <literal>UpperCamelCase</literal>. Note, this rule does not apply to
27− package attribute names, which instead follow the rules in
28− <xref linkend="sec-package-naming"/>.
21+ Use <literal>lowerCamelCase</literal> for variable names, not <literal>UpperCamelCase</literal>. Note, this rule does not apply to package attribute names, which instead follow the rules in <xref linkend="sec-package-naming"/>.
2922 </para>
3023 </listitem>
3124 <listitem>
@@ -52,8 +45,7 @@ foo { arg = ...; }
5245 </listitem>
5346 <listitem>
5447 <para>
55− In attribute sets or lists that span multiple lines, the attribute names
56− or list elements should be aligned:
48+ In attribute sets or lists that span multiple lines, the attribute names or list elements should be aligned:
5749<programlisting>
5850# A long list.
5951list = [
@@ -97,8 +89,7 @@ attrs = { x = 1280; y = 1024; };
9789 </listitem>
9890 <listitem>
9991 <para>
100− Breaking in the middle of a function argument can give hard-to-read code,
101− like
92+ Breaking in the middle of a function argument can give hard-to-read code, like
10293<programlisting>
10394someFunction { x = 1280;
10495 y = 1024; } otherArg
@@ -123,8 +114,7 @@ in someFunction res otherArg yetAnotherArg
123114 </listitem>
124115 <listitem>
125116 <para>
126− The bodies of functions, asserts, and withs are not indented to prevent a
127− lot of superfluous indentation levels, i.e.
117+ The bodies of functions, asserts, and withs are not indented to prevent a lot of superfluous indentation levels, i.e.
128118<programlisting>
129119{ arg1, arg2 }:
130120assert system == "i686-linux";
@@ -156,8 +146,7 @@ stdenv.mkDerivation { ...
156146 </listitem>
157147 <listitem>
158148 <para>
159− Functions should list their expected arguments as precisely as possible.
160− That is, write
149+ Functions should list their expected arguments as precisely as possible. That is, write
161150<programlisting>
162151{ stdenv, fetchurl, perl }: <replaceable>...</replaceable>
163152</programlisting>
@@ -171,9 +160,7 @@ args: with args; <replaceable>...</replaceable>
171160</programlisting>
172161 </para>
173162 <para>
174− For functions that are truly generic in the number of arguments (such as
175− wrappers around <varname>mkDerivation</varname>) that have some required
176− arguments, you should write them using an <literal>@</literal>-pattern:
163+ For functions that are truly generic in the number of arguments (such as wrappers around <varname>mkDerivation</varname>) that have some required arguments, you should write them using an <literal>@</literal>-pattern:
177164<programlisting>
178165{ stdenv, doCoverageAnalysis ? false, ... } @ args:
179166
@@ -197,35 +184,20 @@ args.stdenv.mkDerivation (args // {
197184 <title>Package naming</title>
198185
199186 <para>
200− The key words <emphasis>must</emphasis>, <emphasis>must not</emphasis>,
201− <emphasis>required</emphasis>, <emphasis>shall</emphasis>, <emphasis>shall
202− not</emphasis>, <emphasis>should</emphasis>, <emphasis>should
203− not</emphasis>, <emphasis>recommended</emphasis>, <emphasis>may</emphasis>,
204− and <emphasis>optional</emphasis> in this section are to be interpreted as
205− described in <link xlink:href="https://tools.ietf.org/html/rfc2119">RFC
206− 2119</link>. Only <emphasis>emphasized</emphasis> words are to be
207− interpreted in this way.
187+ The key words <emphasis>must</emphasis>, <emphasis>must not</emphasis>, <emphasis>required</emphasis>, <emphasis>shall</emphasis>, <emphasis>shall not</emphasis>, <emphasis>should</emphasis>, <emphasis>should not</emphasis>, <emphasis>recommended</emphasis>, <emphasis>may</emphasis>, and <emphasis>optional</emphasis> in this section are to be interpreted as described in <link xlink:href="https://tools.ietf.org/html/rfc2119">RFC 2119</link>. Only <emphasis>emphasized</emphasis> words are to be interpreted in this way.
208188 </para>
209189
210190 <para>
211− In Nixpkgs, there are generally three different names associated with a
212− package:
191+ In Nixpkgs, there are generally three different names associated with a package:
213192 <itemizedlist>
214193 <listitem>
215194 <para>
216− The <varname>name</varname> attribute of the derivation (excluding the
217− version part). This is what most users see, in particular when using
218− <command>nix-env</command>.
195+ The <varname>name</varname> attribute of the derivation (excluding the version part). This is what most users see, in particular when using <command>nix-env</command>.
219196 </para>
220197 </listitem>
221198 <listitem>
222199 <para>
223− The variable name used for the instantiated package in
224− <filename>all-packages.nix</filename>, and when passing it as a
225− dependency to other functions. Typically this is called the
226− <emphasis>package attribute name</emphasis>. This is what Nix expression
227− authors see. It can also be used when installing using <command>nix-env
228− -iA</command>.
200+ The variable name used for the instantiated package in <filename>all-packages.nix</filename>, and when passing it as a dependency to other functions. Typically this is called the <emphasis>package attribute name</emphasis>. This is what Nix expression authors see. It can also be used when installing using <command>nix-env -iA</command>.
229201 </para>
230202 </listitem>
231203 <listitem>
@@ -234,12 +206,7 @@ args.stdenv.mkDerivation (args // {
234206 </para>
235207 </listitem>
236208 </itemizedlist>
237− Most of the time, these are the same. For instance, the package
238− <literal>e2fsprogs</literal> has a <varname>name</varname> attribute
239− <literal>"e2fsprogs-<replaceable>version</replaceable>"</literal>, is bound
240− to the variable name <varname>e2fsprogs</varname> in
241− <filename>all-packages.nix</filename>, and the Nix expression is in
242− <filename>pkgs/os-specific/linux/e2fsprogs/default.nix</filename>.
209+ Most of the time, these are the same. For instance, the package <literal>e2fsprogs</literal> has a <varname>name</varname> attribute <literal>"e2fsprogs-<replaceable>version</replaceable>"</literal>, is bound to the variable name <varname>e2fsprogs</varname> in <filename>all-packages.nix</filename>, and the Nix expression is in <filename>pkgs/os-specific/linux/e2fsprogs/default.nix</filename>.
243210 </para>
244211
245212 <para>
@@ -247,51 +214,32 @@ args.stdenv.mkDerivation (args // {
247214 <itemizedlist>
248215 <listitem>
249216 <para>
250− The <literal>name</literal> attribute <emphasis>should</emphasis> be
251− identical to the upstream package name.
217+ The <literal>name</literal> attribute <emphasis>should</emphasis> be identical to the upstream package name.
252218 </para>
253219 </listitem>
254220 <listitem>
255221 <para>
256− The <literal>name</literal> attribute <emphasis>must not</emphasis>
257− contain uppercase letters — e.g., <literal>"mplayer-1.0rc2"</literal>
258− instead of <literal>"MPlayer-1.0rc2"</literal>.
222+ The <literal>name</literal> attribute <emphasis>must not</emphasis> contain uppercase letters — e.g., <literal>"mplayer-1.0rc2"</literal> instead of <literal>"MPlayer-1.0rc2"</literal>.
259223 </para>
260224 </listitem>
261225 <listitem>
262226 <para>
263− The version part of the <literal>name</literal> attribute
264− <emphasis>must</emphasis> start with a digit (following a dash) — e.g.,
265− <literal>"hello-0.3.1rc2"</literal>.
227+ The version part of the <literal>name</literal> attribute <emphasis>must</emphasis> start with a digit (following a dash) — e.g., <literal>"hello-0.3.1rc2"</literal>.
266228 </para>
267229 </listitem>
268230 <listitem>
269231 <para>
270− If a package is not a release but a commit from a repository, then the
271− version part of the name <emphasis>must</emphasis> be the date of that
272− (fetched) commit. The date <emphasis>must</emphasis> be in
273− <literal>"YYYY-MM-DD"</literal> format. Also append
274− <literal>"unstable"</literal> to the name - e.g.,
275− <literal>"pkgname-unstable-2014-09-23"</literal>.
232+ If a package is not a release but a commit from a repository, then the version part of the name <emphasis>must</emphasis> be the date of that (fetched) commit. The date <emphasis>must</emphasis> be in <literal>"YYYY-MM-DD"</literal> format. Also append <literal>"unstable"</literal> to the name - e.g., <literal>"pkgname-unstable-2014-09-23"</literal>.
276233 </para>
277234 </listitem>
278235 <listitem>
279236 <para>
280− Dashes in the package name <emphasis>should</emphasis> be preserved in
281− new variable names, rather than converted to underscores or camel cased
282− — e.g., <varname>http-parser</varname> instead of
283− <varname>http_parser</varname> or <varname>httpParser</varname>. The
284− hyphenated style is preferred in all three package names.
237+ Dashes in the package name <emphasis>should</emphasis> be preserved in new variable names, rather than converted to underscores or camel cased — e.g., <varname>http-parser</varname> instead of <varname>http_parser</varname> or <varname>httpParser</varname>. The hyphenated style is preferred in all three package names.
285238 </para>
286239 </listitem>
287240 <listitem>
288241 <para>
289− If there are multiple versions of a package, this
290− <emphasis>should</emphasis> be reflected in the variable names in
291− <filename>all-packages.nix</filename>, e.g. <varname>json-c-0-9</varname>
292− and <varname>json-c-0-11</varname>. If there is an obvious “default”
293− version, make an attribute like <literal>json-c = json-c-0-9;</literal>.
294− See also <xref linkend="sec-versioning" />
242+ If there are multiple versions of a package, this <emphasis>should</emphasis> be reflected in the variable names in <filename>all-packages.nix</filename>, e.g. <varname>json-c-0-9</varname> and <varname>json-c-0-11</varname>. If there is an obvious “default” version, make an attribute like <literal>json-c = json-c-0-9;</literal>. See also <xref linkend="sec-versioning" />
295243 </para>
296244 </listitem>
297245 </itemizedlist>
@@ -301,31 +249,18 @@ args.stdenv.mkDerivation (args // {
301249 <title>File naming and organisation</title>
302250
303251 <para>
304− Names of files and directories should be in lowercase, with dashes between
305− words — not in camel case. For instance, it should be
306− <filename>all-packages.nix</filename>, not
307− <filename>allPackages.nix</filename> or
308− <filename>AllPackages.nix</filename>.
252+ Names of files and directories should be in lowercase, with dashes between words — not in camel case. For instance, it should be <filename>all-packages.nix</filename>, not <filename>allPackages.nix</filename> or <filename>AllPackages.nix</filename>.
309253 </para>
310254
311255 <section xml:id="sec-hierarchy">
312256 <title>Hierarchy</title>
313257
314258 <para>
315− Each package should be stored in its own directory somewhere in the
316− <filename>pkgs/</filename> tree, i.e. in
317− <filename>pkgs/<replaceable>category</replaceable>/<replaceable>subcategory</replaceable>/<replaceable>...</replaceable>/<replaceable>pkgname</replaceable></filename>.
318− Below are some rules for picking the right category for a package. Many
319− packages fall under several categories; what matters is the
320− <emphasis>primary</emphasis> purpose of a package. For example, the
321− <literal>libxml2</literal> package builds both a library and some tools;
322− but it’s a library foremost, so it goes under
323− <filename>pkgs/development/libraries</filename>.
259+ Each package should be stored in its own directory somewhere in the <filename>pkgs/</filename> tree, i.e. in <filename>pkgs/<replaceable>category</replaceable>/<replaceable>subcategory</replaceable>/<replaceable>...</replaceable>/<replaceable>pkgname</replaceable></filename>. Below are some rules for picking the right category for a package. Many packages fall under several categories; what matters is the <emphasis>primary</emphasis> purpose of a package. For example, the <literal>libxml2</literal> package builds both a library and some tools; but it’s a library foremost, so it goes under <filename>pkgs/development/libraries</filename>.
324260 </para>
325261
326262 <para>
327− When in doubt, consider refactoring the <filename>pkgs/</filename> tree,
328− e.g. creating new categories or splitting up an existing category.
263+ When in doubt, consider refactoring the <filename>pkgs/</filename> tree, e.g. creating new categories or splitting up an existing category.
329264 </para>
330265
331266 <variablelist>
@@ -341,8 +276,7 @@ args.stdenv.mkDerivation (args // {
341276 </term>
342277 <listitem>
343278 <para>
344− <filename>development/libraries</filename> (e.g.
345− <filename>libxml2</filename>)
279+ <filename>development/libraries</filename> (e.g. <filename>libxml2</filename>)
346280 </para>
347281 </listitem>
348282 </varlistentry>
@@ -352,8 +286,7 @@ args.stdenv.mkDerivation (args // {
352286 </term>
353287 <listitem>
354288 <para>
355− <filename>development/compilers</filename> (e.g.
356− <filename>gcc</filename>)
289+ <filename>development/compilers</filename> (e.g. <filename>gcc</filename>)
357290 </para>
358291 </listitem>
359292 </varlistentry>
@@ -363,8 +296,7 @@ args.stdenv.mkDerivation (args // {
363296 </term>
364297 <listitem>
365298 <para>
366− <filename>development/interpreters</filename> (e.g.
367− <filename>guile</filename>)
299+ <filename>development/interpreters</filename> (e.g. <filename>guile</filename>)
368300 </para>
369301 </listitem>
370302 </varlistentry>
@@ -380,8 +312,7 @@ args.stdenv.mkDerivation (args // {
380312 </term>
381313 <listitem>
382314 <para>
383− <filename>development/tools/parsing</filename> (e.g.
384− <filename>bison</filename>, <filename>flex</filename>)
315+ <filename>development/tools/parsing</filename> (e.g. <filename>bison</filename>, <filename>flex</filename>)
385316 </para>
386317 </listitem>
387318 </varlistentry>
@@ -391,8 +322,7 @@ args.stdenv.mkDerivation (args // {
391322 </term>
392323 <listitem>
393324 <para>
394− <filename>development/tools/build-managers</filename> (e.g.
395− <filename>gnumake</filename>)
325+ <filename>development/tools/build-managers</filename> (e.g. <filename>gnumake</filename>)
396326 </para>
397327 </listitem>
398328 </varlistentry>
@@ -402,8 +332,7 @@ args.stdenv.mkDerivation (args // {
402332 </term>
403333 <listitem>
404334 <para>
405− <filename>development/tools/misc</filename> (e.g.
406− <filename>binutils</filename>)
335+ <filename>development/tools/misc</filename> (e.g. <filename>binutils</filename>)
407336 </para>
408337 </listitem>
409338 </varlistentry>
@@ -429,8 +358,7 @@ args.stdenv.mkDerivation (args // {
429358 </term>
430359 <listitem>
431360 <para>
432− (A tool is a relatively small program, especially one intended to be
433− used non-interactively.)
361+ (A tool is a relatively small program, especially one intended to be used non-interactively.)
434362 </para>
435363 <variablelist>
436364 <varlistentry>
@@ -439,8 +367,7 @@ args.stdenv.mkDerivation (args // {
439367 </term>
440368 <listitem>
441369 <para>
442− <filename>tools/networking</filename> (e.g.
443− <filename>wget</filename>)
370+ <filename>tools/networking</filename> (e.g. <filename>wget</filename>)
444371 </para>
445372 </listitem>
446373 </varlistentry>
@@ -470,8 +397,7 @@ args.stdenv.mkDerivation (args // {
470397 </term>
471398 <listitem>
472399 <para>
473− <filename>tools/archivers</filename> (e.g. <filename>zip</filename>,
474− <filename>tar</filename>)
400+ <filename>tools/archivers</filename> (e.g. <filename>zip</filename>, <filename>tar</filename>)
475401 </para>
476402 </listitem>
477403 </varlistentry>
@@ -481,8 +407,7 @@ args.stdenv.mkDerivation (args // {
481407 </term>
482408 <listitem>
483409 <para>
484− <filename>tools/compression</filename> (e.g.
485− <filename>gzip</filename>, <filename>bzip2</filename>)
410+ <filename>tools/compression</filename> (e.g. <filename>gzip</filename>, <filename>bzip2</filename>)
486411 </para>
487412 </listitem>
488413 </varlistentry>
@@ -492,8 +417,7 @@ args.stdenv.mkDerivation (args // {
492417 </term>
493418 <listitem>
494419 <para>
495− <filename>tools/security</filename> (e.g. <filename>nmap</filename>,
496− <filename>gnupg</filename>)
420+ <filename>tools/security</filename> (e.g. <filename>nmap</filename>, <filename>gnupg</filename>)
497421 </para>
498422 </listitem>
499423 </varlistentry>
@@ -532,8 +456,7 @@ args.stdenv.mkDerivation (args // {
532456 </term>
533457 <listitem>
534458 <para>
535− <filename>servers/http</filename> (e.g.
536− <filename>apache-httpd</filename>)
459+ <filename>servers/http</filename> (e.g. <filename>apache-httpd</filename>)
537460 </para>
538461 </listitem>
539462 </varlistentry>
@@ -543,8 +466,7 @@ args.stdenv.mkDerivation (args // {
543466 </term>
544467 <listitem>
545468 <para>
546− <filename>servers/x11</filename> (e.g. <filename>xorg</filename> —
547− this includes the client libraries and programs)
469+ <filename>servers/x11</filename> (e.g. <filename>xorg</filename> — this includes the client libraries and programs)
548470 </para>
549471 </listitem>
550472 </varlistentry>
@@ -567,8 +489,7 @@ args.stdenv.mkDerivation (args // {
567489 </term>
568490 <listitem>
569491 <para>
570− <filename>desktops</filename> (e.g. <filename>kde</filename>,
571− <filename>gnome</filename>, <filename>enlightenment</filename>)
492+ <filename>desktops</filename> (e.g. <filename>kde</filename>, <filename>gnome</filename>, <filename>enlightenment</filename>)
572493 </para>
573494 </listitem>
574495 </varlistentry>
@@ -578,8 +499,7 @@ args.stdenv.mkDerivation (args // {
578499 </term>
579500 <listitem>
580501 <para>
581− <filename>applications/window-managers</filename> (e.g.
582− <filename>awesome</filename>, <filename>stumpwm</filename>)
502+ <filename>applications/window-managers</filename> (e.g. <filename>awesome</filename>, <filename>stumpwm</filename>)
583503 </para>
584504 </listitem>
585505 </varlistentry>
@@ -589,8 +509,7 @@ args.stdenv.mkDerivation (args // {
589509 </term>
590510 <listitem>
591511 <para>
592− A (typically large) program with a distinct user interface, primarily
593− used interactively.
512+ A (typically large) program with a distinct user interface, primarily used interactively.
594513 </para>
595514 <variablelist>
596515 <varlistentry>
@@ -599,8 +518,7 @@ args.stdenv.mkDerivation (args // {
599518 </term>
600519 <listitem>
601520 <para>
602− <filename>applications/version-management</filename> (e.g.
603− <filename>subversion</filename>)
521+ <filename>applications/version-management</filename> (e.g. <filename>subversion</filename>)
604522 </para>
605523 </listitem>
606524 </varlistentry>
@@ -610,8 +528,7 @@ args.stdenv.mkDerivation (args // {
610528 </term>
611529 <listitem>
612530 <para>
613− <filename>applications/video</filename> (e.g.
614− <filename>vlc</filename>)
531+ <filename>applications/video</filename> (e.g. <filename>vlc</filename>)
615532 </para>
616533 </listitem>
617534 </varlistentry>
@@ -621,8 +538,7 @@ args.stdenv.mkDerivation (args // {
621538 </term>
622539 <listitem>
623540 <para>
624− <filename>applications/graphics</filename> (e.g.
625− <filename>gimp</filename>)
541+ <filename>applications/graphics</filename> (e.g. <filename>gimp</filename>)
626542 </para>
627543 </listitem>
628544 </varlistentry>
@@ -638,8 +554,7 @@ args.stdenv.mkDerivation (args // {
638554 </term>
639555 <listitem>
640556 <para>
641− <filename>applications/networking/mailreaders</filename> (e.g.
642− <filename>thunderbird</filename>)
557+ <filename>applications/networking/mailreaders</filename> (e.g. <filename>thunderbird</filename>)
643558 </para>
644559 </listitem>
645560 </varlistentry>
@@ -649,8 +564,7 @@ args.stdenv.mkDerivation (args // {
649564 </term>
650565 <listitem>
651566 <para>
652− <filename>applications/networking/newsreaders</filename> (e.g.
653− <filename>pan</filename>)
567+ <filename>applications/networking/newsreaders</filename> (e.g. <filename>pan</filename>)
654568 </para>
655569 </listitem>
656570 </varlistentry>
@@ -660,8 +574,7 @@ args.stdenv.mkDerivation (args // {
660574 </term>
661575 <listitem>
662576 <para>
663− <filename>applications/networking/browsers</filename> (e.g.
664− <filename>firefox</filename>)
577+ <filename>applications/networking/browsers</filename> (e.g. <filename>firefox</filename>)
665578 </para>
666579 </listitem>
667580 </varlistentry>
@@ -719,8 +632,7 @@ args.stdenv.mkDerivation (args // {
719632 </term>
720633 <listitem>
721634 <para>
722− <filename>data/sgml+xml/schemas/xml-dtd</filename> (e.g.
723− <filename>docbook</filename>)
635+ <filename>data/sgml+xml/schemas/xml-dtd</filename> (e.g. <filename>docbook</filename>)
724636 </para>
725637 </listitem>
726638 </varlistentry>
@@ -733,8 +645,7 @@ args.stdenv.mkDerivation (args // {
733645 (Okay, these are executable...)
734646 </para>
735647 <para>
736− <filename>data/sgml+xml/stylesheets/xslt</filename> (e.g.
737− <filename>docbook-xsl</filename>)
648+ <filename>data/sgml+xml/stylesheets/xslt</filename> (e.g. <filename>docbook-xsl</filename>)
738649 </para>
739650 </listitem>
740651 </varlistentry>
@@ -771,36 +682,15 @@ args.stdenv.mkDerivation (args // {
771682 <title>Versioning</title>
772683
773684 <para>
774− Because every version of a package in Nixpkgs creates a potential
775− maintenance burden, old versions of a package should not be kept unless
776− there is a good reason to do so. For instance, Nixpkgs contains several
777− versions of GCC because other packages don’t build with the latest
778− version of GCC. Other examples are having both the latest stable and latest
779− pre-release version of a package, or to keep several major releases of an
780− application that differ significantly in functionality.
685+ Because every version of a package in Nixpkgs creates a potential maintenance burden, old versions of a package should not be kept unless there is a good reason to do so. For instance, Nixpkgs contains several versions of GCC because other packages don’t build with the latest version of GCC. Other examples are having both the latest stable and latest pre-release version of a package, or to keep several major releases of an application that differ significantly in functionality.
781686 </para>
782687
783688 <para>
784− If there is only one version of a package, its Nix expression should be
785− named <filename>e2fsprogs/default.nix</filename>. If there are multiple
786− versions, this should be reflected in the filename, e.g.
787− <filename>e2fsprogs/1.41.8.nix</filename> and
788− <filename>e2fsprogs/1.41.9.nix</filename>. The version in the filename
789− should leave out unnecessary detail. For instance, if we keep the latest
790− Firefox 2.0.x and 3.5.x versions in Nixpkgs, they should be named
791− <filename>firefox/2.0.nix</filename> and
792− <filename>firefox/3.5.nix</filename>, respectively (which, at a given
793− point, might contain versions <literal>2.0.0.20</literal> and
794− <literal>3.5.4</literal>). If a version requires many auxiliary files, you
795− can use a subdirectory for each version, e.g.
796− <filename>firefox/2.0/default.nix</filename> and
797− <filename>firefox/3.5/default.nix</filename>.
689+ If there is only one version of a package, its Nix expression should be named <filename>e2fsprogs/default.nix</filename>. If there are multiple versions, this should be reflected in the filename, e.g. <filename>e2fsprogs/1.41.8.nix</filename> and <filename>e2fsprogs/1.41.9.nix</filename>. The version in the filename should leave out unnecessary detail. For instance, if we keep the latest Firefox 2.0.x and 3.5.x versions in Nixpkgs, they should be named <filename>firefox/2.0.nix</filename> and <filename>firefox/3.5.nix</filename>, respectively (which, at a given point, might contain versions <literal>2.0.0.20</literal> and <literal>3.5.4</literal>). If a version requires many auxiliary files, you can use a subdirectory for each version, e.g. <filename>firefox/2.0/default.nix</filename> and <filename>firefox/3.5/default.nix</filename>.
798690 </para>
799691
800692 <para>
801− All versions of a package <emphasis>must</emphasis> be included in
802− <filename>all-packages.nix</filename> to make sure that they evaluate
803− correctly.
693+ All versions of a package <emphasis>must</emphasis> be included in <filename>all-packages.nix</filename> to make sure that they evaluate correctly.
804694 </para>
805695 </section>
806696 </section>
@@ -808,25 +698,15 @@ args.stdenv.mkDerivation (args // {
808698 <title>Fetching Sources</title>
809699
810700 <para>
811− There are multiple ways to fetch a package source in nixpkgs. The general
812− guideline is that you should package reproducible sources with a high degree
813− of availability. Right now there is only one fetcher which has mirroring
814− support and that is <literal>fetchurl</literal>. Note that you should also
815− prefer protocols which have a corresponding proxy environment variable.
701+ There are multiple ways to fetch a package source in nixpkgs. The general guideline is that you should package reproducible sources with a high degree of availability. Right now there is only one fetcher which has mirroring support and that is <literal>fetchurl</literal>. Note that you should also prefer protocols which have a corresponding proxy environment variable.
816702 </para>
817703
818704 <para>
819− You can find many source fetch helpers in
820− <literal>pkgs/build-support/fetch*</literal>.
705+ You can find many source fetch helpers in <literal>pkgs/build-support/fetch*</literal>.
821706 </para>
822707
823708 <para>
824− In the file <literal>pkgs/top-level/all-packages.nix</literal> you can find
825− fetch helpers, these have names on the form <literal>fetchFrom*</literal>.
826− The intention of these are to provide snapshot fetches but using the same
827− api as some of the version controlled fetchers from
828− <literal>pkgs/build-support/</literal>. As an example going from bad to
829− good:
709+ In the file <literal>pkgs/top-level/all-packages.nix</literal> you can find fetch helpers, these have names on the form <literal>fetchFrom*</literal>. The intention of these are to provide snapshot fetches but using the same api as some of the version controlled fetchers from <literal>pkgs/build-support/</literal>. As an example going from bad to good:
830710 <itemizedlist>
831711 <listitem>
832712 <para>
@@ -863,11 +743,7 @@ src = fetchFromGitHub {
863743 sha256 = "1i2yxndxb6yc9l6c99pypbd92lfq5aac4klq7y2v93c9qvx2cgpc";
864744}
865745</programlisting>
866− Find the value to put as <literal>sha256</literal> by running
867− <literal>nix run -f '&lt;nixpkgs&gt;' nix-prefetch-github -c
868− nix-prefetch-github --rev 1f795f9f44607cc5bec70d1300150bfefcef2aae NixOS
869− nix</literal> or <literal>nix-prefetch-url --unpack
870− https://github.com/NixOS/nix/archive/1f795f9f44607cc5bec70d1300150bfefcef2aae.tar.gz</literal>.
746+ Find the value to put as <literal>sha256</literal> by running <literal>nix run -f '&lt;nixpkgs&gt;' nix-prefetch-github -c nix-prefetch-github --rev 1f795f9f44607cc5bec70d1300150bfefcef2aae NixOS nix</literal> or <literal>nix-prefetch-url --unpack https://github.com/NixOS/nix/archive/1f795f9f44607cc5bec70d1300150bfefcef2aae.tar.gz</literal>.
871747 </para>
872748 </listitem>
873749 </itemizedlist>
@@ -883,40 +759,23 @@ src = fetchFromGitHub {
883759 <orderedlist>
884760 <listitem>
885761 <para>
886− Prefetch URL (with <literal>nix-prefetch-<replaceable>XXX</replaceable>
887− <replaceable>URL</replaceable></literal>, where
888− <replaceable>XXX</replaceable> is one of <literal>url</literal>,
889− <literal>git</literal>, <literal>hg</literal>, <literal>cvs</literal>,
890− <literal>bzr</literal>, <literal>svn</literal>). Hash is printed to
891− stdout.
762+ Prefetch URL (with <literal>nix-prefetch-<replaceable>XXX</replaceable> <replaceable>URL</replaceable></literal>, where <replaceable>XXX</replaceable> is one of <literal>url</literal>, <literal>git</literal>, <literal>hg</literal>, <literal>cvs</literal>, <literal>bzr</literal>, <literal>svn</literal>). Hash is printed to stdout.
892763 </para>
893764 </listitem>
894765 <listitem>
895766 <para>
896− Prefetch by package source (with <literal>nix-prefetch-url
897− '&lt;nixpkgs&gt;' -A <replaceable>PACKAGE</replaceable>.src</literal>,
898− where <replaceable>PACKAGE</replaceable> is package attribute name). Hash
899− is printed to stdout.
767+ Prefetch by package source (with <literal>nix-prefetch-url '&lt;nixpkgs&gt;' -A <replaceable>PACKAGE</replaceable>.src</literal>, where <replaceable>PACKAGE</replaceable> is package attribute name). Hash is printed to stdout.
900768 </para>
901769 <para>
902− This works well when you've upgraded existing package version and want to
903− find out new hash, but is useless if package can't be accessed by
904− attribute or package has multiple sources (<literal>.srcs</literal>,
905− architecture-dependent sources, etc).
770+ This works well when you've upgraded existing package version and want to find out new hash, but is useless if package can't be accessed by attribute or package has multiple sources (<literal>.srcs</literal>, architecture-dependent sources, etc).
906771 </para>
907772 </listitem>
908773 <listitem>
909774 <para>
910− Upstream provided hash: use it when upstream provides
911− <literal>sha256</literal> or <literal>sha512</literal> (when upstream
912− provides <literal>md5</literal>, don't use it, compute
913− <literal>sha256</literal> instead).
775+ Upstream provided hash: use it when upstream provides <literal>sha256</literal> or <literal>sha512</literal> (when upstream provides <literal>md5</literal>, don't use it, compute <literal>sha256</literal> instead).
914776 </para>
915777 <para>
916− A little nuance is that <literal>nix-prefetch-*</literal> tools produce
917− hash encoded with <literal>base32</literal>, but upstream usually provides
918− hexadecimal (<literal>base16</literal>) encoding. Fetchers understand both
919− formats. Nixpkgs does not standardize on any one format.
778+ A little nuance is that <literal>nix-prefetch-*</literal> tools produce hash encoded with <literal>base32</literal>, but upstream usually provides hexadecimal (<literal>base16</literal>) encoding. Fetchers understand both formats. Nixpkgs does not standardize on any one format.
920779 </para>
921780 <para>
922781 You can convert between formats with nix-hash, for example:
@@ -927,28 +786,18 @@ src = fetchFromGitHub {
927786 </listitem>
928787 <listitem>
929788 <para>
930− Extracting hash from local source tarball can be done with
931− <literal>sha256sum</literal>. Use <literal>nix-prefetch-url
932− file:///path/to/tarball </literal> if you want base32 hash.
789+ Extracting hash from local source tarball can be done with <literal>sha256sum</literal>. Use <literal>nix-prefetch-url file:///path/to/tarball </literal> if you want base32 hash.
933790 </para>
934791 </listitem>
935792 <listitem>
936793 <para>
937− Fake hash: set fake hash in package expression, perform build and extract
938− correct hash from error Nix prints.
794+ Fake hash: set fake hash in package expression, perform build and extract correct hash from error Nix prints.
939795 </para>
940796 <para>
941− For package updates it is enough to change one symbol to make hash fake.
942− For new packages, you can use <literal>lib.fakeSha256</literal>,
943− <literal>lib.fakeSha512</literal> or any other fake hash.
797+ For package updates it is enough to change one symbol to make hash fake. For new packages, you can use <literal>lib.fakeSha256</literal>, <literal>lib.fakeSha512</literal> or any other fake hash.
944798 </para>
945799 <para>
946− This is last resort method when reconstructing source URL is non-trivial
947− and <literal>nix-prefetch-url -A</literal> isn't applicable (for example,
948− <link xlink:href="https://github.com/NixOS/nixpkgs/blob/d2ab091dd308b99e4912b805a5eb088dd536adb9/pkgs/applications/video/kodi/default.nix#L73">
949− one of <literal>kodi</literal> dependencies</link>). The easiest way then
950− would be replace hash with a fake one and rebuild. Nix build will fail and
951− error message will contain desired hash.
800+ This is last resort method when reconstructing source URL is non-trivial and <literal>nix-prefetch-url -A</literal> isn't applicable (for example, <link xlink:href="https://github.com/NixOS/nixpkgs/blob/d2ab091dd308b99e4912b805a5eb088dd536adb9/pkgs/applications/video/kodi/default.nix#L73"> one of <literal>kodi</literal> dependencies</link>). The easiest way then would be replace hash with a fake one and rebuild. Nix build will fail and error message will contain desired hash.
952801 </para>
953802 <warning>
954803 <para>
@@ -962,9 +811,7 @@ src = fetchFromGitHub {
962811 <title>Obtaining hashes securely</title>
963812
964813 <para>
965− Let's say Man-in-the-Middle (MITM) sits close to your network. Then instead
966− of fetching source you can fetch malware, and instead of source hash you
967− get hash of malware. Here are security considerations for this scenario:
814+ Let's say Man-in-the-Middle (MITM) sits close to your network. Then instead of fetching source you can fetch malware, and instead of source hash you get hash of malware. Here are security considerations for this scenario:
968815 </para>
969816
970817 <itemizedlist>
@@ -975,8 +822,7 @@ src = fetchFromGitHub {
975822 </listitem>
976823 <listitem>
977824 <para>
978− hashes from upstream (in method 3) should be obtained via secure
979− protocol;
825+ hashes from upstream (in method 3) should be obtained via secure protocol;
980826 </para>
981827 </listitem>
982828 <listitem>
@@ -986,12 +832,7 @@ src = fetchFromGitHub {
986832 </listitem>
987833 <listitem>
988834 <para>
989− <literal>https://</literal> URLs are not secure in method 5. When
990− obtaining hashes with fake hash method, TLS checks are disabled. So
991− refetch source hash from several different networks to exclude MITM
992− scenario. Alternatively, use fake hash method to make Nix error, but
993− instead of extracting hash from error, extract
994− <literal>https://</literal> URL and prefetch it with method 1.
835+ <literal>https://</literal> URLs are not secure in method 5. When obtaining hashes with fake hash method, TLS checks are disabled. So refetch source hash from several different networks to exclude MITM scenario. Alternatively, use fake hash method to make Nix error, but instead of extracting hash from error, extract <literal>https://</literal> URL and prefetch it with method 1.
995836 </para>
996837 </listitem>
997838 </itemizedlist>
@@ -1001,8 +842,7 @@ src = fetchFromGitHub {
1001842 <title>Patches</title>
1002843
1003844 <para>
1004− Patches available online should be retrieved using
1005− <literal>fetchpatch</literal>.
845+ Patches available online should be retrieved using <literal>fetchpatch</literal>.
1006846 </para>
1007847
1008848 <para>
@@ -1018,10 +858,7 @@ patches = [
1018858 </para>
1019859
1020860 <para>
1021− Otherwise, you can add a <literal>.patch</literal> file to the
1022− <literal>nixpkgs</literal> repository. In the interest of keeping our
1023− maintenance burden to a minimum, only patches that are unique to
1024− <literal>nixpkgs</literal> should be added in this way.
861+ Otherwise, you can add a <literal>.patch</literal> file to the <literal>nixpkgs</literal> repository. In the interest of keeping our maintenance burden to a minimum, only patches that are unique to <literal>nixpkgs</literal> should be added in this way.
1025862 </para>
1026863
1027864 <para>
@@ -1031,8 +868,7 @@ patches = [ ./0001-changes.patch ];
1031868 </para>
1032869
1033870 <para>
1034− If you do need to do create this sort of patch file, one way to do so is
1035− with git:
871+ If you do need to do create this sort of patch file, one way to do so is with git:
1036872 <orderedlist>
1037873 <listitem>
1038874 <para>
@@ -1043,8 +879,7 @@ patches = [ ./0001-changes.patch ];
1043879 </listitem>
1044880 <listitem>
1045881 <para>
1046− If a git repository is not already present, create one and stage all of
1047− the source files.
882+ If a git repository is not already present, create one and stage all of the source files.
1048883<screen>
1049884<prompt>$ </prompt>git init
1050885<prompt>$ </prompt>git add .</screen>
@@ -1052,8 +887,7 @@ patches = [ ./0001-changes.patch ];
1052887 </listitem>
1053888 <listitem>
1054889 <para>
1055− Edit some files to make whatever changes need to be included in the
1056− patch.
890+ Edit some files to make whatever changes need to be included in the patch.
1057891 </para>
1058892 </listitem>
1059893 <listitem>
doc/configuration.xml+44−140
@@ -3,49 +3,38 @@
33 xml:id="chap-packageconfig">
44 <title>Global configuration</title>
55 <para>
6− Nix comes with certain defaults about what packages can and cannot be
7− installed, based on a package's metadata. By default, Nix will prevent
8− installation if any of the following criteria are true:
6+ Nix comes with certain defaults about what packages can and cannot be installed, based on a package's metadata. By default, Nix will prevent installation if any of the following criteria are true:
97 </para>
108 <itemizedlist>
119 <listitem>
1210 <para>
13− The package is thought to be broken, and has had its
14− <literal>meta.broken</literal> set to <literal>true</literal>.
11+ The package is thought to be broken, and has had its <literal>meta.broken</literal> set to <literal>true</literal>.
1512 </para>
1613 </listitem>
1714 <listitem>
1815 <para>
19− The package isn't intended to run on the given system, as none of its
20− <literal>meta.platforms</literal> match the given system.
16+ The package isn't intended to run on the given system, as none of its <literal>meta.platforms</literal> match the given system.
2117 </para>
2218 </listitem>
2319 <listitem>
2420 <para>
25− The package's <literal>meta.license</literal> is set to a license which is
26− considered to be unfree.
21+ The package's <literal>meta.license</literal> is set to a license which is considered to be unfree.
2722 </para>
2823 </listitem>
2924 <listitem>
3025 <para>
31− The package has known security vulnerabilities but has not or can not be
32− updated for some reason, and a list of issues has been entered in to the
33− package's <literal>meta.knownVulnerabilities</literal>.
26+ The package has known security vulnerabilities but has not or can not be updated for some reason, and a list of issues has been entered in to the package's <literal>meta.knownVulnerabilities</literal>.
3427 </para>
3528 </listitem>
3629 </itemizedlist>
3730 <para>
38− Note that all this is checked during evaluation already, and the check
39− includes any package that is evaluated. In particular, all build-time
40− dependencies are checked. <literal>nix-env -qa</literal> will (attempt to)
41− hide any packages that would be refused.
31+ Note that all this is checked during evaluation already, and the check includes any package that is evaluated. In particular, all build-time dependencies are checked. <literal>nix-env -qa</literal> will (attempt to) hide any packages that would be refused.
4232 </para>
4333 <para>
4434 Each of these criteria can be altered in the nixpkgs configuration.
4535 </para>
4636 <para>
47− The nixpkgs configuration for a NixOS system is set in the
48− <literal>configuration.nix</literal>, as in the following example:
37+ The nixpkgs configuration for a NixOS system is set in the <literal>configuration.nix</literal>, as in the following example:
4938<programlisting>
5039{
5140 nixpkgs.config = {
@@ -53,13 +42,10 @@
5342 };
5443}
5544</programlisting>
56− However, this does not allow unfree software for individual users. Their
57− configurations are managed separately.
45+ However, this does not allow unfree software for individual users. Their configurations are managed separately.
5846 </para>
5947 <para>
60− A user's of nixpkgs configuration is stored in a user-specific configuration
61− file located at <filename>~/.config/nixpkgs/config.nix</filename>. For
62− example:
48+ A user's of nixpkgs configuration is stored in a user-specific configuration file located at <filename>~/.config/nixpkgs/config.nix</filename>. For example:
6349<programlisting>
6450{
6551 allowUnfree = true;
@@ -67,31 +53,25 @@
6753</programlisting>
6854 </para>
6955 <para>
70− Note that we are not able to test or build unfree software on Hydra due to
71− policy. Most unfree licenses prohibit us from either executing or
72− distributing the software.
56+ Note that we are not able to test or build unfree software on Hydra due to policy. Most unfree licenses prohibit us from either executing or distributing the software.
7357 </para>
7458 <section xml:id="sec-allow-broken">
7559 <title>Installing broken packages</title>
7660
7761 <para>
78− There are two ways to try compiling a package which has been marked as
79− broken.
62+ There are two ways to try compiling a package which has been marked as broken.
8063 </para>
8164
8265 <itemizedlist>
8366 <listitem>
8467 <para>
85− For allowing the build of a broken package once, you can use an
86− environment variable for a single invocation of the nix tools:
68+ For allowing the build of a broken package once, you can use an environment variable for a single invocation of the nix tools:
8769<programlisting>$ export NIXPKGS_ALLOW_BROKEN=1</programlisting>
8870 </para>
8971 </listitem>
9072 <listitem>
9173 <para>
92− For permanently allowing broken packages to be built, you may add
93− <literal>allowBroken = true;</literal> to your user's configuration file,
94− like this:
74+ For permanently allowing broken packages to be built, you may add <literal>allowBroken = true;</literal> to your user's configuration file, like this:
9575<programlisting>
9676{
9777 allowBroken = true;
@@ -105,23 +85,19 @@
10585 <title>Installing packages on unsupported systems</title>
10686
10787 <para>
108− There are also two ways to try compiling a package which has been marked as
109− unsuported for the given system.
88+ There are also two ways to try compiling a package which has been marked as unsuported for the given system.
11089 </para>
11190
11291 <itemizedlist>
11392 <listitem>
11493 <para>
115− For allowing the build of a broken package once, you can use an
116− environment variable for a single invocation of the nix tools:
94+ For allowing the build of a broken package once, you can use an environment variable for a single invocation of the nix tools:
11795<programlisting>$ export NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1</programlisting>
11896 </para>
11997 </listitem>
12098 <listitem>
12199 <para>
122− For permanently allowing broken packages to be built, you may add
123− <literal>allowUnsupportedSystem = true;</literal> to your user's
124− configuration file, like this:
100+ For permanently allowing broken packages to be built, you may add <literal>allowUnsupportedSystem = true;</literal> to your user's configuration file, like this:
125101<programlisting>
126102{
127103 allowUnsupportedSystem = true;
@@ -132,42 +108,29 @@
132108 </itemizedlist>
133109
134110 <para>
135− The difference between a package being unsupported on some system and being
136− broken is admittedly a bit fuzzy. If a program <emphasis>ought</emphasis> to
137− work on a certain platform, but doesn't, the platform should be included in
138− <literal>meta.platforms</literal>, but marked as broken with e.g.
139− <literal>meta.broken = !hostPlatform.isWindows</literal>. Of course, this
140− begs the question of what "ought" means exactly. That is left to the package
141− maintainer.
111+ The difference between a package being unsupported on some system and being broken is admittedly a bit fuzzy. If a program <emphasis>ought</emphasis> to work on a certain platform, but doesn't, the platform should be included in <literal>meta.platforms</literal>, but marked as broken with e.g. <literal>meta.broken = !hostPlatform.isWindows</literal>. Of course, this begs the question of what "ought" means exactly. That is left to the package maintainer.
142112 </para>
143113 </section>
144114 <section xml:id="sec-allow-unfree">
145115 <title>Installing unfree packages</title>
146116
147117 <para>
148− There are several ways to tweak how Nix handles a package which has been
149− marked as unfree.
118+ There are several ways to tweak how Nix handles a package which has been marked as unfree.
150119 </para>
151120
152121 <itemizedlist>
153122 <listitem>
154123 <para>
155− To temporarily allow all unfree packages, you can use an environment
156− variable for a single invocation of the nix tools:
124+ To temporarily allow all unfree packages, you can use an environment variable for a single invocation of the nix tools:
157125<programlisting>$ export NIXPKGS_ALLOW_UNFREE=1</programlisting>
158126 </para>
159127 </listitem>
160128 <listitem>
161129 <para>
162− It is possible to permanently allow individual unfree packages, while
163− still blocking unfree packages by default using the
164− <literal>allowUnfreePredicate</literal> configuration option in the user
165− configuration file.
130+ It is possible to permanently allow individual unfree packages, while still blocking unfree packages by default using the <literal>allowUnfreePredicate</literal> configuration option in the user configuration file.
166131 </para>
167132 <para>
168− This option is a function which accepts a package as a parameter, and
169− returns a boolean. The following example configuration accepts a package
170− and always returns false:
133+ This option is a function which accepts a package as a parameter, and returns a boolean. The following example configuration accepts a package and always returns false:
171134<programlisting>
172135{
173136 allowUnfreePredicate = (pkg: false);
@@ -175,8 +138,7 @@
175138</programlisting>
176139 </para>
177140 <para>
178− For a more useful example, try the following. This configuration only
179− allows unfree packages named flash player and visual studio code:
141+ For a more useful example, try the following. This configuration only allows unfree packages named flash player and visual studio code:
180142<programlisting>
181143{
182144 allowUnfreePredicate = (pkg: builtins.elem
@@ -190,14 +152,10 @@
190152 </listitem>
191153 <listitem>
192154 <para>
193− It is also possible to whitelist and blacklist licenses that are
194− specifically acceptable or not acceptable, using
195− <literal>whitelistedLicenses</literal> and
196− <literal>blacklistedLicenses</literal>, respectively.
155+ It is also possible to whitelist and blacklist licenses that are specifically acceptable or not acceptable, using <literal>whitelistedLicenses</literal> and <literal>blacklistedLicenses</literal>, respectively.
197156 </para>
198157 <para>
199− The following example configuration whitelists the licenses
200− <literal>amd</literal> and <literal>wtfpl</literal>:
158+ The following example configuration whitelists the licenses <literal>amd</literal> and <literal>wtfpl</literal>:
201159<programlisting>
202160{
203161 whitelistedLicenses = with stdenv.lib.licenses; [ amd wtfpl ];
@@ -205,8 +163,7 @@
205163</programlisting>
206164 </para>
207165 <para>
208− The following example configuration blacklists the <literal>gpl3</literal>
209− and <literal>agpl3</literal> licenses:
166+ The following example configuration blacklists the <literal>gpl3</literal> and <literal>agpl3</literal> licenses:
210167<programlisting>
211168{
212169 blacklistedLicenses = with stdenv.lib.licenses; [ agpl3 gpl3 ];
@@ -217,37 +174,29 @@
217174 </itemizedlist>
218175
219176 <para>
220− A complete list of licenses can be found in the file
221− <filename>lib/licenses.nix</filename> of the nixpkgs tree.
177+ A complete list of licenses can be found in the file <filename>lib/licenses.nix</filename> of the nixpkgs tree.
222178 </para>
223179 </section>
224180 <section xml:id="sec-allow-insecure">
225181 <title>Installing insecure packages</title>
226182
227183 <para>
228− There are several ways to tweak how Nix handles a package which has been
229− marked as insecure.
184+ There are several ways to tweak how Nix handles a package which has been marked as insecure.
230185 </para>
231186
232187 <itemizedlist>
233188 <listitem>
234189 <para>
235− To temporarily allow all insecure packages, you can use an environment
236− variable for a single invocation of the nix tools:
190+ To temporarily allow all insecure packages, you can use an environment variable for a single invocation of the nix tools:
237191<programlisting>$ export NIXPKGS_ALLOW_INSECURE=1</programlisting>
238192 </para>
239193 </listitem>
240194 <listitem>
241195 <para>
242− It is possible to permanently allow individual insecure packages, while
243− still blocking other insecure packages by default using the
244− <literal>permittedInsecurePackages</literal> configuration option in the
245− user configuration file.
196+ It is possible to permanently allow individual insecure packages, while still blocking other insecure packages by default using the <literal>permittedInsecurePackages</literal> configuration option in the user configuration file.
246197 </para>
247198 <para>
248− The following example configuration permits the installation of the
249− hypothetically insecure package <literal>hello</literal>, version
250− <literal>1.2.3</literal>:
199+ The following example configuration permits the installation of the hypothetically insecure package <literal>hello</literal>, version <literal>1.2.3</literal>:
251200<programlisting>
252201{
253202 permittedInsecurePackages = [
@@ -259,18 +208,13 @@
259208 </listitem>
260209 <listitem>
261210 <para>
262− It is also possible to create a custom policy around which insecure
263− packages to allow and deny, by overriding the
264− <literal>allowInsecurePredicate</literal> configuration option.
211+ It is also possible to create a custom policy around which insecure packages to allow and deny, by overriding the <literal>allowInsecurePredicate</literal> configuration option.
265212 </para>
266213 <para>
267− The <literal>allowInsecurePredicate</literal> option is a function which
268− accepts a package and returns a boolean, much like
269− <literal>allowUnfreePredicate</literal>.
214+ The <literal>allowInsecurePredicate</literal> option is a function which accepts a package and returns a boolean, much like <literal>allowUnfreePredicate</literal>.
270215 </para>
271216 <para>
272− The following configuration example only allows insecure packages with
273− very short names:
217+ The following configuration example only allows insecure packages with very short names:
274218<programlisting>
275219{
276220 allowInsecurePredicate = (pkg: (builtins.stringLength (builtins.parseDrvName pkg.name).name) &lt;= 5);
@@ -278,8 +222,7 @@
278222</programlisting>
279223 </para>
280224 <para>
281− Note that <literal>permittedInsecurePackages</literal> is only checked if
282− <literal>allowInsecurePredicate</literal> is not specified.
225+ Note that <literal>permittedInsecurePackages</literal> is only checked if <literal>allowInsecurePredicate</literal> is not specified.
283226 </para>
284227 </listitem>
285228 </itemizedlist>
@@ -289,10 +232,7 @@
289232 <title>Modify packages via <literal>packageOverrides</literal></title>
290233
291234 <para>
292− You can define a function called <varname>packageOverrides</varname> in your
293− local <filename>~/.config/nixpkgs/config.nix</filename> to override Nix
294− packages. It must be a function that takes pkgs as an argument and returns a
295− modified set of packages.
235+ You can define a function called <varname>packageOverrides</varname> in your local <filename>~/.config/nixpkgs/config.nix</filename> to override Nix packages. It must be a function that takes pkgs as an argument and returns a modified set of packages.
296236<programlisting>
297237{
298238 packageOverrides = pkgs: rec {
@@ -309,15 +249,7 @@
309249 <title>Build an environment</title>
310250
311251 <para>
312− Using <literal>packageOverrides</literal>, it is possible to manage
313− packages declaratively. This means that we can list all of our desired
314− packages within a declarative Nix expression. For example, to have
315− <literal>aspell</literal>, <literal>bc</literal>,
316− <literal>ffmpeg</literal>, <literal>coreutils</literal>,
317− <literal>gdb</literal>, <literal>nixUnstable</literal>,
318− <literal>emscripten</literal>, <literal>jq</literal>,
319− <literal>nox</literal>, and <literal>silver-searcher</literal>, we could
320− use the following in <filename>~/.config/nixpkgs/config.nix</filename>:
252+ Using <literal>packageOverrides</literal>, it is possible to manage packages declaratively. This means that we can list all of our desired packages within a declarative Nix expression. For example, to have <literal>aspell</literal>, <literal>bc</literal>, <literal>ffmpeg</literal>, <literal>coreutils</literal>, <literal>gdb</literal>, <literal>nixUnstable</literal>, <literal>emscripten</literal>, <literal>jq</literal>, <literal>nox</literal>, and <literal>silver-searcher</literal>, we could use the following in <filename>~/.config/nixpkgs/config.nix</filename>:
321253 </para>
322254
323255<screen>
@@ -343,13 +275,7 @@
343275</screen>
344276
345277 <para>
346− To install it into our environment, you can just run <literal>nix-env -iA
347− nixpkgs.myPackages</literal>. If you want to load the packages to be built
348− from a working copy of <literal>nixpkgs</literal> you just run
349− <literal>nix-env -f. -iA myPackages</literal>. To explore what's been
350− installed, just look through <filename>~/.nix-profile/</filename>. You can
351− see that a lot of stuff has been installed. Some of this stuff is useful
352− some of it isn't. Let's tell Nixpkgs to only link the stuff that we want:
278+ To install it into our environment, you can just run <literal>nix-env -iA nixpkgs.myPackages</literal>. If you want to load the packages to be built from a working copy of <literal>nixpkgs</literal> you just run <literal>nix-env -f. -iA myPackages</literal>. To explore what's been installed, just look through <filename>~/.nix-profile/</filename>. You can see that a lot of stuff has been installed. Some of this stuff is useful some of it isn't. Let's tell Nixpkgs to only link the stuff that we want:
353279 </para>
354280
355281<screen>
@@ -376,12 +302,7 @@
376302</screen>
377303
378304 <para>
379− <literal>pathsToLink</literal> tells Nixpkgs to only link the paths listed
380− which gets rid of the extra stuff in the profile. <filename>/bin</filename>
381− and <filename>/share</filename> are good defaults for a user environment,
382− getting rid of the clutter. If you are running on Nix on MacOS, you may
383− want to add another path as well, <filename>/Applications</filename>, that
384− makes GUI apps available.
305+ <literal>pathsToLink</literal> tells Nixpkgs to only link the paths listed which gets rid of the extra stuff in the profile. <filename>/bin</filename> and <filename>/share</filename> are good defaults for a user environment, getting rid of the clutter. If you are running on Nix on MacOS, you may want to add another path as well, <filename>/Applications</filename>, that makes GUI apps available.
385306 </para>
386307 </section>
387308
@@ -389,13 +310,7 @@
389310 <title>Getting documentation</title>
390311
391312 <para>
392− After building that new environment, look through
393− <filename>~/.nix-profile</filename> to make sure everything is there that
394− we wanted. Discerning readers will note that some files are missing. Look
395− inside <filename>~/.nix-profile/share/man/man1/</filename> to verify this.
396− There are no man pages for any of the Nix tools! This is because some
397− packages like Nix have multiple outputs for things like documentation (see
398− section 4). Let's make Nix install those as well.
313+ After building that new environment, look through <filename>~/.nix-profile</filename> to make sure everything is there that we wanted. Discerning readers will note that some files are missing. Look inside <filename>~/.nix-profile/share/man/man1/</filename> to verify this. There are no man pages for any of the Nix tools! This is because some packages like Nix have multiple outputs for things like documentation (see section 4). Let's make Nix install those as well.
399314 </para>
400315
401316<screen>
@@ -422,9 +337,7 @@
422337</screen>
423338
424339 <para>
425− This provides us with some useful documentation for using our packages.
426− However, if we actually want those manpages to be detected by man, we need
427− to set up our environment. This can also be managed within Nix expressions.
340+ This provides us with some useful documentation for using our packages. However, if we actually want those manpages to be detected by man, we need to set up our environment. This can also be managed within Nix expressions.
428341 </para>
429342
430343<screen>
@@ -460,9 +373,7 @@
460373</screen>
461374
462375 <para>
463− For this to work fully, you must also have this script sourced when you are
464− logged in. Try adding something like this to your
465− <filename>~/.profile</filename> file:
376+ For this to work fully, you must also have this script sourced when you are logged in. Try adding something like this to your <filename>~/.profile</filename> file:
466377 </para>
467378
468379<screen>
@@ -477,8 +388,7 @@ fi
477388</screen>
478389
479390 <para>
480− Now just run <literal>source $HOME/.profile</literal> and you can starting
481− loading man pages from your environent.
391+ Now just run <literal>source $HOME/.profile</literal> and you can starting loading man pages from your environent.
482392 </para>
483393 </section>
484394
@@ -486,9 +396,7 @@ fi
486396 <title>GNU info setup</title>
487397
488398 <para>
489− Configuring GNU info is a little bit trickier than man pages. To work
490− correctly, info needs a database to be generated. This can be done with
491− some small modifications to our environment scripts.
399+ Configuring GNU info is a little bit trickier than man pages. To work correctly, info needs a database to be generated. This can be done with some small modifications to our environment scripts.
492400 </para>
493401
494402<screen>
@@ -534,11 +442,7 @@ fi
534442</screen>
535443
536444 <para>
537− <literal>postBuild</literal> tells Nixpkgs to run a command after building
538− the environment. In this case, <literal>install-info</literal> adds the
539− installed info pages to <literal>dir</literal> which is GNU info's default
540− root node. Note that <literal>texinfoInteractive</literal> is added to the
541− environment to give the <literal>install-info</literal> command.
445+ <literal>postBuild</literal> tells Nixpkgs to run a command after building the environment. In this case, <literal>install-info</literal> adds the installed info pages to <literal>dir</literal> which is GNU info's default root node. Note that <literal>texinfoInteractive</literal> is added to the environment to give the <literal>install-info</literal> command.
542446 </para>
543447 </section>
544448 </section>
doc/contributing.xml+5−10
@@ -3,10 +3,8 @@
33 xml:id="chap-contributing">
44 <title>Contributing to this documentation</title>
55 <para>
6− The DocBook sources of the Nixpkgs manual are in the
7− <filename
8−xlink:href="https://github.com/NixOS/nixpkgs/tree/master/doc">doc</filename>
9− subdirectory of the Nixpkgs repository.
6+ The DocBook sources of the Nixpkgs manual are in the <filename
7+xlink:href="https://github.com/NixOS/nixpkgs/tree/master/doc">doc</filename> subdirectory of the Nixpkgs repository.
108 </para>
119 <para>
1210 You can quickly check your edits with <command>make</command>:
@@ -17,19 +15,16 @@ xlink:href="https://github.com/NixOS/nixpkgs/tree/master/doc">doc</filename>
1715<prompt>[nix-shell]$ </prompt>make
1816</screen>
1917 <para>
20− If you experience problems, run <command>make debug</command> to help
21− understand the docbook errors.
18+ If you experience problems, run <command>make debug</command> to help understand the docbook errors.
2219 </para>
2320 <para>
24− After making modifications to the manual, it's important to build it before
25− committing. You can do that as follows:
21+ After making modifications to the manual, it's important to build it before committing. You can do that as follows:
2622<screen>
2723<prompt>$ </prompt>cd /path/to/nixpkgs/doc
2824<prompt>$ </prompt>nix-shell
2925<prompt>[nix-shell]$ </prompt>make clean
3026<prompt>[nix-shell]$ </prompt>nix-build .
3127</screen>
32− If the build succeeds, the manual will be in
33− <filename>./result/share/doc/nixpkgs/manual.html</filename>.
28+ If the build succeeds, the manual will be in <filename>./result/share/doc/nixpkgs/manual.html</filename>.
3429 </para>
3530</chapter>
doc/cross-compilation.xml+53−337
@@ -6,25 +6,11 @@
66 <title>Introduction</title>
77
88 <para>
9− "Cross-compilation" means compiling a program on one machine for another
10− type of machine. For example, a typical use of cross-compilation is to
11− compile programs for embedded devices. These devices often don't have the
12− computing power and memory to compile their own programs. One might think
13− that cross-compilation is a fairly niche concern. However, there are
14− significant advantages to rigorously distinguishing between build-time and
15− run-time environments! Significant, because the benefits apply even when one
16− is developing and deploying on the same machine. Nixpkgs is increasingly
17− adopting the opinion that packages should be written with cross-compilation
18− in mind, and nixpkgs should evaluate in a similar way (by minimizing
19− cross-compilation-specific special cases) whether or not one is
20− cross-compiling.
9+ "Cross-compilation" means compiling a program on one machine for another type of machine. For example, a typical use of cross-compilation is to compile programs for embedded devices. These devices often don't have the computing power and memory to compile their own programs. One might think that cross-compilation is a fairly niche concern. However, there are significant advantages to rigorously distinguishing between build-time and run-time environments! Significant, because the benefits apply even when one is developing and deploying on the same machine. Nixpkgs is increasingly adopting the opinion that packages should be written with cross-compilation in mind, and nixpkgs should evaluate in a similar way (by minimizing cross-compilation-specific special cases) whether or not one is cross-compiling.
2110 </para>
2211
2312 <para>
24− This chapter will be organized in three parts. First, it will describe the
25− basics of how to package software in a way that supports cross-compilation.
26− Second, it will describe how to use Nixpkgs when cross-compiling. Third, it
27− will describe the internal infrastructure supporting cross-compilation.
13+ This chapter will be organized in three parts. First, it will describe the basics of how to package software in a way that supports cross-compilation. Second, it will describe how to use Nixpkgs when cross-compiling. Third, it will describe the internal infrastructure supporting cross-compilation.
2814 </para>
2915 </section>
3016<!--============================================================-->
@@ -35,24 +21,12 @@
3521 <title>Platform parameters</title>
3622
3723 <para>
38− Nixpkgs follows the
39− <link
40− xlink:href="https://gcc.gnu.org/onlinedocs/gccint/Configure-Terms.html">conventions
41− of GNU autoconf</link>. We distinguish between 3 types of platforms when
42− building a derivation: <wordasword>build</wordasword>,
43− <wordasword>host</wordasword>, and <wordasword>target</wordasword>. In
44− summary, <wordasword>build</wordasword> is the platform on which a package
45− is being built, <wordasword>host</wordasword> is the platform on which it
46− will run. The third attribute, <wordasword>target</wordasword>, is relevant
47− only for certain specific compilers and build tools.
24+ Nixpkgs follows the <link
25+ xlink:href="https://gcc.gnu.org/onlinedocs/gccint/Configure-Terms.html">conventions of GNU autoconf</link>. We distinguish between 3 types of platforms when building a derivation: <wordasword>build</wordasword>, <wordasword>host</wordasword>, and <wordasword>target</wordasword>. In summary, <wordasword>build</wordasword> is the platform on which a package is being built, <wordasword>host</wordasword> is the platform on which it will run. The third attribute, <wordasword>target</wordasword>, is relevant only for certain specific compilers and build tools.
4826 </para>
4927
5028 <para>
51− In Nixpkgs, these three platforms are defined as attribute sets under the
52− names <literal>buildPlatform</literal>, <literal>hostPlatform</literal>,
53− and <literal>targetPlatform</literal>. They are always defined as
54− attributes in the standard environment. That means one can access them
55− like:
29+ In Nixpkgs, these three platforms are defined as attribute sets under the names <literal>buildPlatform</literal>, <literal>hostPlatform</literal>, and <literal>targetPlatform</literal>. They are always defined as attributes in the standard environment. That means one can access them like:
5630<programlisting>{ stdenv, fooDep, barDep, .. }: ...stdenv.buildPlatform...</programlisting>
5731 .
5832 </para>
@@ -64,9 +38,7 @@
6438 </term>
6539 <listitem>
6640 <para>
67− The "build platform" is the platform on which a package is built. Once
68− someone has a built package, or pre-built binary package, the build
69− platform should not matter and can be ignored.
41+ The "build platform" is the platform on which a package is built. Once someone has a built package, or pre-built binary package, the build platform should not matter and can be ignored.
7042 </para>
7143 </listitem>
7244 </varlistentry>
@@ -76,9 +48,7 @@
7648 </term>
7749 <listitem>
7850 <para>
79− The "host platform" is the platform on which a package will be run. This
80− is the simplest platform to understand, but also the one with the worst
81− name.
51+ The "host platform" is the platform on which a package will be run. This is the simplest platform to understand, but also the one with the worst name.
8252 </para>
8353 </listitem>
8454 </varlistentry>
@@ -88,44 +58,23 @@
8858 </term>
8959 <listitem>
9060 <para>
91− The "target platform" attribute is, unlike the other two attributes, not
92− actually fundamental to the process of building software. Instead, it is
93− only relevant for compatibility with building certain specific compilers
94− and build tools. It can be safely ignored for all other packages.
61+ The "target platform" attribute is, unlike the other two attributes, not actually fundamental to the process of building software. Instead, it is only relevant for compatibility with building certain specific compilers and build tools. It can be safely ignored for all other packages.
9562 </para>
9663 <para>
97− The build process of certain compilers is written in such a way that the
98− compiler resulting from a single build can itself only produce binaries
99− for a single platform. The task of specifying this single "target
100− platform" is thus pushed to build time of the compiler. The root cause
101− of this is that the compiler (which will be run on the host) and the
102− standard library/runtime (which will be run on the target) are built by
103− a single build process.
64+ The build process of certain compilers is written in such a way that the compiler resulting from a single build can itself only produce binaries for a single platform. The task of specifying this single "target platform" is thus pushed to build time of the compiler. The root cause of this is that the compiler (which will be run on the host) and the standard library/runtime (which will be run on the target) are built by a single build process.
10465 </para>
10566 <para>
106− There is no fundamental need to think about a single target ahead of
107− time like this. If the tool supports modular or pluggable backends, both
108− the need to specify the target at build time and the constraint of
109− having only a single target disappear. An example of such a tool is
110− LLVM.
67+ There is no fundamental need to think about a single target ahead of time like this. If the tool supports modular or pluggable backends, both the need to specify the target at build time and the constraint of having only a single target disappear. An example of such a tool is LLVM.
11168 </para>
11269 <para>
113− Although the existence of a "target platfom" is arguably a historical
114− mistake, it is a common one: examples of tools that suffer from it are
115− GCC, Binutils, GHC and Autoconf. Nixpkgs tries to avoid sharing in the
116− mistake where possible. Still, because the concept of a target platform
117− is so ingrained, it is best to support it as is.
70+ Although the existence of a "target platfom" is arguably a historical mistake, it is a common one: examples of tools that suffer from it are GCC, Binutils, GHC and Autoconf. Nixpkgs tries to avoid sharing in the mistake where possible. Still, because the concept of a target platform is so ingrained, it is best to support it as is.
11871 </para>
11972 </listitem>
12073 </varlistentry>
12174 </variablelist>
12275
12376 <para>
124− The exact schema these fields follow is a bit ill-defined due to a long and
125− convoluted evolution, but this is slowly being cleaned up. You can see
126− examples of ones used in practice in
127− <literal>lib.systems.examples</literal>; note how they are not all very
128− consistent. For now, here are few fields can count on them containing:
77+ The exact schema these fields follow is a bit ill-defined due to a long and convoluted evolution, but this is slowly being cleaned up. You can see examples of ones used in practice in <literal>lib.systems.examples</literal>; note how they are not all very consistent. For now, here are few fields can count on them containing:
12978 </para>
13079
13180 <variablelist>
@@ -135,13 +84,7 @@
13584 </term>
13685 <listitem>
13786 <para>
138− This is a two-component shorthand for the platform. Examples of this
139− would be "x86_64-darwin" and "i686-linux"; see
140− <literal>lib.systems.doubles</literal> for more. The first component
141− corresponds to the CPU architecture of the platform and the second to
142− the operating system of the platform (<literal>[cpu]-[os]</literal>).
143− This format has built-in support in Nix, such as the
144− <varname>builtins.currentSystem</varname> impure string.
87+ This is a two-component shorthand for the platform. Examples of this would be "x86_64-darwin" and "i686-linux"; see <literal>lib.systems.doubles</literal> for more. The first component corresponds to the CPU architecture of the platform and the second to the operating system of the platform (<literal>[cpu]-[os]</literal>). This format has built-in support in Nix, such as the <varname>builtins.currentSystem</varname> impure string.
14588 </para>
14689 </listitem>
14790 </varlistentry>
@@ -151,15 +94,7 @@
15194 </term>
15295 <listitem>
15396 <para>
154− This is a 3- or 4- component shorthand for the platform. Examples of
155− this would be <literal>x86_64-unknown-linux-gnu</literal> and
156− <literal>aarch64-apple-darwin14</literal>. This is a standard format
157− called the "LLVM target triple", as they are pioneered by LLVM. In the
158− 4-part form, this corresponds to
159− <literal>[cpu]-[vendor]-[os]-[abi]</literal>. This format is strictly
160− more informative than the "Nix host double", as the previous format
161− could analogously be termed. This needs a better name than
162− <varname>config</varname>!
97+ This is a 3- or 4- component shorthand for the platform. Examples of this would be <literal>x86_64-unknown-linux-gnu</literal> and <literal>aarch64-apple-darwin14</literal>. This is a standard format called the "LLVM target triple", as they are pioneered by LLVM. In the 4-part form, this corresponds to <literal>[cpu]-[vendor]-[os]-[abi]</literal>. This format is strictly more informative than the "Nix host double", as the previous format could analogously be termed. This needs a better name than <varname>config</varname>!
16398 </para>
16499 </listitem>
165100 </varlistentry>
@@ -169,10 +104,7 @@
169104 </term>
170105 <listitem>
171106 <para>
172− This is a Nix representation of a parsed LLVM target triple with
173− white-listed components. This can be specified directly, or actually
174− parsed from the <varname>config</varname>. See
175− <literal>lib.systems.parse</literal> for the exact representation.
107+ This is a Nix representation of a parsed LLVM target triple with white-listed components. This can be specified directly, or actually parsed from the <varname>config</varname>. See <literal>lib.systems.parse</literal> for the exact representation.
176108 </para>
177109 </listitem>
178110 </varlistentry>
@@ -182,10 +114,7 @@
182114 </term>
183115 <listitem>
184116 <para>
185− This is a string identifying the standard C library used. Valid
186− identifiers include "glibc" for GNU libc, "libSystem" for Darwin's
187− Libsystem, and "uclibc" for µClibc. It should probably be refactored to
188− use the module system, like <varname>parse</varname>.
117+ This is a string identifying the standard C library used. Valid identifiers include "glibc" for GNU libc, "libSystem" for Darwin's Libsystem, and "uclibc" for µClibc. It should probably be refactored to use the module system, like <varname>parse</varname>.
189118 </para>
190119 </listitem>
191120 </varlistentry>
@@ -195,10 +124,7 @@
195124 </term>
196125 <listitem>
197126 <para>
198− These predicates are defined in <literal>lib.systems.inspect</literal>,
199− and slapped onto every platform. They are superior to the ones in
200− <varname>stdenv</varname> as they force the user to be explicit about
201− which platform they are inspecting. Please use these instead of those.
127+ These predicates are defined in <literal>lib.systems.inspect</literal>, and slapped onto every platform. They are superior to the ones in <varname>stdenv</varname> as they force the user to be explicit about which platform they are inspecting. Please use these instead of those.
202128 </para>
203129 </listitem>
204130 </varlistentry>
@@ -208,11 +134,7 @@
208134 </term>
209135 <listitem>
210136 <para>
211− This is, quite frankly, a dumping ground of ad-hoc settings (it's an
212− attribute set). See <literal>lib.systems.platforms</literal> for
213− examples—there's hopefully one in there that will work verbatim for
214− each platform that is working. Please help us triage these flags and
215− give them better homes!
137+ This is, quite frankly, a dumping ground of ad-hoc settings (it's an attribute set). See <literal>lib.systems.platforms</literal> for examples—there's hopefully one in there that will work verbatim for each platform that is working. Please help us triage these flags and give them better homes!
216138 </para>
217139 </listitem>
218140 </varlistentry>
@@ -224,62 +146,33 @@
224146
225147 <note>
226148 <para>
227− This is a rather philosophical description that isn't very
228− Nixpkgs-specific. For an overview of all the relevant attributes given to
229− <varname>mkDerivation</varname>, see
230− <xref
231− linkend="ssec-stdenv-dependencies"/>. For a description of how
232− everything is implemented, see
233− <xref linkend="ssec-cross-dependency-implementation" />.
149+ This is a rather philosophical description that isn't very Nixpkgs-specific. For an overview of all the relevant attributes given to <varname>mkDerivation</varname>, see <xref
150+ linkend="ssec-stdenv-dependencies"/>. For a description of how everything is implemented, see <xref linkend="ssec-cross-dependency-implementation" />.
234151 </para>
235152 </note>
236153
237154 <para>
238− In this section we explore the relationship between both runtime and
239− build-time dependencies and the 3 Autoconf platforms.
155+ In this section we explore the relationship between both runtime and build-time dependencies and the 3 Autoconf platforms.
240156 </para>
241157
242158 <para>
243− A run time dependency between two packages requires that their host
244− platforms match. This is directly implied by the meaning of "host platform"
245− and "runtime dependency": The package dependency exists while both packages
246− are running on a single host platform.
159+ A run time dependency between two packages requires that their host platforms match. This is directly implied by the meaning of "host platform" and "runtime dependency": The package dependency exists while both packages are running on a single host platform.
247160 </para>
248161
249162 <para>
250− A build time dependency, however, has a shift in platforms between the
251− depending package and the depended-on package. "build time dependency"
252− means that to build the depending package we need to be able to run the
253− depended-on's package. The depending package's build platform is therefore
254− equal to the depended-on package's host platform.
163+ A build time dependency, however, has a shift in platforms between the depending package and the depended-on package. "build time dependency" means that to build the depending package we need to be able to run the depended-on's package. The depending package's build platform is therefore equal to the depended-on package's host platform.
255164 </para>
256165
257166 <para>
258− If both the dependency and depending packages aren't compilers or other
259− machine-code-producing tools, we're done. And indeed
260− <varname>buildInputs</varname> and <varname>nativeBuildInputs</varname>
261− have covered these simpler build-time and run-time (respectively) changes
262− for many years. But if the dependency does produce machine code, we might
263− need to worry about its target platform too. In principle, that target
264− platform might be any of the depending package's build, host, or target
265− platforms, but we prohibit dependencies from a "later" platform to an
266− earlier platform to limit confusion because we've never seen a legitimate
267− use for them.
167+ If both the dependency and depending packages aren't compilers or other machine-code-producing tools, we're done. And indeed <varname>buildInputs</varname> and <varname>nativeBuildInputs</varname> have covered these simpler build-time and run-time (respectively) changes for many years. But if the dependency does produce machine code, we might need to worry about its target platform too. In principle, that target platform might be any of the depending package's build, host, or target platforms, but we prohibit dependencies from a "later" platform to an earlier platform to limit confusion because we've never seen a legitimate use for them.
268168 </para>
269169
270170 <para>
271− Finally, if the depending package is a compiler or other
272− machine-code-producing tool, it might need dependencies that run at "emit
273− time". This is for compilers that (regrettably) insist on being built
274− together with their source langauges' standard libraries. Assuming build !=
275− host != target, a run-time dependency of the standard library cannot be run
276− at the compiler's build time or run time, but only at the run time of code
277− emitted by the compiler.
171+ Finally, if the depending package is a compiler or other machine-code-producing tool, it might need dependencies that run at "emit time". This is for compilers that (regrettably) insist on being built together with their source langauges' standard libraries. Assuming build != host != target, a run-time dependency of the standard library cannot be run at the compiler's build time or run time, but only at the run time of code emitted by the compiler.
278172 </para>
279173
280174 <para>
281− Putting this all together, that means we have dependencies in the form
282− "host → target", in at most the following six combinations:
175+ Putting this all together, that means we have dependencies in the form "host → target", in at most the following six combinations:
283176 <table>
284177 <caption>Possible dependency types</caption>
285178 <thead>
@@ -318,16 +211,7 @@
318211 </para>
319212
320213 <para>
321− Some examples will make this table clearer. Suppose there's some package
322− that is being built with a <literal>(build, host, target)</literal>
323− platform triple of <literal>(foo, bar, baz)</literal>. If it has a
324− build-time library dependency, that would be a "host → build" dependency
325− with a triple of <literal>(foo, foo, *)</literal> (the target platform is
326− irrelevant). If it needs a compiler to be built, that would be a "build →
327− host" dependency with a triple of <literal>(foo, foo, *)</literal> (the
328− target platform is irrelevant). That compiler, would be built with another
329− compiler, also "build → host" dependency, with a triple of <literal>(foo,
330− foo, foo)</literal>.
214+ Some examples will make this table clearer. Suppose there's some package that is being built with a <literal>(build, host, target)</literal> platform triple of <literal>(foo, bar, baz)</literal>. If it has a build-time library dependency, that would be a "host → build" dependency with a triple of <literal>(foo, foo, *)</literal> (the target platform is irrelevant). If it needs a compiler to be built, that would be a "build → host" dependency with a triple of <literal>(foo, foo, *)</literal> (the target platform is irrelevant). That compiler, would be built with another compiler, also "build → host" dependency, with a triple of <literal>(foo, foo, foo)</literal>.
331215 </para>
332216 </section>
333217
@@ -335,20 +219,14 @@
335219 <title>Cross packaging cookbook</title>
336220
337221 <para>
338− Some frequently encountered problems when packaging for cross-compilation
339− should be answered here. Ideally, the information above is exhaustive, so
340− this section cannot provide any new information, but it is ludicrous and
341− cruel to expect everyone to spend effort working through the interaction of
342− many features just to figure out the same answer to the same common
343− problem. Feel free to add to this list!
222+ Some frequently encountered problems when packaging for cross-compilation should be answered here. Ideally, the information above is exhaustive, so this section cannot provide any new information, but it is ludicrous and cruel to expect everyone to spend effort working through the interaction of many features just to figure out the same answer to the same common problem. Feel free to add to this list!
344223 </para>
345224
346225 <qandaset>
347226 <qandaentry xml:id="cross-qa-build-c-program-in-build-environment">
348227 <question>
349228 <para>
350− What if my package's build system needs to build a C program to be run
351− under the build environment?
229+ What if my package's build system needs to build a C program to be run under the build environment?
352230 </para>
353231 </question>
354232 <answer>
@@ -366,11 +244,7 @@
366244 </question>
367245 <answer>
368246 <para>
369− Many packages assume that an unprefixed <command>ar</command> is
370− available, but Nix doesn't provide one. It only provides a prefixed one,
371− just as it only does for all the other binutils programs. It may be
372− necessary to patch the package to fix the build system to use a prefixed
373− `ar`.
247+ Many packages assume that an unprefixed <command>ar</command> is available, but Nix doesn't provide one. It only provides a prefixed one, just as it only does for all the other binutils programs. It may be necessary to patch the package to fix the build system to use a prefixed `ar`.
374248 </para>
375249 </answer>
376250 </qandaentry>
@@ -395,82 +269,32 @@
395269 <title>Cross-building packages</title>
396270
397271 <para>
398− Nixpkgs can be instantiated with <varname>localSystem</varname> alone, in
399− which case there is no cross-compiling and everything is built by and for
400− that system, or also with <varname>crossSystem</varname>, in which case
401− packages run on the latter, but all building happens on the former. Both
402− parameters take the same schema as the 3 (build, host, and target) platforms
403− defined in the previous section. As mentioned above,
404− <literal>lib.systems.examples</literal> has some platforms which are used as
405− arguments for these parameters in practice. You can use them
406− programmatically, or on the command line:
272+ Nixpkgs can be instantiated with <varname>localSystem</varname> alone, in which case there is no cross-compiling and everything is built by and for that system, or also with <varname>crossSystem</varname>, in which case packages run on the latter, but all building happens on the former. Both parameters take the same schema as the 3 (build, host, and target) platforms defined in the previous section. As mentioned above, <literal>lib.systems.examples</literal> has some platforms which are used as arguments for these parameters in practice. You can use them programmatically, or on the command line:
407273<programlisting>
408274nix-build &lt;nixpkgs&gt; --arg crossSystem '(import &lt;nixpkgs/lib&gt;).systems.examples.fooBarBaz' -A whatever</programlisting>
409275 </para>
410276
411277 <note>
412278 <para>
413− Eventually we would like to make these platform examples an unnecessary
414− convenience so that
279+ Eventually we would like to make these platform examples an unnecessary convenience so that
415280<programlisting>
416281nix-build &lt;nixpkgs&gt; --arg crossSystem '{ config = "&lt;arch&gt;-&lt;os&gt;-&lt;vendor&gt;-&lt;abi&gt;"; }' -A whatever</programlisting>
417− works in the vast majority of cases. The problem today is dependencies on
418− other sorts of configuration which aren't given proper defaults. We rely on
419− the examples to crudely to set those configuration parameters in some
420− vaguely sane manner on the users behalf. Issue
421− <link xlink:href="https://github.com/NixOS/nixpkgs/issues/34274">#34274</link>
422− tracks this inconvenience along with its root cause in crufty configuration
423− options.
282+ works in the vast majority of cases. The problem today is dependencies on other sorts of configuration which aren't given proper defaults. We rely on the examples to crudely to set those configuration parameters in some vaguely sane manner on the users behalf. Issue <link xlink:href="https://github.com/NixOS/nixpkgs/issues/34274">#34274</link> tracks this inconvenience along with its root cause in crufty configuration options.
424283 </para>
425284 </note>
426285
427286 <para>
428− While one is free to pass both parameters in full, there's a lot of logic to
429− fill in missing fields. As discussed in the previous section, only one of
430− <varname>system</varname>, <varname>config</varname>, and
431− <varname>parsed</varname> is needed to infer the other two. Additionally,
432− <varname>libc</varname> will be inferred from <varname>parse</varname>.
433− Finally, <literal>localSystem.system</literal> is also
434− <emphasis>impurely</emphasis> inferred based on the platform evaluation
435− occurs. This means it is often not necessary to pass
436− <varname>localSystem</varname> at all, as in the command-line example in the
437− previous paragraph.
287+ While one is free to pass both parameters in full, there's a lot of logic to fill in missing fields. As discussed in the previous section, only one of <varname>system</varname>, <varname>config</varname>, and <varname>parsed</varname> is needed to infer the other two. Additionally, <varname>libc</varname> will be inferred from <varname>parse</varname>. Finally, <literal>localSystem.system</literal> is also <emphasis>impurely</emphasis> inferred based on the platform evaluation occurs. This means it is often not necessary to pass <varname>localSystem</varname> at all, as in the command-line example in the previous paragraph.
438288 </para>
439289
440290 <note>
441291 <para>
442− Many sources (manual, wiki, etc) probably mention passing
443− <varname>system</varname>, <varname>platform</varname>, along with the
444− optional <varname>crossSystem</varname> to nixpkgs: <literal>import
445− &lt;nixpkgs&gt; { system = ..; platform = ..; crossSystem = ..;
446− }</literal>. Passing those two instead of <varname>localSystem</varname> is
447− still supported for compatibility, but is discouraged. Indeed, much of the
448− inference we do for these parameters is motivated by compatibility as much
449− as convenience.
292+ Many sources (manual, wiki, etc) probably mention passing <varname>system</varname>, <varname>platform</varname>, along with the optional <varname>crossSystem</varname> to nixpkgs: <literal>import &lt;nixpkgs&gt; { system = ..; platform = ..; crossSystem = ..; }</literal>. Passing those two instead of <varname>localSystem</varname> is still supported for compatibility, but is discouraged. Indeed, much of the inference we do for these parameters is motivated by compatibility as much as convenience.
450293 </para>
451294 </note>
452295
453296 <para>
454− One would think that <varname>localSystem</varname> and
455− <varname>crossSystem</varname> overlap horribly with the three
456− <varname>*Platforms</varname> (<varname>buildPlatform</varname>,
457− <varname>hostPlatform,</varname> and <varname>targetPlatform</varname>; see
458− <varname>stage.nix</varname> or the manual). Actually, those identifiers are
459− purposefully not used here to draw a subtle but important distinction: While
460− the granularity of having 3 platforms is necessary to properly *build*
461− packages, it is overkill for specifying the user's *intent* when making a
462− build plan or package set. A simple "build vs deploy" dichotomy is adequate:
463− the sliding window principle described in the previous section shows how to
464− interpolate between the these two "end points" to get the 3 platform triple
465− for each bootstrapping stage. That means for any package a given package
466− set, even those not bound on the top level but only reachable via
467− dependencies or <varname>buildPackages</varname>, the three platforms will
468− be defined as one of <varname>localSystem</varname> or
469− <varname>crossSystem</varname>, with the former replacing the latter as one
470− traverses build-time dependencies. A last simple difference is that
471− <varname>crossSystem</varname> should be null when one doesn't want to
472− cross-compile, while the <varname>*Platform</varname>s are always non-null.
473− <varname>localSystem</varname> is always non-null.
297+ One would think that <varname>localSystem</varname> and <varname>crossSystem</varname> overlap horribly with the three <varname>*Platforms</varname> (<varname>buildPlatform</varname>, <varname>hostPlatform,</varname> and <varname>targetPlatform</varname>; see <varname>stage.nix</varname> or the manual). Actually, those identifiers are purposefully not used here to draw a subtle but important distinction: While the granularity of having 3 platforms is necessary to properly *build* packages, it is overkill for specifying the user's *intent* when making a build plan or package set. A simple "build vs deploy" dichotomy is adequate: the sliding window principle described in the previous section shows how to interpolate between the these two "end points" to get the 3 platform triple for each bootstrapping stage. That means for any package a given package set, even those not bound on the top level but only reachable via dependencies or <varname>buildPackages</varname>, the three platforms will be defined as one of <varname>localSystem</varname> or <varname>crossSystem</varname>, with the former replacing the latter as one traverses build-time dependencies. A last simple difference is that <varname>crossSystem</varname> should be null when one doesn't want to cross-compile, while the <varname>*Platform</varname>s are always non-null. <varname>localSystem</varname> is always non-null.
474298 </para>
475299 </section>
476300<!--============================================================-->
@@ -481,61 +305,20 @@ nix-build &lt;nixpkgs&gt; --arg crossSystem '{ config = "&lt;arch&gt;-&lt;os&gt;
481305 <title>Implementation of dependencies</title>
482306
483307 <para>
484− The categorizes of dependencies developed in
485− <xref
486− linkend="ssec-cross-dependency-categorization"/> are specified as
487− lists of derivations given to <varname>mkDerivation</varname>, as
488− documented in <xref linkend="ssec-stdenv-dependencies"/>. In short, each
489− list of dependencies for "host → target" of "foo → bar" is called
490− <varname>depsFooBar</varname>, with exceptions for backwards compatibility
491− that <varname>depsBuildHost</varname> is instead called
492− <varname>nativeBuildInputs</varname> and <varname>depsHostTarget</varname>
493− is instead called <varname>buildInputs</varname>. Nixpkgs is now structured
494− so that each <varname>depsFooBar</varname> is automatically taken from
495− <varname>pkgsFooBar</varname>. (These <varname>pkgsFooBar</varname>s are
496− quite new, so there is no special case for
497− <varname>nativeBuildInputs</varname> and <varname>buildInputs</varname>.)
498− For example, <varname>pkgsBuildHost.gcc</varname> should be used at
499− build-time, while <varname>pkgsHostTarget.gcc</varname> should be used at
500− run-time.
308+ The categorizes of dependencies developed in <xref
309+ linkend="ssec-cross-dependency-categorization"/> are specified as lists of derivations given to <varname>mkDerivation</varname>, as documented in <xref linkend="ssec-stdenv-dependencies"/>. In short, each list of dependencies for "host → target" of "foo → bar" is called <varname>depsFooBar</varname>, with exceptions for backwards compatibility that <varname>depsBuildHost</varname> is instead called <varname>nativeBuildInputs</varname> and <varname>depsHostTarget</varname> is instead called <varname>buildInputs</varname>. Nixpkgs is now structured so that each <varname>depsFooBar</varname> is automatically taken from <varname>pkgsFooBar</varname>. (These <varname>pkgsFooBar</varname>s are quite new, so there is no special case for <varname>nativeBuildInputs</varname> and <varname>buildInputs</varname>.) For example, <varname>pkgsBuildHost.gcc</varname> should be used at build-time, while <varname>pkgsHostTarget.gcc</varname> should be used at run-time.
501310 </para>
502311
503312 <para>
504− Now, for most of Nixpkgs's history, there were no
505− <varname>pkgsFooBar</varname> attributes, and most packages have not been
506− refactored to use it explicitly. Prior to those, there were just
507− <varname>buildPackages</varname>, <varname>pkgs</varname>, and
508− <varname>targetPackages</varname>. Those are now redefined as aliases to
509− <varname>pkgsBuildHost</varname>, <varname>pkgsHostTarget</varname>, and
510− <varname>pkgsTargetTarget</varname>. It is acceptable, even recommended, to
511− use them for libraries to show that the host platform is irrelevant.
313+ Now, for most of Nixpkgs's history, there were no <varname>pkgsFooBar</varname> attributes, and most packages have not been refactored to use it explicitly. Prior to those, there were just <varname>buildPackages</varname>, <varname>pkgs</varname>, and <varname>targetPackages</varname>. Those are now redefined as aliases to <varname>pkgsBuildHost</varname>, <varname>pkgsHostTarget</varname>, and <varname>pkgsTargetTarget</varname>. It is acceptable, even recommended, to use them for libraries to show that the host platform is irrelevant.
512314 </para>
513315
514316 <para>
515− But before that, there was just <varname>pkgs</varname>, even though both
516− <varname>buildInputs</varname> and <varname>nativeBuildInputs</varname>
517− existed. [Cross barely worked, and those were implemented with some hacks
518− on <varname>mkDerivation</varname> to override dependencies.] What this
519− means is the vast majority of packages do not use any explicit package set
520− to populate their dependencies, just using whatever
521− <varname>callPackage</varname> gives them even if they do correctly sort
522− their dependencies into the multiple lists described above. And indeed,
523− asking that users both sort their dependencies, <emphasis>and</emphasis>
524− take them from the right attribute set, is both too onerous and redundant,
525− so the recommended approach (for now) is to continue just categorizing by
526− list and not using an explicit package set.
317+ But before that, there was just <varname>pkgs</varname>, even though both <varname>buildInputs</varname> and <varname>nativeBuildInputs</varname> existed. [Cross barely worked, and those were implemented with some hacks on <varname>mkDerivation</varname> to override dependencies.] What this means is the vast majority of packages do not use any explicit package set to populate their dependencies, just using whatever <varname>callPackage</varname> gives them even if they do correctly sort their dependencies into the multiple lists described above. And indeed, asking that users both sort their dependencies, <emphasis>and</emphasis> take them from the right attribute set, is both too onerous and redundant, so the recommended approach (for now) is to continue just categorizing by list and not using an explicit package set.
527318 </para>
528319
529320 <para>
530− To make this work, we "splice" together the six
531− <varname>pkgsFooBar</varname> package sets and have
532− <varname>callPackage</varname> actually take its arguments from that. This
533− is currently implemented in <filename>pkgs/top-level/splice.nix</filename>.
534− <varname>mkDerivation</varname> then, for each dependency attribute, pulls
535− the right derivation out from the splice. This splicing can be skipped when
536− not cross-compiling as the package sets are the same, but still is a bit
537− slow for cross-compiling. We'd like to do something better, but haven't
538− come up with anything yet.
321+ To make this work, we "splice" together the six <varname>pkgsFooBar</varname> package sets and have <varname>callPackage</varname> actually take its arguments from that. This is currently implemented in <filename>pkgs/top-level/splice.nix</filename>. <varname>mkDerivation</varname> then, for each dependency attribute, pulls the right derivation out from the splice. This splicing can be skipped when not cross-compiling as the package sets are the same, but still is a bit slow for cross-compiling. We'd like to do something better, but haven't come up with anything yet.
539322 </para>
540323 </section>
541324
@@ -543,21 +326,11 @@ nix-build &lt;nixpkgs&gt; --arg crossSystem '{ config = "&lt;arch&gt;-&lt;os&gt;
543326 <title>Bootstrapping</title>
544327
545328 <para>
546− Each of the package sets described above come from a single bootstrapping
547− stage. While <filename>pkgs/top-level/default.nix</filename>, coordinates
548− the composition of stages at a high level,
549− <filename>pkgs/top-level/stage.nix</filename> "ties the knot" (creates the
550− fixed point) of each stage. The package sets are defined per-stage however,
551− so they can be thought of as edges between stages (the nodes) in a graph.
552− Compositions like <literal>pkgsBuildTarget.targetPackages</literal> can be
553− thought of as paths to this graph.
329+ Each of the package sets described above come from a single bootstrapping stage. While <filename>pkgs/top-level/default.nix</filename>, coordinates the composition of stages at a high level, <filename>pkgs/top-level/stage.nix</filename> "ties the knot" (creates the fixed point) of each stage. The package sets are defined per-stage however, so they can be thought of as edges between stages (the nodes) in a graph. Compositions like <literal>pkgsBuildTarget.targetPackages</literal> can be thought of as paths to this graph.
554330 </para>
555331
556332 <para>
557− While there are many package sets, and thus many edges, the stages can also
558− be arranged in a linear chain. In other words, many of the edges are
559− redundant as far as connectivity is concerned. This hinges on the type of
560− bootstrapping we do. Currently for cross it is:
333+ While there are many package sets, and thus many edges, the stages can also be arranged in a linear chain. In other words, many of the edges are redundant as far as connectivity is concerned. This hinges on the type of bootstrapping we do. Currently for cross it is:
561334 <orderedlist>
562335 <listitem>
563336 <para>
@@ -575,102 +348,45 @@ nix-build &lt;nixpkgs&gt; --arg crossSystem '{ config = "&lt;arch&gt;-&lt;os&gt;
575348 </para>
576349 </listitem>
577350 </orderedlist>
578− In each stage, <varname>pkgsBuildHost</varname> refers the the previous
579− stage, <varname>pkgsBuildBuild</varname> refers to the one before that, and
580− <varname>pkgsHostTarget</varname> refers to the current one, and
581− <varname>pkgsTargetTarget</varname> refers to the next one. When there is
582− no previous or next stage, they instead refer to the current stage. Note
583− how all the invariants regarding the mapping between dependency and
584− depending packages' build host and target platforms are preserved.
585− <varname>pkgsBuildTarget</varname> and <varname>pkgsHostHost</varname> are
586− more complex in that the stage fitting the requirements isn't always a
587− fixed chain of "prevs" and "nexts" away (modulo the "saturating"
588− self-references at the ends). We just special case each instead. All the
589− primary edges are implemented is in
590− <filename>pkgs/stdenv/booter.nix</filename>, and secondarily aliases in
591− <filename>pkgs/top-level/stage.nix</filename>.
351+ In each stage, <varname>pkgsBuildHost</varname> refers the the previous stage, <varname>pkgsBuildBuild</varname> refers to the one before that, and <varname>pkgsHostTarget</varname> refers to the current one, and <varname>pkgsTargetTarget</varname> refers to the next one. When there is no previous or next stage, they instead refer to the current stage. Note how all the invariants regarding the mapping between dependency and depending packages' build host and target platforms are preserved. <varname>pkgsBuildTarget</varname> and <varname>pkgsHostHost</varname> are more complex in that the stage fitting the requirements isn't always a fixed chain of "prevs" and "nexts" away (modulo the "saturating" self-references at the ends). We just special case each instead. All the primary edges are implemented is in <filename>pkgs/stdenv/booter.nix</filename>, and secondarily aliases in <filename>pkgs/top-level/stage.nix</filename>.
592352 </para>
593353
594354 <note>
595355 <para>
596− Note the native stages are bootstrapped in legacy ways that predate the
597− current cross implementation. This is why the the bootstrapping stages
598− leading up to the final stages are ignored inthe previous paragraph.
356+ Note the native stages are bootstrapped in legacy ways that predate the current cross implementation. This is why the the bootstrapping stages leading up to the final stages are ignored inthe previous paragraph.
599357 </para>
600358 </note>
601359
602360 <para>
603− If one looks at the 3 platform triples, one can see that they overlap such
604− that one could put them together into a chain like:
361+ If one looks at the 3 platform triples, one can see that they overlap such that one could put them together into a chain like:
605362<programlisting>
606363(native, native, native, foreign, foreign)
607364</programlisting>
608− If one imagines the saturating self references at the end being replaced
609− with infinite stages, and then overlays those platform triples, one ends up
610− with the infinite tuple:
365+ If one imagines the saturating self references at the end being replaced with infinite stages, and then overlays those platform triples, one ends up with the infinite tuple:
611366<programlisting>
612367(native..., native, native, native, foreign, foreign, foreign...)
613368</programlisting>
614− On can then imagine any sequence of platforms such that there are bootstrap
615− stages with their 3 platforms determined by "sliding a window" that is the
616− 3 tuple through the sequence. This was the original model for
617− bootstrapping. Without a target platform (assume a better world where all
618− compilers are multi-target and all standard libraries are built in their
619− own derivation), this is sufficient. Conversely if one wishes to cross
620− compile "faster", with a "Canadian Cross" bootstraping stage where
621− <literal>build != host != target</literal>, more bootstrapping stages are
622− needed since no sliding window providess the pesky
623− <varname>pkgsBuildTarget</varname> package set since it skips the Canadian
624− cross stage's "host".
369+ On can then imagine any sequence of platforms such that there are bootstrap stages with their 3 platforms determined by "sliding a window" that is the 3 tuple through the sequence. This was the original model for bootstrapping. Without a target platform (assume a better world where all compilers are multi-target and all standard libraries are built in their own derivation), this is sufficient. Conversely if one wishes to cross compile "faster", with a "Canadian Cross" bootstraping stage where <literal>build != host != target</literal>, more bootstrapping stages are needed since no sliding window providess the pesky <varname>pkgsBuildTarget</varname> package set since it skips the Canadian cross stage's "host".
625370 </para>
626371
627372 <note>
628373 <para>
629− It is much better to refer to <varname>buildPackages</varname> than
630− <varname>targetPackages</varname>, or more broadly package sets that do
631− not mention "target". There are three reasons for this.
374+ It is much better to refer to <varname>buildPackages</varname> than <varname>targetPackages</varname>, or more broadly package sets that do not mention "target". There are three reasons for this.
632375 </para>
633376 <para>
634− First, it is because bootstrapping stages do not have a unique
635− <varname>targetPackages</varname>. For example a <literal>(x86-linux,
636− x86-linux, arm-linux)</literal> and <literal>(x86-linux, x86-linux,
637− x86-windows)</literal> package set both have a <literal>(x86-linux,
638− x86-linux, x86-linux)</literal> package set. Because there is no canonical
639− <varname>targetPackages</varname> for such a native (<literal>build ==
640− host == target</literal>) package set, we set their
641− <varname>targetPackages</varname>
377+ First, it is because bootstrapping stages do not have a unique <varname>targetPackages</varname>. For example a <literal>(x86-linux, x86-linux, arm-linux)</literal> and <literal>(x86-linux, x86-linux, x86-windows)</literal> package set both have a <literal>(x86-linux, x86-linux, x86-linux)</literal> package set. Because there is no canonical <varname>targetPackages</varname> for such a native (<literal>build == host == target</literal>) package set, we set their <varname>targetPackages</varname>
642378 </para>
643379 <para>
644− Second, it is because this is a frequent source of hard-to-follow
645− "infinite recursions" / cycles. When only package sets that don't mention
646− target are used, the package set forms a directed acyclic graph. This
647− means that all cycles that exist are confined to one stage. This means
648− they are a lot smaller, and easier to follow in the code or a backtrace.
649− It also means they are present in native and cross builds alike, and so
650− more likely to be caught by CI and other users.
380+ Second, it is because this is a frequent source of hard-to-follow "infinite recursions" / cycles. When only package sets that don't mention target are used, the package set forms a directed acyclic graph. This means that all cycles that exist are confined to one stage. This means they are a lot smaller, and easier to follow in the code or a backtrace. It also means they are present in native and cross builds alike, and so more likely to be caught by CI and other users.
651381 </para>
652382 <para>
653− Thirdly, it is because everything target-mentioning only exists to
654− accommodate compilers with lousy build systems that insist on the compiler
655− itself and standard library being built together. Of course that is bad
656− because bigger derivations means longer rebuilds. It is also problematic
657− because it tends to make the standard libraries less like other libraries
658− than they could be, complicating code and build systems alike. Because of
659− the other problems, and because of these innate disadvantages, compilers
660− ought to be packaged another way where possible.
383+ Thirdly, it is because everything target-mentioning only exists to accommodate compilers with lousy build systems that insist on the compiler itself and standard library being built together. Of course that is bad because bigger derivations means longer rebuilds. It is also problematic because it tends to make the standard libraries less like other libraries than they could be, complicating code and build systems alike. Because of the other problems, and because of these innate disadvantages, compilers ought to be packaged another way where possible.
661384 </para>
662385 </note>
663386
664387 <note>
665388 <para>
666− If one explores Nixpkgs, they will see derivations with names like
667− <literal>gccCross</literal>. Such <literal>*Cross</literal> derivations is
668− a holdover from before we properly distinguished between the host and
669− target platforms—the derivation with "Cross" in the name covered the
670− <literal>build = host != target</literal> case, while the other covered
671− the <literal>host = target</literal>, with build platform the same or not
672− based on whether one was using its <literal>.nativeDrv</literal> or
673− <literal>.crossDrv</literal>. This ugliness will disappear soon.
389+ If one explores Nixpkgs, they will see derivations with names like <literal>gccCross</literal>. Such <literal>*Cross</literal> derivations is a holdover from before we properly distinguished between the host and target platforms—the derivation with "Cross" in the name covered the <literal>build = host != target</literal> case, while the other covered the <literal>host = target</literal>, with build platform the same or not based on whether one was using its <literal>.nativeDrv</literal> or <literal>.crossDrv</literal>. This ugliness will disappear soon.
674390 </para>
675391 </note>
676392 </section>
doc/functions.xml+1−2
@@ -4,8 +4,7 @@
44 xml:id="chap-functions">
55 <title>Functions reference</title>
66 <para>
7− The nixpkgs repository has several utility functions to manipulate Nix
8− expressions.
7+ The nixpkgs repository has several utility functions to manipulate Nix expressions.
98 </para>
109 <xi:include href="functions/library.xml" />
1110 <xi:include href="functions/overrides.xml" />
doc/functions/appimagetools.xml+8−24
@@ -5,17 +5,12 @@
55 <title>pkgs.appimageTools</title>
66
77 <para>
8− <varname>pkgs.appimageTools</varname> is a set of functions for extracting
9− and wrapping <link xlink:href="https://appimage.org/">AppImage</link> files.
10− They are meant to be used if traditional packaging from source is infeasible,
11− or it would take too long. To quickly run an AppImage file,
12− <literal>pkgs.appimage-run</literal> can be used as well.
8+ <varname>pkgs.appimageTools</varname> is a set of functions for extracting and wrapping <link xlink:href="https://appimage.org/">AppImage</link> files. They are meant to be used if traditional packaging from source is infeasible, or it would take too long. To quickly run an AppImage file, <literal>pkgs.appimage-run</literal> can be used as well.
139 </para>
1410
1511 <warning>
1612 <para>
17− The <varname>appimageTools</varname> API is unstable and may be subject to
18− backwards-incompatible changes in the future.
13+ The <varname>appimageTools</varname> API is unstable and may be subject to backwards-incompatible changes in the future.
1914 </para>
2015 </warning>
2116
@@ -23,9 +18,7 @@
2318 <title>AppImage formats</title>
2419
2520 <para>
26− There are different formats for AppImages, see
27− <link xlink:href="https://github.com/AppImage/AppImageSpec/blob/74ad9ca2f94bf864a4a0dac1f369dd4f00bd1c28/draft.md#image-format">the
28− specification</link> for details.
21+ There are different formats for AppImages, see <link xlink:href="https://github.com/AppImage/AppImageSpec/blob/74ad9ca2f94bf864a4a0dac1f369dd4f00bd1c28/draft.md#image-format">the specification</link> for details.
2922 </para>
3023
3124 <itemizedlist>
@@ -55,8 +48,7 @@ type2.AppImage: ELF 64-bit LSB executable, x86-64, version 1 (SYSV) (Lepton 3.x)
5548</screen>
5649
5750 <para>
58− Note how the type 1 AppImage is described as an <literal>ISO 9660 CD-ROM
59− filesystem</literal>, and the type 2 AppImage is not.
51+ Note how the type 1 AppImage is described as an <literal>ISO 9660 CD-ROM filesystem</literal>, and the type 2 AppImage is not.
6052 </para>
6153 </section>
6254
@@ -64,8 +56,7 @@ type2.AppImage: ELF 64-bit LSB executable, x86-64, version 1 (SYSV) (Lepton 3.x)
6456 <title>Wrapping</title>
6557
6658 <para>
67− Depending on the type of AppImage you're wrapping, you'll have to use
68− <varname>wrapType1</varname> or <varname>wrapType2</varname>.
59+ Depending on the type of AppImage you're wrapping, you'll have to use <varname>wrapType1</varname> or <varname>wrapType2</varname>.
6960 </para>
7061
7162<programlisting>
@@ -91,23 +82,16 @@ appimageTools.wrapType2 { # or wrapType1
9182 </callout>
9283 <callout arearefs='ex-appimageTools-wrapping-2'>
9384 <para>
94− <varname>extraPkgs</varname> allows you to pass a function to include
95− additional packages inside the FHS environment your AppImage is going to
96− run in. There are a few ways to learn which dependencies an application
97− needs:
85+ <varname>extraPkgs</varname> allows you to pass a function to include additional packages inside the FHS environment your AppImage is going to run in. There are a few ways to learn which dependencies an application needs:
9886 <itemizedlist>
9987 <listitem>
10088 <para>
101− Looking through the extracted AppImage files, reading its scripts and
102− running <command>patchelf</command> and <command>ldd</command> on its
103− executables. This can also be done in <command>appimage-run</command>,
104− by setting <command>APPIMAGE_DEBUG_EXEC=bash</command>.
89+ Looking through the extracted AppImage files, reading its scripts and running <command>patchelf</command> and <command>ldd</command> on its executables. This can also be done in <command>appimage-run</command>, by setting <command>APPIMAGE_DEBUG_EXEC=bash</command>.
10590 </para>
10691 </listitem>
10792 <listitem>
10893 <para>
109− Running <command>strace -vfefile</command> on the wrapped executable,
110− looking for libraries that can't be found.
94+ Running <command>strace -vfefile</command> on the wrapped executable, looking for libraries that can't be found.
11195 </para>
11296 </listitem>
11397 </itemizedlist>
doc/functions/debug.xml+2−9
@@ -5,17 +5,10 @@
55 <title>Debugging Nix Expressions</title>
66
77 <para>
8− Nix is a unityped, dynamic language, this means every value can potentially
9− appear anywhere. Since it is also non-strict, evaluation order and what
10− ultimately is evaluated might surprise you. Therefore it is important to be
11− able to debug nix expressions.
8+ Nix is a unityped, dynamic language, this means every value can potentially appear anywhere. Since it is also non-strict, evaluation order and what ultimately is evaluated might surprise you. Therefore it is important to be able to debug nix expressions.
129 </para>
1310
1411 <para>
15− In the <literal>lib/debug.nix</literal> file you will find a number of
16− functions that help (pretty-)printing values while evaluation is runnnig. You
17− can even specify how deep these values should be printed recursively, and
18− transform them on the fly. Please consult the docstrings in
19− <literal>lib/debug.nix</literal> for usage information.
12+ In the <literal>lib/debug.nix</literal> file you will find a number of functions that help (pretty-)printing values while evaluation is runnnig. You can even specify how deep these values should be printed recursively, and transform them on the fly. Please consult the docstrings in <literal>lib/debug.nix</literal> for usage information.
2013 </para>
2114</section>
doc/functions/dockertools.xml+54−170
@@ -5,17 +5,12 @@
55 <title>pkgs.dockerTools</title>
66
77 <para>
8− <varname>pkgs.dockerTools</varname> is a set of functions for creating and
9− manipulating Docker images according to the
10− <link xlink:href="https://github.com/moby/moby/blob/master/image/spec/v1.2.md#docker-image-specification-v120">
11− Docker Image Specification v1.2.0 </link>. Docker itself is not used to
12− perform any of the operations done by these functions.
8+ <varname>pkgs.dockerTools</varname> is a set of functions for creating and manipulating Docker images according to the <link xlink:href="https://github.com/moby/moby/blob/master/image/spec/v1.2.md#docker-image-specification-v120"> Docker Image Specification v1.2.0 </link>. Docker itself is not used to perform any of the operations done by these functions.
139 </para>
1410
1511 <warning>
1612 <para>
17− The <varname>dockerTools</varname> API is unstable and may be subject to
18− backwards-incompatible changes in the future.
13+ The <varname>dockerTools</varname> API is unstable and may be subject to backwards-incompatible changes in the future.
1914 </para>
2015 </warning>
2116
@@ -23,15 +18,11 @@
2318 <title>buildImage</title>
2419
2520 <para>
26− This function is analogous to the <command>docker build</command> command,
27− in that it can be used to build a Docker-compatible repository tarball
28− containing a single image with one or multiple layers. As such, the result
29− is suitable for being loaded in Docker with <command>docker load</command>.
21+ This function is analogous to the <command>docker build</command> command, in that it can be used to build a Docker-compatible repository tarball containing a single image with one or multiple layers. As such, the result is suitable for being loaded in Docker with <command>docker load</command>.
3022 </para>
3123
3224 <para>
33− The parameters of <varname>buildImage</varname> with relative example values
34− are described below:
25+ The parameters of <varname>buildImage</varname> with relative example values are described below:
3526 </para>
3627
3728 <example xml:id='ex-dockerTools-buildImage'>
@@ -63,135 +54,89 @@ buildImage {
6354 </example>
6455
6556 <para>
66− The above example will build a Docker image <literal>redis/latest</literal>
67− from the given base image. Loading and running this image in Docker results
68− in <literal>redis-server</literal> being started automatically.
57+ The above example will build a Docker image <literal>redis/latest</literal> from the given base image. Loading and running this image in Docker results in <literal>redis-server</literal> being started automatically.
6958 </para>
7059
7160 <calloutlist>
7261 <callout arearefs='ex-dockerTools-buildImage-1'>
7362 <para>
74− <varname>name</varname> specifies the name of the resulting image. This is
75− the only required argument for <varname>buildImage</varname>.
63+ <varname>name</varname> specifies the name of the resulting image. This is the only required argument for <varname>buildImage</varname>.
7664 </para>
7765 </callout>
7866 <callout arearefs='ex-dockerTools-buildImage-2'>
7967 <para>
80− <varname>tag</varname> specifies the tag of the resulting image. By
81− default it's <literal>null</literal>, which indicates that the nix output
82− hash will be used as tag.
68+ <varname>tag</varname> specifies the tag of the resulting image. By default it's <literal>null</literal>, which indicates that the nix output hash will be used as tag.
8369 </para>
8470 </callout>
8571 <callout arearefs='ex-dockerTools-buildImage-3'>
8672 <para>
87− <varname>fromImage</varname> is the repository tarball containing the base
88− image. It must be a valid Docker image, such as exported by
89− <command>docker save</command>. By default it's <literal>null</literal>,
90− which can be seen as equivalent to <literal>FROM scratch</literal> of a
91− <filename>Dockerfile</filename>.
73+ <varname>fromImage</varname> is the repository tarball containing the base image. It must be a valid Docker image, such as exported by <command>docker save</command>. By default it's <literal>null</literal>, which can be seen as equivalent to <literal>FROM scratch</literal> of a <filename>Dockerfile</filename>.
9274 </para>
9375 </callout>
9476 <callout arearefs='ex-dockerTools-buildImage-4'>
9577 <para>
96− <varname>fromImageName</varname> can be used to further specify the base
97− image within the repository, in case it contains multiple images. By
98− default it's <literal>null</literal>, in which case
99− <varname>buildImage</varname> will peek the first image available in the
100− repository.
78+ <varname>fromImageName</varname> can be used to further specify the base image within the repository, in case it contains multiple images. By default it's <literal>null</literal>, in which case <varname>buildImage</varname> will peek the first image available in the repository.
10179 </para>
10280 </callout>
10381 <callout arearefs='ex-dockerTools-buildImage-5'>
10482 <para>
105− <varname>fromImageTag</varname> can be used to further specify the tag of
106− the base image within the repository, in case an image contains multiple
107− tags. By default it's <literal>null</literal>, in which case
108− <varname>buildImage</varname> will peek the first tag available for the
109− base image.
83+ <varname>fromImageTag</varname> can be used to further specify the tag of the base image within the repository, in case an image contains multiple tags. By default it's <literal>null</literal>, in which case <varname>buildImage</varname> will peek the first tag available for the base image.
11084 </para>
11185 </callout>
11286 <callout arearefs='ex-dockerTools-buildImage-6'>
11387 <para>
114− <varname>contents</varname> is a derivation that will be copied in the new
115− layer of the resulting image. This can be similarly seen as <command>ADD
116− contents/ /</command> in a <filename>Dockerfile</filename>. By default
117− it's <literal>null</literal>.
88+ <varname>contents</varname> is a derivation that will be copied in the new layer of the resulting image. This can be similarly seen as <command>ADD contents/ /</command> in a <filename>Dockerfile</filename>. By default it's <literal>null</literal>.
11889 </para>
11990 </callout>
12091 <callout arearefs='ex-dockerTools-buildImage-runAsRoot'>
12192 <para>
122− <varname>runAsRoot</varname> is a bash script that will run as root in an
123− environment that overlays the existing layers of the base image with the
124− new resulting layer, including the previously copied
125− <varname>contents</varname> derivation. This can be similarly seen as
126− <command>RUN ...</command> in a <filename>Dockerfile</filename>.
93+ <varname>runAsRoot</varname> is a bash script that will run as root in an environment that overlays the existing layers of the base image with the new resulting layer, including the previously copied <varname>contents</varname> derivation. This can be similarly seen as <command>RUN ...</command> in a <filename>Dockerfile</filename>.
12794 <note>
12895 <para>
129− Using this parameter requires the <literal>kvm</literal> device to be
130− available.
96+ Using this parameter requires the <literal>kvm</literal> device to be available.
13197 </para>
13298 </note>
13399 </para>
134100 </callout>
135101 <callout arearefs='ex-dockerTools-buildImage-8'>
136102 <para>
137− <varname>config</varname> is used to specify the configuration of the
138− containers that will be started off the built image in Docker. The
139− available options are listed in the
140− <link xlink:href="https://github.com/moby/moby/blob/master/image/spec/v1.2.md#image-json-field-descriptions">
141− Docker Image Specification v1.2.0 </link>.
103+ <varname>config</varname> is used to specify the configuration of the containers that will be started off the built image in Docker. The available options are listed in the <link xlink:href="https://github.com/moby/moby/blob/master/image/spec/v1.2.md#image-json-field-descriptions"> Docker Image Specification v1.2.0 </link>.
142104 </para>
143105 </callout>
144106 </calloutlist>
145107
146108 <para>
147− After the new layer has been created, its closure (to which
148− <varname>contents</varname>, <varname>config</varname> and
149− <varname>runAsRoot</varname> contribute) will be copied in the layer itself.
150− Only new dependencies that are not already in the existing layers will be
151− copied.
109+ After the new layer has been created, its closure (to which <varname>contents</varname>, <varname>config</varname> and <varname>runAsRoot</varname> contribute) will be copied in the layer itself. Only new dependencies that are not already in the existing layers will be copied.
152110 </para>
153111
154112 <para>
155− At the end of the process, only one new single layer will be produced and
156− added to the resulting image.
113+ At the end of the process, only one new single layer will be produced and added to the resulting image.
157114 </para>
158115
159116 <para>
160− The resulting repository will only list the single image
161− <varname>image/tag</varname>. In the case of
162− <xref linkend='ex-dockerTools-buildImage'/> it would be
163− <varname>redis/latest</varname>.
117+ The resulting repository will only list the single image <varname>image/tag</varname>. In the case of <xref linkend='ex-dockerTools-buildImage'/> it would be <varname>redis/latest</varname>.
164118 </para>
165119
166120 <para>
167− It is possible to inspect the arguments with which an image was built using
168− its <varname>buildArgs</varname> attribute.
121+ It is possible to inspect the arguments with which an image was built using its <varname>buildArgs</varname> attribute.
169122 </para>
170123
171124 <note>
172125 <para>
173− If you see errors similar to <literal>getProtocolByName: does not exist (no
174− such protocol name: tcp)</literal> you may need to add
175− <literal>pkgs.iana-etc</literal> to <varname>contents</varname>.
126+ If you see errors similar to <literal>getProtocolByName: does not exist (no such protocol name: tcp)</literal> you may need to add <literal>pkgs.iana-etc</literal> to <varname>contents</varname>.
176127 </para>
177128 </note>
178129
179130 <note>
180131 <para>
181− If you see errors similar to <literal>Error_Protocol ("certificate has
182− unknown CA",True,UnknownCa)</literal> you may need to add
183− <literal>pkgs.cacert</literal> to <varname>contents</varname>.
132+ If you see errors similar to <literal>Error_Protocol ("certificate has unknown CA",True,UnknownCa)</literal> you may need to add <literal>pkgs.cacert</literal> to <varname>contents</varname>.
184133 </para>
185134 </note>
186135
187136 <example xml:id="example-pkgs-dockerTools-buildImage-creation-date">
188137 <title>Impurely Defining a Docker Layer's Creation Date</title>
189138 <para>
190− By default <function>buildImage</function> will use a static date of one
191− second past the UNIX Epoch. This allows <function>buildImage</function> to
192− produce binary reproducible images. When listing images with
193− <command>docker images</command>, the newly created images will be listed
194− like this:
139+ By default <function>buildImage</function> will use a static date of one second past the UNIX Epoch. This allows <function>buildImage</function> to produce binary reproducible images. When listing images with <command>docker images</command>, the newly created images will be listed like this:
195140 </para>
196141<screen><![CDATA[
197142$ docker images
@@ -199,9 +144,7 @@ REPOSITORY TAG IMAGE ID CREATED SIZE
199144hello latest 08c791c7846e 48 years ago 25.2MB
200145]]></screen>
201146 <para>
202− You can break binary reproducibility but have a sorted, meaningful
203− <literal>CREATED</literal> column by setting <literal>created</literal> to
204− <literal>now</literal>.
147+ You can break binary reproducibility but have a sorted, meaningful <literal>CREATED</literal> column by setting <literal>created</literal> to <literal>now</literal>.
205148 </para>
206149<programlisting><![CDATA[
207150pkgs.dockerTools.buildImage {
@@ -214,8 +157,7 @@ pkgs.dockerTools.buildImage {
214157}
215158]]></programlisting>
216159 <para>
217− and now the Docker CLI will display a reasonable date and sort the images
218− as expected:
160+ and now the Docker CLI will display a reasonable date and sort the images as expected:
219161<screen><![CDATA[
220162$ docker images
221163REPOSITORY TAG IMAGE ID CREATED SIZE
@@ -230,8 +172,7 @@ hello latest de2bf4786de6 About a minute ago 25.2MB
230172 <title>buildLayeredImage</title>
231173
232174 <para>
233− Create a Docker image with many of the store paths being on their own layer
234− to improve sharing between images.
175+ Create a Docker image with many of the store paths being on their own layer to improve sharing between images.
235176 </para>
236177
237178 <variablelist>
@@ -264,8 +205,7 @@ hello latest de2bf4786de6 About a minute ago 25.2MB
264205 </term>
265206 <listitem>
266207 <para>
267− Top level paths in the container. Either a single derivation, or a list
268− of derivations.
208+ Top level paths in the container. Either a single derivation, or a list of derivations.
269209 </para>
270210 <para>
271211 <emphasis>Default:</emphasis> <literal>[]</literal>
@@ -278,10 +218,7 @@ hello latest de2bf4786de6 About a minute ago 25.2MB
278218 </term>
279219 <listitem>
280220 <para>
281− Run-time configuration of the container. A full list of the options are
282− available at in the
283− <link xlink:href="https://github.com/moby/moby/blob/master/image/spec/v1.2.md#image-json-field-descriptions">
284− Docker Image Specification v1.2.0 </link>.
221+ Run-time configuration of the container. A full list of the options are available at in the <link xlink:href="https://github.com/moby/moby/blob/master/image/spec/v1.2.md#image-json-field-descriptions"> Docker Image Specification v1.2.0 </link>.
285222 </para>
286223 <para>
287224 <emphasis>Default:</emphasis> <literal>{}</literal>
@@ -294,9 +231,7 @@ hello latest de2bf4786de6 About a minute ago 25.2MB
294231 </term>
295232 <listitem>
296233 <para>
297− Date and time the layers were created. Follows the same
298− <literal>now</literal> exception supported by
299− <literal>buildImage</literal>.
234+ Date and time the layers were created. Follows the same <literal>now</literal> exception supported by <literal>buildImage</literal>.
300235 </para>
301236 <para>
302237 <emphasis>Default:</emphasis> <literal>1970-01-01T00:00:01Z</literal>
@@ -325,9 +260,7 @@ hello latest de2bf4786de6 About a minute ago 25.2MB
325260 </term>
326261 <listitem>
327262 <para>
328− Shell commands to run while building the final layer, without access to
329− most of the layer contents. Changes to this layer are "on top" of all the
330− other layers, so can create additional directories and files.
263+ Shell commands to run while building the final layer, without access to most of the layer contents. Changes to this layer are "on top" of all the other layers, so can create additional directories and files.
331264 </para>
332265 </listitem>
333266 </varlistentry>
@@ -337,8 +270,7 @@ hello latest de2bf4786de6 About a minute ago 25.2MB
337270 <title>Behavior of <varname>contents</varname> in the final image</title>
338271
339272 <para>
340− Each path directly listed in <varname>contents</varname> will have a
341− symlink in the root of the image.
273+ Each path directly listed in <varname>contents</varname> will have a symlink in the root of the image.
342274 </para>
343275
344276 <para>
@@ -349,8 +281,7 @@ pkgs.dockerTools.buildLayeredImage {
349281 contents = [ pkgs.hello ];
350282}
351283]]></programlisting>
352− will create symlinks for all the paths in the <literal>hello</literal>
353− package:
284+ will create symlinks for all the paths in the <literal>hello</literal> package:
354285<screen><![CDATA[
355286/bin/hello -> /nix/store/h1zb1padqbbb7jicsvkmrym3r6snphxg-hello-2.10/bin/hello
356287/share/info/hello.info -> /nix/store/h1zb1padqbbb7jicsvkmrym3r6snphxg-hello-2.10/share/info/hello.info
@@ -363,13 +294,11 @@ pkgs.dockerTools.buildLayeredImage {
363294 <title>Automatic inclusion of <varname>config</varname> references</title>
364295
365296 <para>
366− The closure of <varname>config</varname> is automatically included in the
367− closure of the final image.
297+ The closure of <varname>config</varname> is automatically included in the closure of the final image.
368298 </para>
369299
370300 <para>
371− This allows you to make very simple Docker images with very little code.
372− This container will start up and run <command>hello</command>:
301+ This allows you to make very simple Docker images with very little code. This container will start up and run <command>hello</command>:
373302<programlisting><![CDATA[
374303pkgs.dockerTools.buildLayeredImage {
375304 name = "hello";
@@ -383,31 +312,23 @@ pkgs.dockerTools.buildLayeredImage {
383312 <title>Adjusting <varname>maxLayers</varname></title>
384313
385314 <para>
386− Increasing the <varname>maxLayers</varname> increases the number of layers
387− which have a chance to be shared between different images.
315+ Increasing the <varname>maxLayers</varname> increases the number of layers which have a chance to be shared between different images.
388316 </para>
389317
390318 <para>
391− Modern Docker installations support up to 128 layers, however older
392− versions support as few as 42.
319+ Modern Docker installations support up to 128 layers, however older versions support as few as 42.
393320 </para>
394321
395322 <para>
396− If the produced image will not be extended by other Docker builds, it is
397− safe to set <varname>maxLayers</varname> to <literal>128</literal>. However
398− it will be impossible to extend the image further.
323+ If the produced image will not be extended by other Docker builds, it is safe to set <varname>maxLayers</varname> to <literal>128</literal>. However it will be impossible to extend the image further.
399324 </para>
400325
401326 <para>
402− The first (<literal>maxLayers-2</literal>) most "popular" paths will have
403− their own individual layers, then layer #<literal>maxLayers-1</literal>
404− will contain all the remaining "unpopular" paths, and finally layer
405− #<literal>maxLayers</literal> will contain the Image configuration.
327+ The first (<literal>maxLayers-2</literal>) most "popular" paths will have their own individual layers, then layer #<literal>maxLayers-1</literal> will contain all the remaining "unpopular" paths, and finally layer #<literal>maxLayers</literal> will contain the Image configuration.
406328 </para>
407329
408330 <para>
409− Docker's Layers are not inherently ordered, they are content-addressable
410− and are not explicitly layered until they are composed in to an Image.
331+ Docker's Layers are not inherently ordered, they are content-addressable and are not explicitly layered until they are composed in to an Image.
411332 </para>
412333 </section>
413334 </section>
@@ -416,10 +337,7 @@ pkgs.dockerTools.buildLayeredImage {
416337 <title>pullImage</title>
417338
418339 <para>
419− This function is analogous to the <command>docker pull</command> command, in
420− that it can be used to pull a Docker image from a Docker registry. By
421− default <link xlink:href="https://hub.docker.com/">Docker Hub</link> is used
422− to pull images.
340+ This function is analogous to the <command>docker pull</command> command, in that it can be used to pull a Docker image from a Docker registry. By default <link xlink:href="https://hub.docker.com/">Docker Hub</link> is used to pull images.
423341 </para>
424342
425343 <para>
@@ -444,71 +362,51 @@ pullImage {
444362 <calloutlist>
445363 <callout arearefs='ex-dockerTools-pullImage-1'>
446364 <para>
447− <varname>imageName</varname> specifies the name of the image to be
448− downloaded, which can also include the registry namespace (e.g.
449− <literal>nixos</literal>). This argument is required.
365+ <varname>imageName</varname> specifies the name of the image to be downloaded, which can also include the registry namespace (e.g. <literal>nixos</literal>). This argument is required.
450366 </para>
451367 </callout>
452368 <callout arearefs='ex-dockerTools-pullImage-2'>
453369 <para>
454− <varname>imageDigest</varname> specifies the digest of the image to be
455− downloaded. This argument is required.
370+ <varname>imageDigest</varname> specifies the digest of the image to be downloaded. This argument is required.
456371 </para>
457372 </callout>
458373 <callout arearefs='ex-dockerTools-pullImage-3'>
459374 <para>
460− <varname>finalImageName</varname>, if specified, this is the name of the
461− image to be created. Note it is never used to fetch the image since we
462− prefer to rely on the immutable digest ID. By default it's equal to
463− <varname>imageName</varname>.
375+ <varname>finalImageName</varname>, if specified, this is the name of the image to be created. Note it is never used to fetch the image since we prefer to rely on the immutable digest ID. By default it's equal to <varname>imageName</varname>.
464376 </para>
465377 </callout>
466378 <callout arearefs='ex-dockerTools-pullImage-4'>
467379 <para>
468− <varname>finalImageTag</varname>, if specified, this is the tag of the
469− image to be created. Note it is never used to fetch the image since we
470− prefer to rely on the immutable digest ID. By default it's
471− <literal>latest</literal>.
380+ <varname>finalImageTag</varname>, if specified, this is the tag of the image to be created. Note it is never used to fetch the image since we prefer to rely on the immutable digest ID. By default it's <literal>latest</literal>.
472381 </para>
473382 </callout>
474383 <callout arearefs='ex-dockerTools-pullImage-5'>
475384 <para>
476− <varname>sha256</varname> is the checksum of the whole fetched image. This
477− argument is required.
385+ <varname>sha256</varname> is the checksum of the whole fetched image. This argument is required.
478386 </para>
479387 </callout>
480388 <callout arearefs='ex-dockerTools-pullImage-6'>
481389 <para>
482− <varname>os</varname>, if specified, is the operating system of the
483− fetched image. By default it's <literal>linux</literal>.
390+ <varname>os</varname>, if specified, is the operating system of the fetched image. By default it's <literal>linux</literal>.
484391 </para>
485392 </callout>
486393 <callout arearefs='ex-dockerTools-pullImage-7'>
487394 <para>
488− <varname>arch</varname>, if specified, is the cpu architecture of the
489− fetched image. By default it's <literal>x86_64</literal>.
395+ <varname>arch</varname>, if specified, is the cpu architecture of the fetched image. By default it's <literal>x86_64</literal>.
490396 </para>
491397 </callout>
492398 </calloutlist>
493399
494400 <para>
495− <literal>nix-prefetch-docker</literal> command can be used to get required
496− image parameters:
401+ <literal>nix-prefetch-docker</literal> command can be used to get required image parameters:
497402<screen>
498403<prompt>$ </prompt>nix run nixpkgs.nix-prefetch-docker -c nix-prefetch-docker --image-name mysql --image-tag 5
499404</screen>
500− Since a given <varname>imageName</varname> may transparently refer to a
501− manifest list of images which support multiple architectures and/or
502− operating systems, you can supply the <option>--os</option> and
503− <option>--arch</option> arguments to specify exactly which image you want.
504− By default it will match the OS and architecture of the host the command is
505− run on.
405+ Since a given <varname>imageName</varname> may transparently refer to a manifest list of images which support multiple architectures and/or operating systems, you can supply the <option>--os</option> and <option>--arch</option> arguments to specify exactly which image you want. By default it will match the OS and architecture of the host the command is run on.
506406<screen>
507407<prompt>$ </prompt>nix-prefetch-docker --image-name mysql --image-tag 5 --arch x86_64 --os linux
508408</screen>
509− Desired image name and tag can be set using
510− <option>--final-image-name</option> and <option>--final-image-tag</option>
511− arguments:
409+ Desired image name and tag can be set using <option>--final-image-name</option> and <option>--final-image-tag</option> arguments:
512410<screen>
513411<prompt>$ </prompt>nix-prefetch-docker --image-name mysql --image-tag 5 --final-image-name eu.gcr.io/my-project/mysql --final-image-tag prod
514412</screen>
@@ -519,17 +417,12 @@ pullImage {
519417 <title>exportImage</title>
520418
521419 <para>
522− This function is analogous to the <command>docker export</command> command,
523− in that it can be used to flatten a Docker image that contains multiple
524− layers. It is in fact the result of the merge of all the layers of the
525− image. As such, the result is suitable for being imported in Docker with
526− <command>docker import</command>.
420+ This function is analogous to the <command>docker export</command> command, in that it can be used to flatten a Docker image that contains multiple layers. It is in fact the result of the merge of all the layers of the image. As such, the result is suitable for being imported in Docker with <command>docker import</command>.
527421 </para>
528422
529423 <note>
530424 <para>
531− Using this function requires the <literal>kvm</literal> device to be
532− available.
425+ Using this function requires the <literal>kvm</literal> device to be available.
533426 </para>
534427 </note>
535428
@@ -551,14 +444,11 @@ exportImage {
551444 </example>
552445
553446 <para>
554− The parameters relative to the base image have the same synopsis as
555− described in <xref linkend='ssec-pkgs-dockerTools-buildImage'/>, except that
556− <varname>fromImage</varname> is the only required argument in this case.
447+ The parameters relative to the base image have the same synopsis as described in <xref linkend='ssec-pkgs-dockerTools-buildImage'/>, except that <varname>fromImage</varname> is the only required argument in this case.
557448 </para>
558449
559450 <para>
560− The <varname>name</varname> argument is the name of the derivation output,
561− which defaults to <varname>fromImage.name</varname>.
451+ The <varname>name</varname> argument is the name of the derivation output, which defaults to <varname>fromImage.name</varname>.
562452 </para>
563453 </section>
564454
@@ -566,11 +456,7 @@ exportImage {
566456 <title>shadowSetup</title>
567457
568458 <para>
569− This constant string is a helper for setting up the base files for managing
570− users and groups, only if such files don't exist already. It is suitable for
571− being used in a <varname>runAsRoot</varname>
572− <xref linkend='ex-dockerTools-buildImage-runAsRoot'/> script for cases like
573− in the example below:
459+ This constant string is a helper for setting up the base files for managing users and groups, only if such files don't exist already. It is suitable for being used in a <varname>runAsRoot</varname> <xref linkend='ex-dockerTools-buildImage-runAsRoot'/> script for cases like in the example below:
574460 </para>
575461
576462 <example xml:id='ex-dockerTools-shadowSetup'>
@@ -592,9 +478,7 @@ buildImage {
592478 </example>
593479
594480 <para>
595− Creating base files like <literal>/etc/passwd</literal> or
596− <literal>/etc/login.defs</literal> is necessary for shadow-utils to
597− manipulate users and groups.
481+ Creating base files like <literal>/etc/passwd</literal> or <literal>/etc/login.defs</literal> is necessary for shadow-utils to manipulate users and groups.
598482 </para>
599483 </section>
600484</section>
doc/functions/fetchers.xml+16−62
@@ -5,18 +5,11 @@
55 <title>Fetcher functions</title>
66
77 <para>
8− When using Nix, you will frequently need to download source code and other
9− files from the internet. Nixpkgs comes with a few helper functions that allow
10− you to fetch fixed-output derivations in a structured way.
8+ When using Nix, you will frequently need to download source code and other files from the internet. Nixpkgs comes with a few helper functions that allow you to fetch fixed-output derivations in a structured way.
119 </para>
1210
1311 <para>
14− The two fetcher primitives are <function>fetchurl</function> and
15− <function>fetchzip</function>. Both of these have two required arguments, a
16− URL and a hash. The hash is typically <literal>sha256</literal>, although
17− many more hash algorithms are supported. Nixpkgs contributors are currently
18− recommended to use <literal>sha256</literal>. This hash will be used by Nix
19− to identify your source. A typical usage of fetchurl is provided below.
12+ The two fetcher primitives are <function>fetchurl</function> and <function>fetchzip</function>. Both of these have two required arguments, a URL and a hash. The hash is typically <literal>sha256</literal>, although many more hash algorithms are supported. Nixpkgs contributors are currently recommended to use <literal>sha256</literal>. This hash will be used by Nix to identify your source. A typical usage of fetchurl is provided below.
2013 </para>
2114
2215<programlisting><![CDATA[
@@ -32,30 +25,15 @@ stdenv.mkDerivation {
3225]]></programlisting>
3326
3427 <para>
35− The main difference between <function>fetchurl</function> and
36− <function>fetchzip</function> is in how they store the contents.
37− <function>fetchurl</function> will store the unaltered contents of the URL
38− within the Nix store. <function>fetchzip</function> on the other hand will
39− decompress the archive for you, making files and directories directly
40− accessible in the future. <function>fetchzip</function> can only be used with
41− archives. Despite the name, <function>fetchzip</function> is not limited to
42− .zip files and can also be used with any tarball.
28+ The main difference between <function>fetchurl</function> and <function>fetchzip</function> is in how they store the contents. <function>fetchurl</function> will store the unaltered contents of the URL within the Nix store. <function>fetchzip</function> on the other hand will decompress the archive for you, making files and directories directly accessible in the future. <function>fetchzip</function> can only be used with archives. Despite the name, <function>fetchzip</function> is not limited to .zip files and can also be used with any tarball.
4329 </para>
4430
4531 <para>
46− <function>fetchpatch</function> works very similarly to
47− <function>fetchurl</function> with the same arguments expected. It expects
48− patch files as a source and and performs normalization on them before
49− computing the checksum. For example it will remove comments or other unstable
50− parts that are sometimes added by version control systems and can change over
51− time.
32+ <function>fetchpatch</function> works very similarly to <function>fetchurl</function> with the same arguments expected. It expects patch files as a source and and performs normalization on them before computing the checksum. For example it will remove comments or other unstable parts that are sometimes added by version control systems and can change over time.
5233 </para>
5334
5435 <para>
55− Other fetcher functions allow you to add source code directly from a VCS such
56− as subversion or git. These are mostly straightforward names based on the
57− name of the command used with the VCS system. Because they give you a working
58− repository, they act most like <function>fetchzip</function>.
36+ Other fetcher functions allow you to add source code directly from a VCS such as subversion or git. These are mostly straightforward names based on the name of the command used with the VCS system. Because they give you a working repository, they act most like <function>fetchzip</function>.
5937 </para>
6038
6139 <variablelist>
@@ -65,8 +43,7 @@ stdenv.mkDerivation {
6543 </term>
6644 <listitem>
6745 <para>
68− Used with Subversion. Expects <literal>url</literal> to a Subversion
69− directory, <literal>rev</literal>, and <literal>sha256</literal>.
46+ Used with Subversion. Expects <literal>url</literal> to a Subversion directory, <literal>rev</literal>, and <literal>sha256</literal>.
7047 </para>
7148 </listitem>
7249 </varlistentry>
@@ -76,10 +53,7 @@ stdenv.mkDerivation {
7653 </term>
7754 <listitem>
7855 <para>
79− Used with Git. Expects <literal>url</literal> to a Git repo,
80− <literal>rev</literal>, and <literal>sha256</literal>.
81− <literal>rev</literal> in this case can be full the git commit id (SHA1
82− hash) or a tag name like <literal>refs/tags/v1.0</literal>.
56+ Used with Git. Expects <literal>url</literal> to a Git repo, <literal>rev</literal>, and <literal>sha256</literal>. <literal>rev</literal> in this case can be full the git commit id (SHA1 hash) or a tag name like <literal>refs/tags/v1.0</literal>.
8357 </para>
8458 </listitem>
8559 </varlistentry>
@@ -89,8 +63,7 @@ stdenv.mkDerivation {
8963 </term>
9064 <listitem>
9165 <para>
92− Used with Fossil. Expects <literal>url</literal> to a Fossil archive,
93− <literal>rev</literal>, and <literal>sha256</literal>.
66+ Used with Fossil. Expects <literal>url</literal> to a Fossil archive, <literal>rev</literal>, and <literal>sha256</literal>.
9467 </para>
9568 </listitem>
9669 </varlistentry>
@@ -100,8 +73,7 @@ stdenv.mkDerivation {
10073 </term>
10174 <listitem>
10275 <para>
103− Used with CVS. Expects <literal>cvsRoot</literal>, <literal>tag</literal>,
104− and <literal>sha256</literal>.
76+ Used with CVS. Expects <literal>cvsRoot</literal>, <literal>tag</literal>, and <literal>sha256</literal>.
10577 </para>
10678 </listitem>
10779 </varlistentry>
@@ -111,18 +83,14 @@ stdenv.mkDerivation {
11183 </term>
11284 <listitem>
11385 <para>
114− Used with Mercurial. Expects <literal>url</literal>,
115− <literal>rev</literal>, and <literal>sha256</literal>.
86+ Used with Mercurial. Expects <literal>url</literal>, <literal>rev</literal>, and <literal>sha256</literal>.
11687 </para>
11788 </listitem>
11889 </varlistentry>
11990 </variablelist>
12091
12192 <para>
122− A number of fetcher functions wrap part of <function>fetchurl</function> and
123− <function>fetchzip</function>. They are mainly convenience functions intended
124− for commonly used destinations of source code in Nixpkgs. These wrapper
125− fetchers are listed below.
93+ A number of fetcher functions wrap part of <function>fetchurl</function> and <function>fetchzip</function>. They are mainly convenience functions intended for commonly used destinations of source code in Nixpkgs. These wrapper fetchers are listed below.
12694 </para>
12795
12896 <variablelist>
@@ -132,17 +100,7 @@ stdenv.mkDerivation {
132100 </term>
133101 <listitem>
134102 <para>
135− <function>fetchFromGitHub</function> expects four arguments.
136− <literal>owner</literal> is a string corresponding to the GitHub user or
137− organization that controls this repository. <literal>repo</literal>
138− corresponds to the name of the software repository. These are located at
139− the top of every GitHub HTML page as
140− <literal>owner</literal>/<literal>repo</literal>. <literal>rev</literal>
141− corresponds to the Git commit hash or tag (e.g <literal>v1.0</literal>)
142− that will be downloaded from Git. Finally, <literal>sha256</literal>
143− corresponds to the hash of the extracted directory. Again, other hash
144− algorithms are also available but <literal>sha256</literal> is currently
145− preferred.
103+ <function>fetchFromGitHub</function> expects four arguments. <literal>owner</literal> is a string corresponding to the GitHub user or organization that controls this repository. <literal>repo</literal> corresponds to the name of the software repository. These are located at the top of every GitHub HTML page as <literal>owner</literal>/<literal>repo</literal>. <literal>rev</literal> corresponds to the Git commit hash or tag (e.g <literal>v1.0</literal>) that will be downloaded from Git. Finally, <literal>sha256</literal> corresponds to the hash of the extracted directory. Again, other hash algorithms are also available but <literal>sha256</literal> is currently preferred.
146104 </para>
147105 </listitem>
148106 </varlistentry>
@@ -152,8 +110,7 @@ stdenv.mkDerivation {
152110 </term>
153111 <listitem>
154112 <para>
155− This is used with GitLab repositories. The arguments expected are very
156− similar to fetchFromGitHub above.
113+ This is used with GitLab repositories. The arguments expected are very similar to fetchFromGitHub above.
157114 </para>
158115 </listitem>
159116 </varlistentry>
@@ -163,8 +120,7 @@ stdenv.mkDerivation {
163120 </term>
164121 <listitem>
165122 <para>
166− This is used with BitBucket repositories. The arguments expected are very
167− similar to fetchFromGitHub above.
123+ This is used with BitBucket repositories. The arguments expected are very similar to fetchFromGitHub above.
168124 </para>
169125 </listitem>
170126 </varlistentry>
@@ -174,8 +130,7 @@ stdenv.mkDerivation {
174130 </term>
175131 <listitem>
176132 <para>
177− This is used with Savannah repositories. The arguments expected are very
178− similar to fetchFromGitHub above.
133+ This is used with Savannah repositories. The arguments expected are very similar to fetchFromGitHub above.
179134 </para>
180135 </listitem>
181136 </varlistentry>
@@ -185,8 +140,7 @@ stdenv.mkDerivation {
185140 </term>
186141 <listitem>
187142 <para>
188− This is used with repo.or.cz repositories. The arguments expected are very
189− similar to fetchFromGitHub above.
143+ This is used with repo.or.cz repositories. The arguments expected are very similar to fetchFromGitHub above.
190144 </para>
191145 </listitem>
192146 </varlistentry>
doc/functions/fhs-environments.xml+9−29
@@ -5,15 +5,7 @@
55 <title>buildFHSUserEnv</title>
66
77 <para>
8− <function>buildFHSUserEnv</function> provides a way to build and run
9− FHS-compatible lightweight sandboxes. It creates an isolated root with bound
10− <filename>/nix/store</filename>, so its footprint in terms of disk space
11− needed is quite small. This allows one to run software which is hard or
12− unfeasible to patch for NixOS -- 3rd-party source trees with FHS assumptions,
13− games distributed as tarballs, software with integrity checking and/or
14− external self-updated binaries. It uses Linux namespaces feature to create
15− temporary lightweight environments which are destroyed after all child
16− processes exit, without root user rights requirement. Accepted arguments are:
8+ <function>buildFHSUserEnv</function> provides a way to build and run FHS-compatible lightweight sandboxes. It creates an isolated root with bound <filename>/nix/store</filename>, so its footprint in terms of disk space needed is quite small. This allows one to run software which is hard or unfeasible to patch for NixOS -- 3rd-party source trees with FHS assumptions, games distributed as tarballs, software with integrity checking and/or external self-updated binaries. It uses Linux namespaces feature to create temporary lightweight environments which are destroyed after all child processes exit, without root user rights requirement. Accepted arguments are:
179 </para>
1810
1911 <variablelist>
@@ -33,8 +25,7 @@
3325 </term>
3426 <listitem>
3527 <para>
36− Packages to be installed for the main host's architecture (i.e. x86_64 on
37− x86_64 installations). Along with libraries binaries are also installed.
28+ Packages to be installed for the main host's architecture (i.e. x86_64 on x86_64 installations). Along with libraries binaries are also installed.
3829 </para>
3930 </listitem>
4031 </varlistentry>
@@ -44,9 +35,7 @@
4435 </term>
4536 <listitem>
4637 <para>
47− Packages to be installed for all architectures supported by a host (i.e.
48− i686 and x86_64 on x86_64 installations). Only libraries are installed by
49− default.
38+ Packages to be installed for all architectures supported by a host (i.e. i686 and x86_64 on x86_64 installations). Only libraries are installed by default.
5039 </para>
5140 </listitem>
5241 </varlistentry>
@@ -66,8 +55,7 @@
6655 </term>
6756 <listitem>
6857 <para>
69− Like <literal>extraBuildCommands</literal>, but executed only on multilib
70− architectures.
58+ Like <literal>extraBuildCommands</literal>, but executed only on multilib architectures.
7159 </para>
7260 </listitem>
7361 </varlistentry>
@@ -77,8 +65,7 @@
7765 </term>
7866 <listitem>
7967 <para>
80− Additional derivation outputs to be linked for both target and
81− multi-architecture packages.
68+ Additional derivation outputs to be linked for both target and multi-architecture packages.
8269 </para>
8370 </listitem>
8471 </varlistentry>
@@ -88,8 +75,7 @@
8875 </term>
8976 <listitem>
9077 <para>
91− Additional commands to be executed for finalizing the derivation with
92− runner script.
78+ Additional commands to be executed for finalizing the derivation with runner script.
9379 </para>
9480 </listitem>
9581 </varlistentry>
@@ -99,16 +85,14 @@
9985 </term>
10086 <listitem>
10187 <para>
102− A command that would be executed inside the sandbox and passed all the
103− command line arguments. It defaults to <literal>bash</literal>.
88+ A command that would be executed inside the sandbox and passed all the command line arguments. It defaults to <literal>bash</literal>.
10489 </para>
10590 </listitem>
10691 </varlistentry>
10792 </variablelist>
10893
10994 <para>
110− One can create a simple environment using a <literal>shell.nix</literal> like
111− that:
95+ One can create a simple environment using a <literal>shell.nix</literal> like that:
11296 </para>
11397
11498<programlisting><![CDATA[
@@ -133,10 +117,6 @@
133117]]></programlisting>
134118
135119 <para>
136− Running <literal>nix-shell</literal> would then drop you into a shell with
137− these libraries and binaries available. You can use this to run closed-source
138− applications which expect FHS structure without hassles: simply change
139− <literal>runScript</literal> to the application path, e.g.
140− <filename>./bin/start.sh</filename> -- relative paths are supported.
120+ Running <literal>nix-shell</literal> would then drop you into a shell with these libraries and binaries available. You can use this to run closed-source applications which expect FHS structure without hassles: simply change <literal>runScript</literal> to the application path, e.g. <filename>./bin/start.sh</filename> -- relative paths are supported.
141121 </para>
142122</section>
doc/functions/generators.xml+5−20
@@ -5,28 +5,15 @@
55 <title>Generators</title>
66
77 <para>
8− Generators are functions that create file formats from nix data structures,
9− e. g. for configuration files. There are generators available for:
10− <literal>INI</literal>, <literal>JSON</literal> and <literal>YAML</literal>
8+ Generators are functions that create file formats from nix data structures, e. g. for configuration files. There are generators available for: <literal>INI</literal>, <literal>JSON</literal> and <literal>YAML</literal>
119 </para>
1210
1311 <para>
14− All generators follow a similar call interface: <code>generatorName
15− configFunctions data</code>, where <literal>configFunctions</literal> is an
16− attrset of user-defined functions that format nested parts of the content.
17− They each have common defaults, so often they do not need to be set manually.
18− An example is <code>mkSectionName ? (name: libStr.escape [ "[" "]" ]
19− name)</code> from the <literal>INI</literal> generator. It receives the name
20− of a section and sanitizes it. The default <literal>mkSectionName</literal>
21− escapes <literal>[</literal> and <literal>]</literal> with a backslash.
12+ All generators follow a similar call interface: <code>generatorName configFunctions data</code>, where <literal>configFunctions</literal> is an attrset of user-defined functions that format nested parts of the content. They each have common defaults, so often they do not need to be set manually. An example is <code>mkSectionName ? (name: libStr.escape [ "[" "]" ] name)</code> from the <literal>INI</literal> generator. It receives the name of a section and sanitizes it. The default <literal>mkSectionName</literal> escapes <literal>[</literal> and <literal>]</literal> with a backslash.
2213 </para>
2314
2415 <para>
25− Generators can be fine-tuned to produce exactly the file format required by
26− your application/service. One example is an INI-file format which uses
27− <literal>: </literal> as separator, the strings
28− <literal>"yes"</literal>/<literal>"no"</literal> as boolean values and
29− requires all string values to be quoted:
16+ Generators can be fine-tuned to produce exactly the file format required by your application/service. One example is an INI-file format which uses <literal>: </literal> as separator, the strings <literal>"yes"</literal>/<literal>"no"</literal> as boolean values and requires all string values to be quoted:
3017 </para>
3118
3219<programlisting>
@@ -77,13 +64,11 @@ merge:"diff3"
7764
7865 <note>
7966 <para>
80− Nix store paths can be converted to strings by enclosing a derivation
81− attribute like so: <code>"${drv}"</code>.
67+ Nix store paths can be converted to strings by enclosing a derivation attribute like so: <code>"${drv}"</code>.
8268 </para>
8369 </note>
8470
8571 <para>
86− Detailed documentation for each generator can be found in
87− <literal>lib/generators.nix</literal>.
72+ Detailed documentation for each generator can be found in <literal>lib/generators.nix</literal>.
8873 </para>
8974</section>
doc/functions/library.xml+1−2
@@ -5,8 +5,7 @@
55 <title>Nixpkgs Library Functions</title>
66
77 <para>
8− Nixpkgs provides a standard library at <varname>pkgs.lib</varname>, or
9− through <code>import &lt;nixpkgs/lib&gt;</code>.
8+ Nixpkgs provides a standard library at <varname>pkgs.lib</varname>, or through <code>import &lt;nixpkgs/lib&gt;</code>.
109 </para>
1110
1211 <xi:include href="./library/asserts.xml" />
doc/functions/library/asserts.xml+4−9
@@ -27,8 +27,7 @@
2727 </term>
2828 <listitem>
2929 <para>
30− Condition under which the <varname>msg</varname> should
31− <emphasis>not</emphasis> be printed.
30+ Condition under which the <varname>msg</varname> should <emphasis>not</emphasis> be printed.
3231 </para>
3332 </listitem>
3433 </varlistentry>
@@ -64,9 +63,7 @@ stderr> assert failed
6463 <xi:include href="./locations.xml" xpointer="lib.asserts.assertOneOf" />
6564
6665 <para>
67− Specialized <function>asserts.assertMsg</function> for checking if
68− <varname>val</varname> is one of the elements of <varname>xs</varname>.
69− Useful for checking enums.
66+ Specialized <function>asserts.assertMsg</function> for checking if <varname>val</varname> is one of the elements of <varname>xs</varname>. Useful for checking enums.
7067 </para>
7168
7269 <variablelist>
@@ -76,8 +73,7 @@ stderr> assert failed
7673 </term>
7774 <listitem>
7875 <para>
79− The name of the variable the user entered <varname>val</varname> into,
80− for inclusion in the error message.
76+ The name of the variable the user entered <varname>val</varname> into, for inclusion in the error message.
8177 </para>
8278 </listitem>
8379 </varlistentry>
@@ -87,8 +83,7 @@ stderr> assert failed
8783 </term>
8884 <listitem>
8985 <para>
90− The value of what the user provided, to be compared against the values in
91− <varname>xs</varname>.
86+ The value of what the user provided, to be compared against the values in <varname>xs</varname>.
9287 </para>
9388 </listitem>
9489 </varlistentry>
doc/functions/library/attrsets.xml+42−103
@@ -23,8 +23,7 @@
2323 </term>
2424 <listitem>
2525 <para>
26− A list of strings representing the path through the nested attribute set
27− <varname>set</varname>.
26+ A list of strings representing the path through the nested attribute set <varname>set</varname>.
2827 </para>
2928 </listitem>
3029 </varlistentry>
@@ -34,8 +33,7 @@
3433 </term>
3534 <listitem>
3635 <para>
37− Default value if <varname>attrPath</varname> does not resolve to an
38− existing value.
36+ Default value if <varname>attrPath</varname> does not resolve to an existing value.
3937 </para>
4038 </listitem>
4139 </varlistentry>
@@ -88,8 +86,7 @@ lib.attrsets.attrByPath [ "a" "b" ] 0 {}
8886 </term>
8987 <listitem>
9088 <para>
91− A list of strings representing the path through the nested attribute set
92− <varname>set</varname>.
89+ A list of strings representing the path through the nested attribute set <varname>set</varname>.
9390 </para>
9491 </listitem>
9592 </varlistentry>
@@ -125,8 +122,7 @@ lib.attrsets.hasAttrByPath
125122 <xi:include href="./locations.xml" xpointer="lib.attrsets.setAttrByPath" />
126123
127124 <para>
128− Create a new attribute set with <varname>value</varname> set at the nested
129− attribute location specified in <varname>attrPath</varname>.
125+ Create a new attribute set with <varname>value</varname> set at the nested attribute location specified in <varname>attrPath</varname>.
130126 </para>
131127
132128 <variablelist>
@@ -146,8 +142,7 @@ lib.attrsets.hasAttrByPath
146142 </term>
147143 <listitem>
148144 <para>
149− The value to set at the location described by
150− <varname>attrPath</varname>.
145+ The value to set at the location described by <varname>attrPath</varname>.
151146 </para>
152147 </listitem>
153148 </varlistentry>
@@ -171,8 +166,7 @@ lib.attrsets.setAttrByPath [ "a" "b" ] 3
171166 <xi:include href="./locations.xml" xpointer="lib.attrsets.getAttrFromPath" />
172167
173168 <para>
174− Like <xref linkend="function-library-lib.attrsets.attrByPath" /> except
175− without a default, and it will throw if the value doesn't exist.
169+ Like <xref linkend="function-library-lib.attrsets.attrByPath" /> except without a default, and it will throw if the value doesn't exist.
176170 </para>
177171
178172 <variablelist>
@@ -182,8 +176,7 @@ lib.attrsets.setAttrByPath [ "a" "b" ] 3
182176 </term>
183177 <listitem>
184178 <para>
185− A list of strings representing the path through the nested attribute set
186− <varname>set</varname>.
179+ A list of strings representing the path through the nested attribute set <varname>set</varname>.
187180 </para>
188181 </listitem>
189182 </varlistentry>
@@ -235,8 +228,7 @@ lib.attrsets.getAttrFromPath [ "x" "y" ] { }
235228 </term>
236229 <listitem>
237230 <para>
238− The list of attributes to fetch from <varname>set</varname>. Each
239− attribute name must exist on the attrbitue set.
231+ The list of attributes to fetch from <varname>set</varname>. Each attribute name must exist on the attrbitue set.
240232 </para>
241233 </listitem>
242234 </varlistentry>
@@ -282,8 +274,7 @@ error: attribute 'd' missing
282274 </para>
283275
284276 <para>
285− Provides a backwards-compatible interface of
286− <function>builtins.attrValues</function> for Nix version older than 1.8.
277+ Provides a backwards-compatible interface of <function>builtins.attrValues</function> for Nix version older than 1.8.
287278 </para>
288279
289280 <variablelist>
@@ -317,14 +308,11 @@ lib.attrsets.attrValues { a = 1; b = 2; c = 3; }
317308 <xi:include href="./locations.xml" xpointer="lib.attrsets.catAttrs" />
318309
319310 <para>
320− Collect each attribute named `attr' from the list of attribute sets,
321− <varname>sets</varname>. Sets that don't contain the named attribute are
322− ignored.
311+ Collect each attribute named `attr' from the list of attribute sets, <varname>sets</varname>. Sets that don't contain the named attribute are ignored.
323312 </para>
324313
325314 <para>
326− Provides a backwards-compatible interface of
327− <function>builtins.catAttrs</function> for Nix version older than 1.9.
315+ Provides a backwards-compatible interface of <function>builtins.catAttrs</function> for Nix version older than 1.9.
328316 </para>
329317
330318 <variablelist>
@@ -334,8 +322,7 @@ lib.attrsets.attrValues { a = 1; b = 2; c = 3; }
334322 </term>
335323 <listitem>
336324 <para>
337− Attribute name to select from each attribute set in
338− <varname>sets</varname>.
325+ Attribute name to select from each attribute set in <varname>sets</varname>.
339326 </para>
340327 </listitem>
341328 </varlistentry>
@@ -372,8 +359,7 @@ catAttrs "a" [{a = 1;} {b = 0;} {a = 2;}]
372359 <xi:include href="./locations.xml" xpointer="lib.attrsets.filterAttrs" />
373360
374361 <para>
375− Filter an attribute set by removing all attributes for which the given
376− predicate return false.
362+ Filter an attribute set by removing all attributes for which the given predicate return false.
377363 </para>
378364
379365 <variablelist>
@@ -386,8 +372,7 @@ catAttrs "a" [{a = 1;} {b = 0;} {a = 2;}]
386372 <literal>String -> Any -> Bool</literal>
387373 </para>
388374 <para>
389− Predicate which returns true to include an attribute, or returns false to
390− exclude it.
375+ Predicate which returns true to include an attribute, or returns false to exclude it.
391376 </para>
392377 <variablelist>
393378 <varlistentry>
@@ -412,8 +397,7 @@ catAttrs "a" [{a = 1;} {b = 0;} {a = 2;}]
412397 </varlistentry>
413398 </variablelist>
414399 <para>
415− Returns <literal>true</literal> to include the attribute,
416− <literal>false</literal> to exclude the attribute.
400+ Returns <literal>true</literal> to include the attribute, <literal>false</literal> to exclude the attribute.
417401 </para>
418402 </listitem>
419403 </varlistentry>
@@ -447,8 +431,7 @@ filterAttrs (n: v: n == "foo") { foo = 1; bar = 2; }
447431 <xi:include href="./locations.xml" xpointer="lib.attrsets.filterAttrsRecursive" />
448432
449433 <para>
450− Filter an attribute set recursively by removing all attributes for which the
451− given predicate return false.
434+ Filter an attribute set recursively by removing all attributes for which the given predicate return false.
452435 </para>
453436
454437 <variablelist>
@@ -461,8 +444,7 @@ filterAttrs (n: v: n == "foo") { foo = 1; bar = 2; }
461444 <literal>String -> Any -> Bool</literal>
462445 </para>
463446 <para>
464− Predicate which returns true to include an attribute, or returns false to
465− exclude it.
447+ Predicate which returns true to include an attribute, or returns false to exclude it.
466448 </para>
467449 <variablelist>
468450 <varlistentry>
@@ -487,8 +469,7 @@ filterAttrs (n: v: n == "foo") { foo = 1; bar = 2; }
487469 </varlistentry>
488470 </variablelist>
489471 <para>
490− Returns <literal>true</literal> to include the attribute,
491− <literal>false</literal> to exclude the attribute.
472+ Returns <literal>true</literal> to include the attribute, <literal>false</literal> to exclude the attribute.
492473 </para>
493474 </listitem>
494475 </varlistentry>
@@ -557,8 +538,7 @@ lib.attrsets.filterAttrsRecursive
557538 <literal>Any -> Any -> Any</literal>
558539 </para>
559540 <para>
560− Given a value <varname>val</varname> and a collector
561− <varname>col</varname>, combine the two.
541+ Given a value <varname>val</varname> and a collector <varname>col</varname>, combine the two.
562542 </para>
563543 <variablelist>
564544 <varlistentry>
@@ -578,8 +558,7 @@ lib.attrsets.filterAttrsRecursive
578558 <listitem>
579559<!-- TODO: make this not bad, use more fold-ey terms -->
580560 <para>
581− The result of previous <function>op</function> calls with other values
582− and <function>nul</function>.
561+ The result of previous <function>op</function> calls with other values and <function>nul</function>.
583562 </para>
584563 </listitem>
585564 </varlistentry>
@@ -632,9 +611,7 @@ lib.attrsets.foldAttrs
632611 <xi:include href="./locations.xml" xpointer="lib.attrsets.collect" />
633612
634613 <para>
635− Recursively collect sets that verify a given predicate named
636− <varname>pred</varname> from the set <varname>attrs</varname>. The recursion
637− stops when <varname>pred</varname> returns <literal>true</literal>.
614+ Recursively collect sets that verify a given predicate named <varname>pred</varname> from the set <varname>attrs</varname>. The recursion stops when <varname>pred</varname> returns <literal>true</literal>.
638615 </para>
639616
640617 <variablelist>
@@ -702,8 +679,7 @@ collect (x: x ? outPath)
702679 <xi:include href="./locations.xml" xpointer="lib.attrsets.nameValuePair" />
703680
704681 <para>
705− Utility function that creates a <literal>{name, value}</literal> pair as
706− expected by <function>builtins.listToAttrs</function>.
682+ Utility function that creates a <literal>{name, value}</literal> pair as expected by <function>builtins.listToAttrs</function>.
707683 </para>
708684
709685 <variablelist>
@@ -747,13 +723,11 @@ nameValuePair "some" 6
747723 <xi:include href="./locations.xml" xpointer="lib.attrsets.mapAttrs" />
748724
749725 <para>
750− Apply a function to each element in an attribute set, creating a new
751− attribute set.
726+ Apply a function to each element in an attribute set, creating a new attribute set.
752727 </para>
753728
754729 <para>
755− Provides a backwards-compatible interface of
756− <function>builtins.mapAttrs</function> for Nix version older than 2.1.
730+ Provides a backwards-compatible interface of <function>builtins.mapAttrs</function> for Nix version older than 2.1.
757731 </para>
758732
759733 <variablelist>
@@ -814,9 +788,7 @@ lib.attrsets.mapAttrs
814788 <xi:include href="./locations.xml" xpointer="lib.attrsets.mapAttrs-prime" />
815789
816790 <para>
817− Like <function>mapAttrs</function>, but allows the name of each attribute to
818− be changed in addition to the value. The applied function should return both
819− the new name and value as a <function>nameValuePair</function>.
791+ Like <function>mapAttrs</function>, but allows the name of each attribute to be changed in addition to the value. The applied function should return both the new name and value as a <function>nameValuePair</function>.
820792 </para>
821793
822794 <variablelist>
@@ -829,10 +801,8 @@ lib.attrsets.mapAttrs
829801 <literal>String -> Any -> { name = String; value = Any }</literal>
830802 </para>
831803 <para>
832− Given an attribute's name and value, return a new
833− <link
834− linkend="function-library-lib.attrsets.nameValuePair">name
835− value pair</link>.
804+ Given an attribute's name and value, return a new <link
805+ linkend="function-library-lib.attrsets.nameValuePair">name value pair</link>.
836806 </para>
837807 <variablelist>
838808 <varlistentry>
@@ -891,8 +861,7 @@ lib.attrsets.mapAttrs' (name: value: lib.attrsets.nameValuePair ("foo_" + name)
891861 <xi:include href="./locations.xml" xpointer="lib.attrsets.mapAttrsToList" />
892862
893863 <para>
894− Call <varname>fn</varname> for each attribute in the given
895− <varname>set</varname> and return the result in a list.
864+ Call <varname>fn</varname> for each attribute in the given <varname>set</varname> and return the result in a list.
896865 </para>
897866
898867 <variablelist>
@@ -962,9 +931,7 @@ lib.attrsets.mapAttrsToList (name: value: "${name}=${value}")
962931 <xi:include href="./locations.xml" xpointer="lib.attrsets.mapAttrsRecursive" />
963932
964933 <para>
965− Like <function>mapAttrs</function>, except that it recursively applies
966− itself to attribute sets. Also, the first argument of the argument function
967− is a <emphasis>list</emphasis> of the names of the containing attributes.
934+ Like <function>mapAttrs</function>, except that it recursively applies itself to attribute sets. Also, the first argument of the argument function is a <emphasis>list</emphasis> of the names of the containing attributes.
968935 </para>
969936
970937 <variablelist>
@@ -989,10 +956,7 @@ lib.attrsets.mapAttrsToList (name: value: "${name}=${value}")
989956 The list of attribute names to this value.
990957 </para>
991958 <para>
992− For example, the <varname>name_path</varname> for the
993− <literal>example</literal> string in the attribute set <literal>{ foo
994− = { bar = "example"; }; }</literal> is <literal>[ "foo" "bar"
995− ]</literal>.
959+ For example, the <varname>name_path</varname> for the <literal>example</literal> string in the attribute set <literal>{ foo = { bar = "example"; }; }</literal> is <literal>[ "foo" "bar" ]</literal>.
996960 </para>
997961 </listitem>
998962 </varlistentry>
@@ -1059,11 +1023,7 @@ mapAttrsRecursive
10591023 <xi:include href="./locations.xml" xpointer="lib.attrsets.mapAttrsRecursiveCond" />
10601024
10611025 <para>
1062− Like <function>mapAttrsRecursive</function>, but it takes an additional
1063− predicate function that tells it whether to recursive into an attribute set.
1064− If it returns false, <function>mapAttrsRecursiveCond</function> does not
1065− recurse, but does apply the map function. It is returns true, it does
1066− recurse, and does not apply the map function.
1026+ Like <function>mapAttrsRecursive</function>, but it takes an additional predicate function that tells it whether to recursive into an attribute set. If it returns false, <function>mapAttrsRecursiveCond</function> does not recurse, but does apply the map function. It is returns true, it does recurse, and does not apply the map function.
10671027 </para>
10681028
10691029 <variablelist>
@@ -1076,8 +1036,7 @@ mapAttrsRecursive
10761036 <literal>(AttrSet -> Bool)</literal>
10771037 </para>
10781038 <para>
1079− Determine if <function>mapAttrsRecursive</function> should recurse deeper
1080− in to the attribute set.
1039+ Determine if <function>mapAttrsRecursive</function> should recurse deeper in to the attribute set.
10811040 </para>
10821041 <variablelist>
10831042 <varlistentry>
@@ -1114,10 +1073,7 @@ mapAttrsRecursive
11141073 The list of attribute names to this value.
11151074 </para>
11161075 <para>
1117− For example, the <varname>name_path</varname> for the
1118− <literal>example</literal> string in the attribute set <literal>{ foo
1119− = { bar = "example"; }; }</literal> is <literal>[ "foo" "bar"
1120− ]</literal>.
1076+ For example, the <varname>name_path</varname> for the <literal>example</literal> string in the attribute set <literal>{ foo = { bar = "example"; }; }</literal> is <literal>[ "foo" "bar" ]</literal>.
11211077 </para>
11221078 </listitem>
11231079 </varlistentry>
@@ -1181,8 +1137,7 @@ lib.attrsets.mapAttrsRecursiveCond
11811137 <xi:include href="./locations.xml" xpointer="lib.attrsets.genAttrs" />
11821138
11831139 <para>
1184− Generate an attribute set by mapping a function over a list of attribute
1185− names.
1140+ Generate an attribute set by mapping a function over a list of attribute names.
11861141 </para>
11871142
11881143 <variablelist>
@@ -1241,8 +1196,7 @@ lib.attrsets.genAttrs [ "foo" "bar" ] (name: "x_${name}")
12411196 <xi:include href="./locations.xml" xpointer="lib.attrsets.isDerivation" />
12421197
12431198 <para>
1244− Check whether the argument is a derivation. Any set with <code>{ type =
1245− "derivation"; }</code> counts as a derivation.
1199+ Check whether the argument is a derivation. Any set with <code>{ type = "derivation"; }</code> counts as a derivation.
12461200 </para>
12471201
12481202 <variablelist>
@@ -1320,8 +1274,7 @@ lib.attrsets.isDerivation "foobar"
13201274 </term>
13211275 <listitem>
13221276 <para>
1323− Condition under which the <varname>as</varname> attribute set is
1324− returned.
1277+ Condition under which the <varname>as</varname> attribute set is returned.
13251278 </para>
13261279 </listitem>
13271280 </varlistentry>
@@ -1363,8 +1316,7 @@ lib.attrsets.optionalAttrs false { my = "set"; }
13631316 <xi:include href="./locations.xml" xpointer="lib.attrsets.zipAttrsWithNames" />
13641317
13651318 <para>
1366− Merge sets of attributes and use the function <varname>f</varname> to merge
1367− attribute values where the attribute name is in <varname>names</varname>.
1319+ Merge sets of attributes and use the function <varname>f</varname> to merge attribute values where the attribute name is in <varname>names</varname>.
13681320 </para>
13691321
13701322 <variablelist>
@@ -1451,11 +1403,8 @@ lib.attrsets.zipAttrsWithNames
14511403 <xi:include href="./locations.xml" xpointer="lib.attrsets.zipAttrsWith" />
14521404
14531405 <para>
1454− Merge sets of attributes and use the function <varname>f</varname> to merge
1455− attribute values. Similar to
1456− <xref
1457− linkend="function-library-lib.attrsets.zipAttrsWithNames" /> where
1458− all key names are passed for <varname>names</varname>.
1406+ Merge sets of attributes and use the function <varname>f</varname> to merge attribute values. Similar to <xref
1407+ linkend="function-library-lib.attrsets.zipAttrsWithNames" /> where all key names are passed for <varname>names</varname>.
14591408 </para>
14601409
14611410 <variablelist>
@@ -1531,9 +1480,7 @@ lib.attrsets.zipAttrsWith
15311480 <xi:include href="./locations.xml" xpointer="lib.attrsets.zipAttrs" />
15321481
15331482 <para>
1534− Merge sets of attributes and combine each attribute value in to a list.
1535− Similar to <xref linkend="function-library-lib.attrsets.zipAttrsWith" />
1536− where the merge function returns a list of all values.
1483+ Merge sets of attributes and combine each attribute value in to a list. Similar to <xref linkend="function-library-lib.attrsets.zipAttrsWith" /> where the merge function returns a list of all values.
15371484 </para>
15381485
15391486 <variablelist>
@@ -1573,12 +1520,7 @@ lib.attrsets.zipAttrs
15731520 <xi:include href="./locations.xml" xpointer="lib.attrsets.recursiveUpdateUntil" />
15741521
15751522 <para>
1576− Does the same as the update operator <literal>//</literal> except that
1577− attributes are merged until the given predicate is verified. The predicate
1578− should accept 3 arguments which are the path to reach the attribute, a part
1579− of the first attribute set and a part of the second attribute set. When the
1580− predicate is verified, the value of the first attribute set is replaced by
1581− the value of the second attribute set.
1523+ Does the same as the update operator <literal>//</literal> except that attributes are merged until the given predicate is verified. The predicate should accept 3 arguments which are the path to reach the attribute, a part of the first attribute set and a part of the second attribute set. When the predicate is verified, the value of the first attribute set is replaced by the value of the second attribute set.
15821524 </para>
15831525
15841526 <variablelist>
@@ -1681,10 +1623,7 @@ lib.attrsets.recursiveUpdateUntil (path: l: r: path == ["foo"])
16811623 <xi:include href="./locations.xml" xpointer="lib.attrsets.recursiveUpdate" />
16821624
16831625 <para>
1684− A recursive variant of the update operator <literal>//</literal>. The
1685− recursion stops when one of the attribute values is not an attribute set, in
1686− which case the right hand side value takes precedence over the left hand
1687− side value.
1626+ A recursive variant of the update operator <literal>//</literal>. The recursion stops when one of the attribute values is not an attribute set, in which case the right hand side value takes precedence over the left hand side value.
16881627 </para>
16891628
16901629 <variablelist>
doc/functions/nix-gitignore.xml+5−19
@@ -5,21 +5,14 @@
55 <title>pkgs.nix-gitignore</title>
66
77 <para>
8− <function>pkgs.nix-gitignore</function> is a function that acts similarly to
9− <literal>builtins.filterSource</literal> but also allows filtering with the
10− help of the gitignore format.
8+ <function>pkgs.nix-gitignore</function> is a function that acts similarly to <literal>builtins.filterSource</literal> but also allows filtering with the help of the gitignore format.
119 </para>
1210
1311 <section xml:id="sec-pkgs-nix-gitignore-usage">
1412 <title>Usage</title>
1513
1614 <para>
17− <literal>pkgs.nix-gitignore</literal> exports a number of functions, but
18− you'll most likely need either <literal>gitignoreSource</literal> or
19− <literal>gitignoreSourcePure</literal>. As their first argument, they both
20− accept either 1. a file with gitignore lines or 2. a string with gitignore
21− lines, or 3. a list of either of the two. They will be concatenated into a
22− single big string.
15+ <literal>pkgs.nix-gitignore</literal> exports a number of functions, but you'll most likely need either <literal>gitignoreSource</literal> or <literal>gitignoreSourcePure</literal>. As their first argument, they both accept either 1. a file with gitignore lines or 2. a string with gitignore lines, or 3. a list of either of the two. They will be concatenated into a single big string.
2316 </para>
2417
2518<programlisting><![CDATA[
@@ -40,8 +33,7 @@
4033 ]]></programlisting>
4134
4235 <para>
43− These functions are derived from the <literal>Filter</literal> functions by
44− setting the first filter argument to <literal>(_: _: true)</literal>:
36+ These functions are derived from the <literal>Filter</literal> functions by setting the first filter argument to <literal>(_: _: true)</literal>:
4537 </para>
4638
4739<programlisting><![CDATA[
@@ -50,12 +42,7 @@ gitignoreSource = gitignoreFilterSource (_: _: true);
5042 ]]></programlisting>
5143
5244 <para>
53− Those filter functions accept the same arguments the
54− <literal>builtins.filterSource</literal> function would pass to its filters,
55− thus <literal>fn: gitignoreFilterSourcePure fn ""</literal> should be
56− extensionally equivalent to <literal>filterSource</literal>. The file is
57− blacklisted iff it's blacklisted by either your filter or the
58− gitignoreFilter.
45+ Those filter functions accept the same arguments the <literal>builtins.filterSource</literal> function would pass to its filters, thus <literal>fn: gitignoreFilterSourcePure fn ""</literal> should be extensionally equivalent to <literal>filterSource</literal>. The file is blacklisted iff it's blacklisted by either your filter or the gitignoreFilter.
5946 </para>
6047
6148 <para>
@@ -71,8 +58,7 @@ gitignoreFilter = ign: root: filterPattern (gitignoreToPatterns ign) root;
7158 <title>gitignore files in subdirectories</title>
7259
7360 <para>
74− If you wish to use a filter that would search for .gitignore files in
75− subdirectories, just like git does by default, use this function:
61+ If you wish to use a filter that would search for .gitignore files in subdirectories, just like git does by default, use this function:
7662 </para>
7763
7864<programlisting><![CDATA[
doc/functions/ocitools.xml+6−20
@@ -5,26 +5,18 @@
55 <title>pkgs.ociTools</title>
66
77 <para>
8− <varname>pkgs.ociTools</varname> is a set of functions for creating
9− containers according to the
10− <link xlink:href="https://github.com/opencontainers/runtime-spec">OCI
11− container specification v1.0.0</link>. Beyond that it makes no assumptions
12− about the container runner you choose to use to run the created container.
8+ <varname>pkgs.ociTools</varname> is a set of functions for creating containers according to the <link xlink:href="https://github.com/opencontainers/runtime-spec">OCI container specification v1.0.0</link>. Beyond that it makes no assumptions about the container runner you choose to use to run the created container.
139 </para>
1410
1511 <section xml:id="ssec-pkgs-ociTools-buildContainer">
1612 <title>buildContainer</title>
1713
1814 <para>
19− This function creates a simple OCI container that runs a single command
20− inside of it. An OCI container consists of a <varname>config.json</varname>
21− and a rootfs directory.The nix store of the container will contain all
22− referenced dependencies of the given command.
15+ This function creates a simple OCI container that runs a single command inside of it. An OCI container consists of a <varname>config.json</varname> and a rootfs directory.The nix store of the container will contain all referenced dependencies of the given command.
2316 </para>
2417
2518 <para>
26− The parameters of <varname>buildContainer</varname> with an example value
27− are described below:
19+ The parameters of <varname>buildContainer</varname> with an example value are described below:
2820 </para>
2921
3022 <example xml:id='ex-ociTools-buildContainer'>
@@ -51,23 +43,17 @@ buildContainer {
5143 <calloutlist>
5244 <callout arearefs='ex-ociTools-buildContainer-1'>
5345 <para>
54− <varname>args</varname> specifies a set of arguments to run inside the
55− container. This is the only required argument for
56− <varname>buildContainer</varname>. All referenced packages inside the
57− derivation will be made available inside the container
46+ <varname>args</varname> specifies a set of arguments to run inside the container. This is the only required argument for <varname>buildContainer</varname>. All referenced packages inside the derivation will be made available inside the container
5847 </para>
5948 </callout>
6049 <callout arearefs='ex-ociTools-buildContainer-2'>
6150 <para>
62− <varname>mounts</varname> specifies additional mount points chosen by the
63− user. By default only a minimal set of necessary filesystems are mounted
64− into the container (e.g procfs, cgroupfs)
51+ <varname>mounts</varname> specifies additional mount points chosen by the user. By default only a minimal set of necessary filesystems are mounted into the container (e.g procfs, cgroupfs)
6552 </para>
6653 </callout>
6754 <callout arearefs='ex-ociTools-buildContainer-3'>
6855 <para>
69− <varname>readonly</varname> makes the container's rootfs read-only if it
70− is set to true. The default value is false <literal>false</literal>.
56+ <varname>readonly</varname> makes the container's rootfs read-only if it is set to true. The default value is false <literal>false</literal>.
7157 </para>
7258 </callout>
7359 </calloutlist>
doc/functions/overrides.xml+17−78
@@ -5,23 +5,18 @@
55 <title>Overriding</title>
66
77 <para>
8− Sometimes one wants to override parts of <literal>nixpkgs</literal>, e.g.
9− derivation attributes, the results of derivations.
8+ Sometimes one wants to override parts of <literal>nixpkgs</literal>, e.g. derivation attributes, the results of derivations.
109 </para>
1110
1211 <para>
13− These functions are used to make changes to packages, returning only single
14− packages. <link xlink:href="#chap-overlays">Overlays</link>, on the other
15− hand, can be used to combine the overridden packages across the entire
16− package set of Nixpkgs.
12+ These functions are used to make changes to packages, returning only single packages. <link xlink:href="#chap-overlays">Overlays</link>, on the other hand, can be used to combine the overridden packages across the entire package set of Nixpkgs.
1713 </para>
1814
1915 <section xml:id="sec-pkg-override">
2016 <title>&lt;pkg&gt;.override</title>
2117
2218 <para>
23− The function <varname>override</varname> is usually available for all the
24− derivations in the nixpkgs expression (<varname>pkgs</varname>).
19+ The function <varname>override</varname> is usually available for all the derivations in the nixpkgs expression (<varname>pkgs</varname>).
2520 </para>
2621
2722 <para>
@@ -47,10 +42,7 @@ mypkg = pkgs.callPackage ./mypkg.nix {
4742 </para>
4843
4944 <para>
50− In the first example, <varname>pkgs.foo</varname> is the result of a
51− function call with some default arguments, usually a derivation. Using
52− <varname>pkgs.foo.override</varname> will call the same function with the
53− given new arguments.
45+ In the first example, <varname>pkgs.foo</varname> is the result of a function call with some default arguments, usually a derivation. Using <varname>pkgs.foo.override</varname> will call the same function with the given new arguments.
5446 </para>
5547 </section>
5648
@@ -58,12 +50,7 @@ mypkg = pkgs.callPackage ./mypkg.nix {
5850 <title>&lt;pkg&gt;.overrideAttrs</title>
5951
6052 <para>
61− The function <varname>overrideAttrs</varname> allows overriding the
62− attribute set passed to a <varname>stdenv.mkDerivation</varname> call,
63− producing a new derivation based on the original one. This function is
64− available on all derivations produced by the
65− <varname>stdenv.mkDerivation</varname> function, which is most packages in
66− the nixpkgs expression <varname>pkgs</varname>.
53+ The function <varname>overrideAttrs</varname> allows overriding the attribute set passed to a <varname>stdenv.mkDerivation</varname> call, producing a new derivation based on the original one. This function is available on all derivations produced by the <varname>stdenv.mkDerivation</varname> function, which is most packages in the nixpkgs expression <varname>pkgs</varname>.
6754 </para>
6855
6956 <para>
@@ -76,30 +63,16 @@ helloWithDebug = pkgs.hello.overrideAttrs (oldAttrs: rec {
7663 </para>
7764
7865 <para>
79− In the above example, the <varname>separateDebugInfo</varname> attribute is
80− overridden to be true, thus building debug info for
81− <varname>helloWithDebug</varname>, while all other attributes will be
82− retained from the original <varname>hello</varname> package.
66+ In the above example, the <varname>separateDebugInfo</varname> attribute is overridden to be true, thus building debug info for <varname>helloWithDebug</varname>, while all other attributes will be retained from the original <varname>hello</varname> package.
8367 </para>
8468
8569 <para>
86− The argument <varname>oldAttrs</varname> is conventionally used to refer to
87− the attr set originally passed to <varname>stdenv.mkDerivation</varname>.
70+ The argument <varname>oldAttrs</varname> is conventionally used to refer to the attr set originally passed to <varname>stdenv.mkDerivation</varname>.
8871 </para>
8972
9073 <note>
9174 <para>
92− Note that <varname>separateDebugInfo</varname> is processed only by the
93− <varname>stdenv.mkDerivation</varname> function, not the generated, raw Nix
94− derivation. Thus, using <varname>overrideDerivation</varname> will not work
95− in this case, as it overrides only the attributes of the final derivation.
96− It is for this reason that <varname>overrideAttrs</varname> should be
97− preferred in (almost) all cases to <varname>overrideDerivation</varname>,
98− i.e. to allow using <varname>stdenv.mkDerivation</varname> to process input
99− arguments, as well as the fact that it is easier to use (you can use the
100− same attribute names you see in your Nix code, instead of the ones
101− generated (e.g. <varname>buildInputs</varname> vs
102− <varname>nativeBuildInputs</varname>), and it involves less typing).
75+ Note that <varname>separateDebugInfo</varname> is processed only by the <varname>stdenv.mkDerivation</varname> function, not the generated, raw Nix derivation. Thus, using <varname>overrideDerivation</varname> will not work in this case, as it overrides only the attributes of the final derivation. It is for this reason that <varname>overrideAttrs</varname> should be preferred in (almost) all cases to <varname>overrideDerivation</varname>, i.e. to allow using <varname>stdenv.mkDerivation</varname> to process input arguments, as well as the fact that it is easier to use (you can use the same attribute names you see in your Nix code, instead of the ones generated (e.g. <varname>buildInputs</varname> vs <varname>nativeBuildInputs</varname>), and it involves less typing).
10376 </para>
10477 </note>
10578 </section>
@@ -109,34 +82,18 @@ helloWithDebug = pkgs.hello.overrideAttrs (oldAttrs: rec {
10982
11083 <warning>
11184 <para>
112− You should prefer <varname>overrideAttrs</varname> in almost all cases, see
113− its documentation for the reasons why.
114− <varname>overrideDerivation</varname> is not deprecated and will continue
115− to work, but is less nice to use and does not have as many abilities as
116− <varname>overrideAttrs</varname>.
85+ You should prefer <varname>overrideAttrs</varname> in almost all cases, see its documentation for the reasons why. <varname>overrideDerivation</varname> is not deprecated and will continue to work, but is less nice to use and does not have as many abilities as <varname>overrideAttrs</varname>.
11786 </para>
11887 </warning>
11988
12089 <warning>
12190 <para>
122− Do not use this function in Nixpkgs as it evaluates a Derivation before
123− modifying it, which breaks package abstraction and removes error-checking
124− of function arguments. In addition, this evaluation-per-function
125− application incurs a performance penalty, which can become a problem if
126− many overrides are used. It is only intended for ad-hoc customisation, such
127− as in <filename>~/.config/nixpkgs/config.nix</filename>.
91+ Do not use this function in Nixpkgs as it evaluates a Derivation before modifying it, which breaks package abstraction and removes error-checking of function arguments. In addition, this evaluation-per-function application incurs a performance penalty, which can become a problem if many overrides are used. It is only intended for ad-hoc customisation, such as in <filename>~/.config/nixpkgs/config.nix</filename>.
12892 </para>
12993 </warning>
13094
13195 <para>
132− The function <varname>overrideDerivation</varname> creates a new derivation
133− based on an existing one by overriding the original's attributes with the
134− attribute set produced by the specified function. This function is available
135− on all derivations defined using the <varname>makeOverridable</varname>
136− function. Most standard derivation-producing functions, such as
137− <varname>stdenv.mkDerivation</varname>, are defined using this function,
138− which means most packages in the nixpkgs expression,
139− <varname>pkgs</varname>, have this function.
96+ The function <varname>overrideDerivation</varname> creates a new derivation based on an existing one by overriding the original's attributes with the attribute set produced by the specified function. This function is available on all derivations defined using the <varname>makeOverridable</varname> function. Most standard derivation-producing functions, such as <varname>stdenv.mkDerivation</varname>, are defined using this function, which means most packages in the nixpkgs expression, <varname>pkgs</varname>, have this function.
14097 </para>
14198
14299 <para>
@@ -154,27 +111,16 @@ mySed = pkgs.gnused.overrideDerivation (oldAttrs: {
154111 </para>
155112
156113 <para>
157− In the above example, the <varname>name</varname>, <varname>src</varname>,
158− and <varname>patches</varname> of the derivation will be overridden, while
159− all other attributes will be retained from the original derivation.
114+ In the above example, the <varname>name</varname>, <varname>src</varname>, and <varname>patches</varname> of the derivation will be overridden, while all other attributes will be retained from the original derivation.
160115 </para>
161116
162117 <para>
163− The argument <varname>oldAttrs</varname> is used to refer to the attribute
164− set of the original derivation.
118+ The argument <varname>oldAttrs</varname> is used to refer to the attribute set of the original derivation.
165119 </para>
166120
167121 <note>
168122 <para>
169− A package's attributes are evaluated *before* being modified by the
170− <varname>overrideDerivation</varname> function. For example, the
171− <varname>name</varname> attribute reference in <varname>url =
172− "mirror://gnu/hello/${name}.tar.gz";</varname> is filled-in *before* the
173− <varname>overrideDerivation</varname> function modifies the attribute set.
174− This means that overriding the <varname>name</varname> attribute, in this
175− example, *will not* change the value of the <varname>url</varname>
176− attribute. Instead, we need to override both the <varname>name</varname>
177− *and* <varname>url</varname> attributes.
123+ A package's attributes are evaluated *before* being modified by the <varname>overrideDerivation</varname> function. For example, the <varname>name</varname> attribute reference in <varname>url = "mirror://gnu/hello/${name}.tar.gz";</varname> is filled-in *before* the <varname>overrideDerivation</varname> function modifies the attribute set. This means that overriding the <varname>name</varname> attribute, in this example, *will not* change the value of the <varname>url</varname> attribute. Instead, we need to override both the <varname>name</varname> *and* <varname>url</varname> attributes.
178124 </para>
179125 </note>
180126 </section>
@@ -183,9 +129,7 @@ mySed = pkgs.gnused.overrideDerivation (oldAttrs: {
183129 <title>lib.makeOverridable</title>
184130
185131 <para>
186− The function <varname>lib.makeOverridable</varname> is used to make the
187− result of a function easily customizable. This utility only makes sense for
188− functions that accept an argument set and return an attribute set.
132+ The function <varname>lib.makeOverridable</varname> is used to make the result of a function easily customizable. This utility only makes sense for functions that accept an argument set and return an attribute set.
189133 </para>
190134
191135 <para>
@@ -197,16 +141,11 @@ c = lib.makeOverridable f { a = 1; b = 2; };
197141 </para>
198142
199143 <para>
200− The variable <varname>c</varname> is the value of the <varname>f</varname>
201− function applied with some default arguments. Hence the value of
202− <varname>c.result</varname> is <literal>3</literal>, in this example.
144+ The variable <varname>c</varname> is the value of the <varname>f</varname> function applied with some default arguments. Hence the value of <varname>c.result</varname> is <literal>3</literal>, in this example.
203145 </para>
204146
205147 <para>
206− The variable <varname>c</varname> however also has some additional
207− functions, like <link linkend="sec-pkg-override">c.override</link> which can
208− be used to override the default arguments. In this example the value of
209− <varname>(c.override { a = 4; }).result</varname> is 6.
148+ The variable <varname>c</varname> however also has some additional functions, like <link linkend="sec-pkg-override">c.override</link> which can be used to override the default arguments. In this example the value of <varname>(c.override { a = 4; }).result</varname> is 6.
210149 </para>
211150 </section>
212151</section>
doc/functions/prefer-remote-fetch.xml+2−6
@@ -5,16 +5,12 @@
55 <title>prefer-remote-fetch overlay</title>
66
77 <para>
8− <function>prefer-remote-fetch</function> is an overlay that download sources
9− on remote builder. This is useful when the evaluating machine has a slow
10− upload while the builder can fetch faster directly from the source. To use
11− it, put the following snippet as a new overlay:
8+ <function>prefer-remote-fetch</function> is an overlay that download sources on remote builder. This is useful when the evaluating machine has a slow upload while the builder can fetch faster directly from the source. To use it, put the following snippet as a new overlay:
129<programlisting>
1310self: super:
1411 (super.prefer-remote-fetch self super)
1512</programlisting>
16− A full configuration example for that sets the overlay up for your own
17− account, could look like this
13+ A full configuration example for that sets the overlay up for your own account, could look like this
1814<screen>
1915<prompt>$ </prompt>mkdir ~/.config/nixpkgs/overlays/
2016<prompt>$ </prompt>cat &gt; ~/.config/nixpkgs/overlays/prefer-remote-fetch.nix &lt;&lt;EOF
doc/functions/shell.xml+1−3
@@ -5,9 +5,7 @@
55 <title>pkgs.mkShell</title>
66
77 <para>
8− <function>pkgs.mkShell</function> is a special kind of derivation that is
9− only useful when using it combined with <command>nix-shell</command>. It will
10− in fact fail to instantiate when invoked with <command>nix-build</command>.
8+ <function>pkgs.mkShell</function> is a special kind of derivation that is only useful when using it combined with <command>nix-shell</command>. It will in fact fail to instantiate when invoked with <command>nix-build</command>.
119 </para>
1210
1311 <section xml:id="sec-pkgs-mkShell-usage">
doc/functions/snaptools.xml+8−23
@@ -5,28 +5,22 @@
55 <title>pkgs.snapTools</title>
66
77 <para>
8− <varname>pkgs.snapTools</varname> is a set of functions for creating
9− Snapcraft images. Snap and Snapcraft is not used to perform these operations.
8+ <varname>pkgs.snapTools</varname> is a set of functions for creating Snapcraft images. Snap and Snapcraft is not used to perform these operations.
109 </para>
1110
1211 <section xml:id="ssec-pkgs-snapTools-makeSnap-signature">
1312 <title>The makeSnap Function</title>
1413
1514 <para>
16− <function>makeSnap</function> takes a single named argument,
17− <parameter>meta</parameter>. This argument mirrors
18− <link xlink:href="https://docs.snapcraft.io/snap-format">the upstream
19− <filename>snap.yaml</filename> format</link> exactly.
15+ <function>makeSnap</function> takes a single named argument, <parameter>meta</parameter>. This argument mirrors <link xlink:href="https://docs.snapcraft.io/snap-format">the upstream <filename>snap.yaml</filename> format</link> exactly.
2016 </para>
2117
2218 <para>
23− The <parameter>base</parameter> should not be be specified, as
24− <function>makeSnap</function> will force set it.
19+ The <parameter>base</parameter> should not be be specified, as <function>makeSnap</function> will force set it.
2520 </para>
2621
2722 <para>
28− Currently, <function>makeSnap</function> does not support creating GUI
29− stubs.
23+ Currently, <function>makeSnap</function> does not support creating GUI stubs.
3024 </para>
3125 </section>
3226
@@ -40,9 +34,7 @@
4034 </para>
4135<programlisting><xi:include href="./snap/example-hello.nix" parse="text" /></programlisting>
4236 <para>
43− <command>nix-build</command> this expression and install it with
44− <command>snap install ./result --dangerous</command>.
45− <command>hello</command> will now be the Snapcraft version of the package.
37+ <command>nix-build</command> this expression and install it with <command>snap install ./result --dangerous</command>. <command>hello</command> will now be the Snapcraft version of the package.
4638 </para>
4739 </example>
4840 </section>
@@ -53,21 +45,14 @@
5345 <example xml:id="ex-snapTools-buildSnap-firefox">
5446 <title>Making a Graphical Snap</title>
5547 <para>
56− Graphical programs require many more integrations with the host. This
57− example uses Firefox as an example, because it is one of the most
58− complicated programs we could package.
48+ Graphical programs require many more integrations with the host. This example uses Firefox as an example, because it is one of the most complicated programs we could package.
5949 </para>
6050<programlisting><xi:include href="./snap/example-firefox.nix" parse="text" /></programlisting>
6151 <para>
62− <command>nix-build</command> this expression and install it with
63− <command>snap install ./result --dangerous</command>.
64− <command>nix-example-firefox</command> will now be the Snapcraft version of
65− the Firefox package.
52+ <command>nix-build</command> this expression and install it with <command>snap install ./result --dangerous</command>. <command>nix-example-firefox</command> will now be the Snapcraft version of the Firefox package.
6653 </para>
6754 <para>
68− The specific meaning behind plugs can be looked up in the
69− <link xlink:href="https://docs.snapcraft.io/supported-interfaces">Snapcraft
70− interface documentation</link>.
55+ The specific meaning behind plugs can be looked up in the <link xlink:href="https://docs.snapcraft.io/supported-interfaces">Snapcraft interface documentation</link>.
7156 </para>
7257 </example>
7358 </section>
doc/functions/trivial-builders.xml+6−40
@@ -5,11 +5,7 @@
55 <title>Trivial builders</title>
66
77 <para>
8− Nixpkgs provides a couple of functions that help with building derivations.
9− The most important one, <function>stdenv.mkDerivation</function>, has already
10− been documented above. The following functions wrap
11− <function>stdenv.mkDerivation</function>, making it easier to use in certain
12− cases.
8+ Nixpkgs provides a couple of functions that help with building derivations. The most important one, <function>stdenv.mkDerivation</function>, has already been documented above. The following functions wrap <function>stdenv.mkDerivation</function>, making it easier to use in certain cases.
139 </para>
1410
1511 <variablelist>
@@ -19,17 +15,7 @@
1915 </term>
2016 <listitem>
2117 <para>
22− This takes three arguments, <literal>name</literal>,
23− <literal>env</literal>, and <literal>buildCommand</literal>.
24− <literal>name</literal> is just the name that Nix will append to the store
25− path in the same way that <literal>stdenv.mkDerivation</literal> uses its
26− <literal>name</literal> attribute. <literal>env</literal> is an attribute
27− set specifying environment variables that will be set for this derivation.
28− These attributes are then passed to the wrapped
29− <literal>stdenv.mkDerivation</literal>. <literal>buildCommand</literal>
30− specifies the commands that will be run to create this derivation. Note
31− that you will need to create <literal>$out</literal> for Nix to register
32− the command as successful.
18+ This takes three arguments, <literal>name</literal>, <literal>env</literal>, and <literal>buildCommand</literal>. <literal>name</literal> is just the name that Nix will append to the store path in the same way that <literal>stdenv.mkDerivation</literal> uses its <literal>name</literal> attribute. <literal>env</literal> is an attribute set specifying environment variables that will be set for this derivation. These attributes are then passed to the wrapped <literal>stdenv.mkDerivation</literal>. <literal>buildCommand</literal> specifies the commands that will be run to create this derivation. Note that you will need to create <literal>$out</literal> for Nix to register the command as successful.
3319 </para>
3420 <para>
3521 An example of using <literal>runCommand</literal> is provided below.
@@ -62,10 +48,7 @@
6248 </term>
6349 <listitem>
6450 <para>
65− This works just like <literal>runCommand</literal>. The only difference is
66− that it also provides a C compiler in <literal>buildCommand</literal>’s
67− environment. To minimize your dependencies, you should only use this if
68− you are sure you will need a C compiler as part of running your command.
51+ This works just like <literal>runCommand</literal>. The only difference is that it also provides a C compiler in <literal>buildCommand</literal>’s environment. To minimize your dependencies, you should only use this if you are sure you will need a C compiler as part of running your command.
6952 </para>
7053 </listitem>
7154 </varlistentry>
@@ -75,20 +58,10 @@
7558 </term>
7659 <listitem>
7760 <para>
78− These functions write <literal>text</literal> to the Nix store. This is
79− useful for creating scripts from Nix expressions.
80− <literal>writeTextFile</literal> takes an attribute set and expects two
81− arguments, <literal>name</literal> and <literal>text</literal>.
82− <literal>name</literal> corresponds to the name used in the Nix store
83− path. <literal>text</literal> will be the contents of the file. You can
84− also set <literal>executable</literal> to true to make this file have the
85− executable bit set.
61+ These functions write <literal>text</literal> to the Nix store. This is useful for creating scripts from Nix expressions. <literal>writeTextFile</literal> takes an attribute set and expects two arguments, <literal>name</literal> and <literal>text</literal>. <literal>name</literal> corresponds to the name used in the Nix store path. <literal>text</literal> will be the contents of the file. You can also set <literal>executable</literal> to true to make this file have the executable bit set.
8662 </para>
8763 <para>
88− Many more commands wrap <literal>writeTextFile</literal> including
89− <literal>writeText</literal>, <literal>writeTextDir</literal>,
90− <literal>writeScript</literal>, and <literal>writeScriptBin</literal>.
91− These are convenience functions over <literal>writeTextFile</literal>.
64+ Many more commands wrap <literal>writeTextFile</literal> including <literal>writeText</literal>, <literal>writeTextDir</literal>, <literal>writeScript</literal>, and <literal>writeScriptBin</literal>. These are convenience functions over <literal>writeTextFile</literal>.
9265 </para>
9366 </listitem>
9467 </varlistentry>
@@ -98,14 +71,7 @@
9871 </term>
9972 <listitem>
10073 <para>
101− This can be used to put many derivations into the same directory
102− structure. It works by creating a new derivation and adding symlinks to
103− each of the paths listed. It expects two arguments,
104− <literal>name</literal>, and <literal>paths</literal>.
105− <literal>name</literal> is the name used in the Nix store path for the
106− created derivation. <literal>paths</literal> is a list of paths that will
107− be symlinked. These paths can be to Nix store derivations or any other
108− subdirectory contained within.
74+ This can be used to put many derivations into the same directory structure. It works by creating a new derivation and adding symlinks to each of the paths listed. It expects two arguments, <literal>name</literal>, and <literal>paths</literal>. <literal>name</literal> is the name used in the Nix store path for the created derivation. <literal>paths</literal> is a list of paths that will be symlinked. These paths can be to Nix store derivations or any other subdirectory contained within.
10975 </para>
11076 </listitem>
11177 </varlistentry>
doc/languages-frameworks/beam.xml+36−127
@@ -7,12 +7,7 @@
77 <title>Introduction</title>
88
99 <para>
10− In this document and related Nix expressions, we use the term,
11− <emphasis>BEAM</emphasis>, to describe the environment. BEAM is the name of
12− the Erlang Virtual Machine and, as far as we're concerned, from a packaging
13− perspective, all languages that run on the BEAM are interchangeable. That
14− which varies, like the build system, is transparent to users of any given
15− BEAM package, so we make no distinction.
10+ In this document and related Nix expressions, we use the term, <emphasis>BEAM</emphasis>, to describe the environment. BEAM is the name of the Erlang Virtual Machine and, as far as we're concerned, from a packaging perspective, all languages that run on the BEAM are interchangeable. That which varies, like the build system, is transparent to users of any given BEAM package, so we make no distinction.
1611 </para>
1712 </section>
1813
@@ -20,57 +15,36 @@
2015 <title>Structure</title>
2116
2217 <para>
23− All BEAM-related expressions are available via the top-level
24− <literal>beam</literal> attribute, which includes:
18+ All BEAM-related expressions are available via the top-level <literal>beam</literal> attribute, which includes:
2519 </para>
2620
2721 <itemizedlist>
2822 <listitem>
2923 <para>
30− <literal>interpreters</literal>: a set of compilers running on the BEAM,
31− including multiple Erlang/OTP versions
32− (<literal>beam.interpreters.erlangR19</literal>, etc), Elixir
33− (<literal>beam.interpreters.elixir</literal>) and LFE
34− (<literal>beam.interpreters.lfe</literal>).
24+ <literal>interpreters</literal>: a set of compilers running on the BEAM, including multiple Erlang/OTP versions (<literal>beam.interpreters.erlangR19</literal>, etc), Elixir (<literal>beam.interpreters.elixir</literal>) and LFE (<literal>beam.interpreters.lfe</literal>).
3525 </para>
3626 </listitem>
3727 <listitem>
3828 <para>
39− <literal>packages</literal>: a set of package sets, each compiled with a
40− specific Erlang/OTP version, e.g.
41− <literal>beam.packages.erlangR19</literal>.
29+ <literal>packages</literal>: a set of package sets, each compiled with a specific Erlang/OTP version, e.g. <literal>beam.packages.erlangR19</literal>.
4230 </para>
4331 </listitem>
4432 </itemizedlist>
4533
4634 <para>
47− The default Erlang compiler, defined by
48− <literal>beam.interpreters.erlang</literal>, is aliased as
49− <literal>erlang</literal>. The default BEAM package set is defined by
50− <literal>beam.packages.erlang</literal> and aliased at the top level as
51− <literal>beamPackages</literal>.
35+ The default Erlang compiler, defined by <literal>beam.interpreters.erlang</literal>, is aliased as <literal>erlang</literal>. The default BEAM package set is defined by <literal>beam.packages.erlang</literal> and aliased at the top level as <literal>beamPackages</literal>.
5236 </para>
5337
5438 <para>
55− To create a package set built with a custom Erlang version, use the lambda,
56− <literal>beam.packagesWith</literal>, which accepts an Erlang/OTP derivation
57− and produces a package set similar to
58− <literal>beam.packages.erlang</literal>.
39+ To create a package set built with a custom Erlang version, use the lambda, <literal>beam.packagesWith</literal>, which accepts an Erlang/OTP derivation and produces a package set similar to <literal>beam.packages.erlang</literal>.
5940 </para>
6041
6142 <para>
62− Many Erlang/OTP distributions available in
63− <literal>beam.interpreters</literal> have versions with ODBC and/or Java
64− enabled. For example, there's
65− <literal>beam.interpreters.erlangR19_odbc_javac</literal>, which corresponds
66− to <literal>beam.interpreters.erlangR19</literal>.
43+ Many Erlang/OTP distributions available in <literal>beam.interpreters</literal> have versions with ODBC and/or Java enabled. For example, there's <literal>beam.interpreters.erlangR19_odbc_javac</literal>, which corresponds to <literal>beam.interpreters.erlangR19</literal>.
6744 </para>
6845
6946 <para xml:id="erlang-call-package">
70− We also provide the lambda,
71− <literal>beam.packages.erlang.callPackage</literal>, which simplifies
72− writing BEAM package definitions by injecting all packages from
73− <literal>beam.packages.erlang</literal> into the top-level context.
47+ We also provide the lambda, <literal>beam.packages.erlang.callPackage</literal>, which simplifies writing BEAM package definitions by injecting all packages from <literal>beam.packages.erlang</literal> into the top-level context.
7448 </para>
7549 </section>
7650
@@ -81,24 +55,16 @@
8155 <title>Rebar3</title>
8256
8357 <para>
84− By default, Rebar3 wants to manage its own dependencies. This is perfectly
85− acceptable in the normal, non-Nix setup, but in the Nix world, it is not.
86− To rectify this, we provide two versions of Rebar3:
58+ By default, Rebar3 wants to manage its own dependencies. This is perfectly acceptable in the normal, non-Nix setup, but in the Nix world, it is not. To rectify this, we provide two versions of Rebar3:
8759 <itemizedlist>
8860 <listitem>
8961 <para>
90− <literal>rebar3</literal>: patched to remove the ability to download
91− anything. When not running it via <literal>nix-shell</literal> or
92− <literal>nix-build</literal>, it's probably not going to work as
93− desired.
62+ <literal>rebar3</literal>: patched to remove the ability to download anything. When not running it via <literal>nix-shell</literal> or <literal>nix-build</literal>, it's probably not going to work as desired.
9463 </para>
9564 </listitem>
9665 <listitem>
9766 <para>
98− <literal>rebar3-open</literal>: the normal, unmodified Rebar3. It should
99− work exactly as would any other version of Rebar3. Any Erlang package
100− should rely on <literal>rebar3</literal> instead. See
101− <xref
67+ <literal>rebar3-open</literal>: the normal, unmodified Rebar3. It should work exactly as would any other version of Rebar3. Any Erlang package should rely on <literal>rebar3</literal> instead. See <xref
10268 linkend="rebar3-packages"/>.
10369 </para>
10470 </listitem>
@@ -110,10 +76,7 @@
11076 <title>Mix &amp; Erlang.mk</title>
11177
11278 <para>
113− Both Mix and Erlang.mk work exactly as expected. There is a bootstrap
114− process that needs to be run for both, however, which is supported by the
115− <literal>buildMix</literal> and <literal>buildErlangMk</literal>
116− derivations, respectively.
79+ Both Mix and Erlang.mk work exactly as expected. There is a bootstrap process that needs to be run for both, however, which is supported by the <literal>buildMix</literal> and <literal>buildErlangMk</literal> derivations, respectively.
11780 </para>
11881 </section>
11982 </section>
@@ -122,13 +85,7 @@
12285 <title>How to Install BEAM Packages</title>
12386
12487 <para>
125− BEAM packages are not registered at the top level, simply because they are
126− not relevant to the vast majority of Nix users. They are installable using
127− the <literal>beam.packages.erlang</literal> attribute set (aliased as
128− <literal>beamPackages</literal>), which points to packages built by the
129− default Erlang/OTP version in Nixpkgs, as defined by
130− <literal>beam.interpreters.erlang</literal>. To list the available packages
131− in <literal>beamPackages</literal>, use the following command:
88+ BEAM packages are not registered at the top level, simply because they are not relevant to the vast majority of Nix users. They are installable using the <literal>beam.packages.erlang</literal> attribute set (aliased as <literal>beamPackages</literal>), which points to packages built by the default Erlang/OTP version in Nixpkgs, as defined by <literal>beam.interpreters.erlang</literal>. To list the available packages in <literal>beamPackages</literal>, use the following command:
13289 </para>
13390
13491<screen>
@@ -143,8 +100,7 @@ beamPackages.rebar3-pc pc-1.1.0
143100</screen>
144101
145102 <para>
146− To install any of those packages into your profile, refer to them by their
147− attribute path (first column):
103+ To install any of those packages into your profile, refer to them by their attribute path (first column):
148104 </para>
149105
150106<screen>
@@ -152,9 +108,7 @@ beamPackages.rebar3-pc pc-1.1.0
152108</screen>
153109
154110 <para>
155− The attribute path of any BEAM package corresponds to the name of that
156− particular package in <link xlink:href="https://hex.pm">Hex</link> or its
157− OTP Application/Release name.
111+ The attribute path of any BEAM package corresponds to the name of that particular package in <link xlink:href="https://hex.pm">Hex</link> or its OTP Application/Release name.
158112 </para>
159113 </section>
160114
@@ -168,13 +122,8 @@ beamPackages.rebar3-pc pc-1.1.0
168122 <title>Rebar3 Packages</title>
169123
170124 <para>
171− The Nix function, <literal>buildRebar3</literal>, defined in
172− <literal>beam.packages.erlang.buildRebar3</literal> and aliased at the top
173− level, can be used to build a derivation that understands how to build a
174− Rebar3 project. For example, we can build
175− <link
176− xlink:href="https://github.com/erlang-nix/hex2nix">hex2nix</link>
177− as follows:
125+ The Nix function, <literal>buildRebar3</literal>, defined in <literal>beam.packages.erlang.buildRebar3</literal> and aliased at the top level, can be used to build a derivation that understands how to build a Rebar3 project. For example, we can build <link
126+ xlink:href="https://github.com/erlang-nix/hex2nix">hex2nix</link> as follows:
178127 </para>
179128
180129<programlisting>
@@ -196,25 +145,16 @@ buildRebar3 rec {
196145</programlisting>
197146
198147 <para>
199− Such derivations are callable with
200− <literal>beam.packages.erlang.callPackage</literal> (see
201− <xref
202− linkend="erlang-call-package"/>). To call this package using
203− the normal <literal>callPackage</literal>, refer to dependency packages
204− via <literal>beamPackages</literal>, e.g.
205− <literal>beamPackages.ibrowse</literal>.
148+ Such derivations are callable with <literal>beam.packages.erlang.callPackage</literal> (see <xref
149+ linkend="erlang-call-package"/>). To call this package using the normal <literal>callPackage</literal>, refer to dependency packages via <literal>beamPackages</literal>, e.g. <literal>beamPackages.ibrowse</literal>.
206150 </para>
207151
208152 <para>
209− Notably, <literal>buildRebar3</literal> includes
210− <literal>beamDeps</literal>, while <literal>stdenv.mkDerivation</literal>
211− does not. BEAM dependencies added there will be correctly handled by the
212− system.
153+ Notably, <literal>buildRebar3</literal> includes <literal>beamDeps</literal>, while <literal>stdenv.mkDerivation</literal> does not. BEAM dependencies added there will be correctly handled by the system.
213154 </para>
214155
215156 <para>
216− If a package needs to compile native code via Rebar3's port compilation
217− mechanism, add <literal>compilePort = true;</literal> to the derivation.
157+ If a package needs to compile native code via Rebar3's port compilation mechanism, add <literal>compilePort = true;</literal> to the derivation.
218158 </para>
219159 </section>
220160
@@ -222,9 +162,7 @@ buildRebar3 rec {
222162 <title>Erlang.mk Packages</title>
223163
224164 <para>
225− Erlang.mk functions similarly to Rebar3, except we use
226− <literal>buildErlangMk</literal> instead of
227− <literal>buildRebar3</literal>.
165+ Erlang.mk functions similarly to Rebar3, except we use <literal>buildErlangMk</literal> instead of <literal>buildRebar3</literal>.
228166 </para>
229167
230168<programlisting>
@@ -257,8 +195,7 @@ buildErlangMk {
257195 <title>Mix Packages</title>
258196
259197 <para>
260− Mix functions similarly to Rebar3, except we use
261− <literal>buildMix</literal> instead of <literal>buildRebar3</literal>.
198+ Mix functions similarly to Rebar3, except we use <literal>buildMix</literal> instead of <literal>buildRebar3</literal>.
262199 </para>
263200
264201<programlisting>
@@ -323,11 +260,7 @@ buildHex {
323260 <title>Accessing an Environment</title>
324261
325262 <para>
326− Often, we simply want to access a valid environment that contains a
327− specific package and its dependencies. We can accomplish that with the
328− <literal>env</literal> attribute of a derivation. For example, let's say we
329− want to access an Erlang REPL with <literal>ibrowse</literal> loaded up. We
330− could do the following:
263+ Often, we simply want to access a valid environment that contains a specific package and its dependencies. We can accomplish that with the <literal>env</literal> attribute of a derivation. For example, let's say we want to access an Erlang REPL with <literal>ibrowse</literal> loaded up. We could do the following:
331264 </para>
332265
333266<screen>
@@ -373,8 +306,7 @@ ok</computeroutput>
373306</screen>
374307
375308 <para>
376− Notice the <literal>-A beamPackages.ibrowse.env</literal>. That is the key
377− to this functionality.
309+ Notice the <literal>-A beamPackages.ibrowse.env</literal>. That is the key to this functionality.
378310 </para>
379311 </section>
380312
@@ -382,11 +314,7 @@ ok</computeroutput>
382314 <title>Creating a Shell</title>
383315
384316 <para>
385− Getting access to an environment often isn't enough to do real development.
386− Usually, we need to create a <literal>shell.nix</literal> file and do our
387− development inside of the environment specified therein. This file looks a
388− lot like the packaging described above, except that <literal>src</literal>
389− points to the project root and we call the package directly.
317+ Getting access to an environment often isn't enough to do real development. Usually, we need to create a <literal>shell.nix</literal> file and do our development inside of the environment specified therein. This file looks a lot like the packaging described above, except that <literal>src</literal> points to the project root and we call the package directly.
390318 </para>
391319
392320<programlisting>
@@ -414,8 +342,7 @@ in
414342 <title>Building in a Shell (for Mix Projects)</title>
415343
416344 <para>
417− We can leverage the support of the derivation, irrespective of the build
418− derivation, by calling the commands themselves.
345+ We can leverage the support of the derivation, irrespective of the build derivation, by calling the commands themselves.
419346 </para>
420347
421348<programlisting>
@@ -477,12 +404,8 @@ analyze: build plt
477404</programlisting>
478405
479406 <para>
480− Using a <literal>shell.nix</literal> as described (see
481− <xref
482− linkend="creating-a-shell"/>) should just work. Aside from
483− <literal>test</literal>, <literal>plt</literal>, and
484− <literal>analyze</literal>, the Make targets work just fine for all of the
485− build derivations.
407+ Using a <literal>shell.nix</literal> as described (see <xref
408+ linkend="creating-a-shell"/>) should just work. Aside from <literal>test</literal>, <literal>plt</literal>, and <literal>analyze</literal>, the Make targets work just fine for all of the build derivations.
486409 </para>
487410 </section>
488411 </section>
@@ -492,25 +415,14 @@ analyze: build plt
492415 <title>Generating Packages from Hex with <literal>hex2nix</literal></title>
493416
494417 <para>
495− Updating the <link xlink:href="https://hex.pm">Hex</link> package set
496− requires
497− <link
498− xlink:href="https://github.com/erlang-nix/hex2nix">hex2nix</link>.
499− Given the path to the Erlang modules (usually
500− <literal>pkgs/development/erlang-modules</literal>), it will dump a file
501− called <literal>hex-packages.nix</literal>, containing all the packages that
502− use a recognized build system in
503− <link
504− xlink:href="https://hex.pm">Hex</link>. It can't be determined,
505− however, whether every package is buildable.
418+ Updating the <link xlink:href="https://hex.pm">Hex</link> package set requires <link
419+ xlink:href="https://github.com/erlang-nix/hex2nix">hex2nix</link>. Given the path to the Erlang modules (usually <literal>pkgs/development/erlang-modules</literal>), it will dump a file called <literal>hex-packages.nix</literal>, containing all the packages that use a recognized build system in <link
420+ xlink:href="https://hex.pm">Hex</link>. It can't be determined, however, whether every package is buildable.
506421 </para>
507422
508423 <para>
509− To make life easier for our users, try to build every
510− <link
511− xlink:href="https://hex.pm">Hex</link> package and remove those
512− that fail. To do that, simply run the following command in the root of your
513− <literal>nixpkgs</literal> repository:
424+ To make life easier for our users, try to build every <link
425+ xlink:href="https://hex.pm">Hex</link> package and remove those that fail. To do that, simply run the following command in the root of your <literal>nixpkgs</literal> repository:
514426 </para>
515427
516428<screen>
@@ -518,11 +430,8 @@ analyze: build plt
518430</screen>
519431
520432 <para>
521− That will attempt to build every package in <literal>beamPackages</literal>.
522− Then manually remove those that fail. Hopefully, someone will improve
523− <link
524− xlink:href="https://github.com/erlang-nix/hex2nix">hex2nix</link>
525− in the future to automate the process.
433+ That will attempt to build every package in <literal>beamPackages</literal>. Then manually remove those that fail. Hopefully, someone will improve <link
434+ xlink:href="https://github.com/erlang-nix/hex2nix">hex2nix</link> in the future to automate the process.
526435 </para>
527436 </section>
528437</section>
doc/languages-frameworks/bower.xml+19−52
@@ -4,32 +4,22 @@
44 <title>Bower</title>
55
66 <para>
7− <link xlink:href="http://bower.io">Bower</link> is a package manager for web
8− site front-end components. Bower packages (comprising of build artefacts and
9− sometimes sources) are stored in <command>git</command> repositories,
10− typically on Github. The package registry is run by the Bower team with
11− package metadata coming from the <filename>bower.json</filename> file within
12− each package.
7+ <link xlink:href="http://bower.io">Bower</link> is a package manager for web site front-end components. Bower packages (comprising of build artefacts and sometimes sources) are stored in <command>git</command> repositories, typically on Github. The package registry is run by the Bower team with package metadata coming from the <filename>bower.json</filename> file within each package.
138 </para>
149
1510 <para>
16− The end result of running Bower is a <filename>bower_components</filename>
17− directory which can be included in the web app's build process.
11+ The end result of running Bower is a <filename>bower_components</filename> directory which can be included in the web app's build process.
1812 </para>
1913
2014 <para>
21− Bower can be run interactively, by installing
22− <varname>nodePackages.bower</varname>. More interestingly, the Bower
23− components can be declared in a Nix derivation, with the help of
24− <varname>nodePackages.bower2nix</varname>.
15+ Bower can be run interactively, by installing <varname>nodePackages.bower</varname>. More interestingly, the Bower components can be declared in a Nix derivation, with the help of <varname>nodePackages.bower2nix</varname>.
2516 </para>
2617
2718 <section xml:id="ssec-bower2nix-usage">
2819 <title><command>bower2nix</command> usage</title>
2920
3021 <para>
31− Suppose you have a <filename>bower.json</filename> with the following
32− contents:
22+ Suppose you have a <filename>bower.json</filename> with the following contents:
3323 <example xml:id="ex-bowerJson">
3424 <title><filename>bower.json</filename></title>
3525<programlisting language="json">
@@ -45,8 +35,7 @@
4535 </para>
4636
4737 <para>
48− Running <command>bower2nix</command> will produce something like the
49− following output:
38+ Running <command>bower2nix</command> will produce something like the following output:
5039<programlisting language="nix">
5140<![CDATA[{ fetchbower, buildEnv }:
5241buildEnv { name = "bower-env"; ignoreCollisions = true; paths = [
@@ -58,15 +47,11 @@ buildEnv { name = "bower-env"; ignoreCollisions = true; paths = [
5847 </para>
5948
6049 <para>
61− Using the <command>bower2nix</command> command line arguments, the output
62− can be redirected to a file. A name like
63− <filename>bower-packages.nix</filename> would be fine.
50+ Using the <command>bower2nix</command> command line arguments, the output can be redirected to a file. A name like <filename>bower-packages.nix</filename> would be fine.
6451 </para>
6552
6653 <para>
67− The resulting derivation is a union of all the downloaded Bower packages
68− (and their dependencies). To use it, they still need to be linked together
69− by Bower, which is where <varname>buildBowerComponents</varname> is useful.
54+ The resulting derivation is a union of all the downloaded Bower packages (and their dependencies). To use it, they still need to be linked together by Bower, which is where <varname>buildBowerComponents</varname> is useful.
7055 </para>
7156 </section>
7257
@@ -74,10 +59,7 @@ buildEnv { name = "bower-env"; ignoreCollisions = true; paths = [
7459 <title><varname>buildBowerComponents</varname> function</title>
7560
7661 <para>
77− The function is implemented in
78− <link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/bower-modules/generic/default.nix">
79− <filename>pkgs/development/bower-modules/generic/default.nix</filename></link>.
80− Example usage:
62+ The function is implemented in <link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/bower-modules/generic/default.nix"> <filename>pkgs/development/bower-modules/generic/default.nix</filename></link>. Example usage:
8163 <example xml:id="ex-buildBowerComponents">
8264 <title>buildBowerComponents</title>
8365<programlisting language="nix">
@@ -91,34 +73,27 @@ bowerComponents = buildBowerComponents {
9173 </para>
9274
9375 <para>
94− In <xref linkend="ex-buildBowerComponents" />, the following arguments are
95− of special significance to the function:
76+ In <xref linkend="ex-buildBowerComponents" />, the following arguments are of special significance to the function:
9677 <calloutlist>
9778 <callout arearefs="ex-buildBowerComponents-1">
9879 <para>
99− <varname>generated</varname> specifies the file which was created by
100− <command>bower2nix</command>.
80+ <varname>generated</varname> specifies the file which was created by <command>bower2nix</command>.
10181 </para>
10282 </callout>
10383 <callout arearefs="ex-buildBowerComponents-2">
10484 <para>
105− <varname>src</varname> is your project's sources. It needs to contain a
106− <filename>bower.json</filename> file.
85+ <varname>src</varname> is your project's sources. It needs to contain a <filename>bower.json</filename> file.
10786 </para>
10887 </callout>
10988 </calloutlist>
11089 </para>
11190
11291 <para>
113− <varname>buildBowerComponents</varname> will run Bower to link together the
114− output of <command>bower2nix</command>, resulting in a
115− <filename>bower_components</filename> directory which can be used.
92+ <varname>buildBowerComponents</varname> will run Bower to link together the output of <command>bower2nix</command>, resulting in a <filename>bower_components</filename> directory which can be used.
11693 </para>
11794
11895 <para>
119− Here is an example of a web frontend build process using
120− <command>gulp</command>. You might use <command>grunt</command>, or anything
121− else.
96+ Here is an example of a web frontend build process using <command>gulp</command>. You might use <command>grunt</command>, or anything else.
12297 </para>
12398
12499 <example xml:id="ex-bowerGulpFile">
@@ -174,21 +149,17 @@ pkgs.stdenv.mkDerivation {
174149 <calloutlist>
175150 <callout arearefs="ex-buildBowerComponentsDefault-1">
176151 <para>
177− The result of <varname>buildBowerComponents</varname> is an input to the
178− frontend build.
152+ The result of <varname>buildBowerComponents</varname> is an input to the frontend build.
179153 </para>
180154 </callout>
181155 <callout arearefs="ex-buildBowerComponentsDefault-2">
182156 <para>
183− Whether to symlink or copy the <filename>bower_components</filename>
184− directory depends on the build tool in use. In this case a copy is used
185− to avoid <command>gulp</command> silliness with permissions.
157+ Whether to symlink or copy the <filename>bower_components</filename> directory depends on the build tool in use. In this case a copy is used to avoid <command>gulp</command> silliness with permissions.
186158 </para>
187159 </callout>
188160 <callout arearefs="ex-buildBowerComponentsDefault-3">
189161 <para>
190− <command>gulp</command> requires <varname>HOME</varname> to refer to a
191− writeable directory.
162+ <command>gulp</command> requires <varname>HOME</varname> to refer to a writeable directory.
192163 </para>
193164 </callout>
194165 <callout arearefs="ex-buildBowerComponentsDefault-4">
@@ -210,17 +181,13 @@ pkgs.stdenv.mkDerivation {
210181 </term>
211182 <listitem>
212183 <para>
213− This means that Bower was looking for a package version which doesn't
214− exist in the generated <filename>bower-packages.nix</filename>.
184+ This means that Bower was looking for a package version which doesn't exist in the generated <filename>bower-packages.nix</filename>.
215185 </para>
216186 <para>
217− If <filename>bower.json</filename> has been updated, then run
218− <command>bower2nix</command> again.
187+ If <filename>bower.json</filename> has been updated, then run <command>bower2nix</command> again.
219188 </para>
220189 <para>
221− It could also be a bug in <command>bower2nix</command> or
222− <command>fetchbower</command>. If possible, try reformulating the version
223− specification in <filename>bower.json</filename>.
190+ It could also be a bug in <command>bower2nix</command> or <command>fetchbower</command>. If possible, try reformulating the version specification in <filename>bower.json</filename>.
224191 </para>
225192 </listitem>
226193 </varlistentry>
doc/languages-frameworks/coq.xml+4−16
@@ -4,31 +4,19 @@
44 <title>Coq</title>
55
66 <para>
7− Coq libraries should be installed in
8− <literal>$(out)/lib/coq/${coq.coq-version}/user-contrib/</literal>. Such
9− directories are automatically added to the <literal>$COQPATH</literal>
10− environment variable by the hook defined in the Coq derivation.
7+ Coq libraries should be installed in <literal>$(out)/lib/coq/${coq.coq-version}/user-contrib/</literal>. Such directories are automatically added to the <literal>$COQPATH</literal> environment variable by the hook defined in the Coq derivation.
118 </para>
129
1310 <para>
14− Some extensions (plugins) might require OCaml and sometimes other OCaml
15− packages. The <literal>coq.ocamlPackages</literal> attribute can be used to
16− depend on the same package set Coq was built against.
11+ Some extensions (plugins) might require OCaml and sometimes other OCaml packages. The <literal>coq.ocamlPackages</literal> attribute can be used to depend on the same package set Coq was built against.
1712 </para>
1813
1914 <para>
20− Coq libraries may be compatible with some specific versions of Coq only. The
21− <literal>compatibleCoqVersions</literal> attribute is used to precisely
22− select those versions of Coq that are compatible with this derivation.
15+ Coq libraries may be compatible with some specific versions of Coq only. The <literal>compatibleCoqVersions</literal> attribute is used to precisely select those versions of Coq that are compatible with this derivation.
2316 </para>
2417
2518 <para>
26− Here is a simple package example. It is a pure Coq library, thus it depends
27− on Coq. It builds on the Mathematical Components library, thus it also takes
28− <literal>mathcomp</literal> as <literal>buildInputs</literal>. Its
29− <literal>Makefile</literal> has been generated using
30− <literal>coq_makefile</literal> so we only have to set the
31− <literal>$COQLIB</literal> variable at install time.
19+ Here is a simple package example. It is a pure Coq library, thus it depends on Coq. It builds on the Mathematical Components library, thus it also takes <literal>mathcomp</literal> as <literal>buildInputs</literal>. Its <literal>Makefile</literal> has been generated using <literal>coq_makefile</literal> so we only have to set the <literal>$COQLIB</literal> variable at install time.
3220 </para>
3321
3422<programlisting>
doc/languages-frameworks/gnome.xml+30−155
@@ -5,53 +5,26 @@
55 <title>Packaging GNOME applications</title>
66
77 <para>
8− Programs in the GNOME universe are written in various languages but they all
9− use GObject-based libraries like GLib, GTK or GStreamer. These libraries are
10− often modular, relying on looking into certain directories to find their
11− modules. However, due to Nix’s specific file system organization, this
12− will fail without our intervention. Fortunately, the libraries usually allow
13− overriding the directories through environment variables, either natively or
14− thanks to a patch in nixpkgs.
15− <link xlink:href="#fun-wrapProgram">Wrapping</link> the executables to
16− ensure correct paths are available to the application constitutes a
17− significant part of packaging a modern desktop application. In this section,
18− we will describe various modules needed by such applications, environment
19− variables needed to make the modules load, and finally a script that will do
20− the work for us.
8+ Programs in the GNOME universe are written in various languages but they all use GObject-based libraries like GLib, GTK or GStreamer. These libraries are often modular, relying on looking into certain directories to find their modules. However, due to Nix’s specific file system organization, this will fail without our intervention. Fortunately, the libraries usually allow overriding the directories through environment variables, either natively or thanks to a patch in nixpkgs. <link xlink:href="#fun-wrapProgram">Wrapping</link> the executables to ensure correct paths are available to the application constitutes a significant part of packaging a modern desktop application. In this section, we will describe various modules needed by such applications, environment variables needed to make the modules load, and finally a script that will do the work for us.
219 </para>
2210
2311 <section xml:id="ssec-gnome-settings">
2412 <title>Settings</title>
2513
2614 <para>
27− <link xlink:href="https://developer.gnome.org/gio/stable/GSettings.html">GSettings</link>
28− API is often used for storing settings. GSettings schemas are required, to
29− know the type and other metadata of the stored values. GLib looks for
30− <filename>glib-2.0/schemas/gschemas.compiled</filename> files inside the
31− directories of <envar>XDG_DATA_DIRS</envar>.
15+ <link xlink:href="https://developer.gnome.org/gio/stable/GSettings.html">GSettings</link> API is often used for storing settings. GSettings schemas are required, to know the type and other metadata of the stored values. GLib looks for <filename>glib-2.0/schemas/gschemas.compiled</filename> files inside the directories of <envar>XDG_DATA_DIRS</envar>.
3216 </para>
3317
3418 <para>
35− On Linux, GSettings API is implemented using
36− <link xlink:href="https://wiki.gnome.org/Projects/dconf">dconf</link>
37− backend. You will need to add <literal>dconf</literal> GIO module to
38− <envar>GIO_EXTRA_MODULES</envar> variable, otherwise the
39− <literal>memory</literal> backend will be used and the saved settings will
40− not be persistent.
19+ On Linux, GSettings API is implemented using <link xlink:href="https://wiki.gnome.org/Projects/dconf">dconf</link> backend. You will need to add <literal>dconf</literal> GIO module to <envar>GIO_EXTRA_MODULES</envar> variable, otherwise the <literal>memory</literal> backend will be used and the saved settings will not be persistent.
4120 </para>
4221
4322 <para>
44− Last you will need the dconf database D-Bus service itself. You can enable
45− it using <option>programs.dconf.enable</option>.
23+ Last you will need the dconf database D-Bus service itself. You can enable it using <option>programs.dconf.enable</option>.
4624 </para>
4725
4826 <para>
49− Some applications will also require
50− <package>gsettings-desktop-schemas</package> for things like reading proxy
51− configuration or user interface customization. This dependency is often not
52− mentioned by upstream, you should grep for
53− <literal>org.gnome.desktop</literal> and
54− <literal>org.gnome.system</literal> to see if the schemas are needed.
27+ Some applications will also require <package>gsettings-desktop-schemas</package> for things like reading proxy configuration or user interface customization. This dependency is often not mentioned by upstream, you should grep for <literal>org.gnome.desktop</literal> and <literal>org.gnome.system</literal> to see if the schemas are needed.
5528 </para>
5629 </section>
5730
@@ -59,16 +32,7 @@
5932 <title>Icons</title>
6033
6134 <para>
62− When an application uses icons, an icon theme should be available in
63− <envar>XDG_DATA_DIRS</envar>. The package for the default, icon-less
64− <link xlink:href="https://www.freedesktop.org/wiki/Software/icon-theme/">hicolor-icon-theme</link>
65− contains <link linkend="ssec-gnome-hooks-hicolor-icon-theme">a setup
66− hook</link> that will pick up icon themes from
67− <literal>buildInputs</literal> and pass it to our wrapper. Unfortunately,
68− relying on that would mean every user has to download the theme included in
69− the package expression no matter their preference. For that reason, we
70− leave the installation of icon theme on the user. If you use one of the
71− desktop environments, you probably already have an icon theme installed.
35+ When an application uses icons, an icon theme should be available in <envar>XDG_DATA_DIRS</envar>. The package for the default, icon-less <link xlink:href="https://www.freedesktop.org/wiki/Software/icon-theme/">hicolor-icon-theme</link> contains <link linkend="ssec-gnome-hooks-hicolor-icon-theme">a setup hook</link> that will pick up icon themes from <literal>buildInputs</literal> and pass it to our wrapper. Unfortunately, relying on that would mean every user has to download the theme included in the package expression no matter their preference. For that reason, we leave the installation of icon theme on the user. If you use one of the desktop environments, you probably already have an icon theme installed.
7236 </para>
7337 </section>
7438
@@ -76,12 +40,7 @@
7640 <title>GTK Themes</title>
7741
7842 <para>
79− Previously, a GTK theme needed to be in <envar>XDG_DATA_DIRS</envar>. This
80− is no longer necessary for most programs since GTK incorporated Adwaita
81− theme. Some programs (for example, those designed for
82− <link xlink:href="https://elementary.io/docs/human-interface-guidelines#human-interface-guidelines">elementary
83− HIG</link>) might require a special theme like
84− <package>pantheon.elementary-gtk-theme</package>.
43+ Previously, a GTK theme needed to be in <envar>XDG_DATA_DIRS</envar>. This is no longer necessary for most programs since GTK incorporated Adwaita theme. Some programs (for example, those designed for <link xlink:href="https://elementary.io/docs/human-interface-guidelines#human-interface-guidelines">elementary HIG</link>) might require a special theme like <package>pantheon.elementary-gtk-theme</package>.
8544 </para>
8645 </section>
8746
@@ -89,10 +48,7 @@
8948 <title>GObject introspection typelibs</title>
9049
9150 <para>
92− <link xlink:href="https://wiki.gnome.org/Projects/GObjectIntrospection">GObject
93− introspection</link> allows applications to use C libraries in other
94− languages easily. It does this through <literal>typelib</literal> files
95− searched in <envar>GI_TYPELIB_PATH</envar>.
51+ <link xlink:href="https://wiki.gnome.org/Projects/GObjectIntrospection">GObject introspection</link> allows applications to use C libraries in other languages easily. It does this through <literal>typelib</literal> files searched in <envar>GI_TYPELIB_PATH</envar>.
9652 </para>
9753 </section>
9854
@@ -100,11 +56,7 @@
10056 <title>Various plug-ins</title>
10157
10258 <para>
103− If your application uses
104− <link xlink:href="https://gstreamer.freedesktop.org/">GStreamer</link> or
105− <link xlink:href="https://wiki.gnome.org/Projects/Grilo">Grilo</link>, you
106− should set <envar>GST_PLUGIN_SYSTEM_PATH_1_0</envar> and
107− <envar>GRL_PLUGIN_PATH</envar>, respectively.
59+ If your application uses <link xlink:href="https://gstreamer.freedesktop.org/">GStreamer</link> or <link xlink:href="https://wiki.gnome.org/Projects/Grilo">Grilo</link>, you should set <envar>GST_PLUGIN_SYSTEM_PATH_1_0</envar> and <envar>GRL_PLUGIN_PATH</envar>, respectively.
10860 </para>
10961 </section>
11062 </section>
@@ -113,8 +65,7 @@
11365 <title>Onto <package>wrapGAppsHook</package></title>
11466
11567 <para>
116− Given the requirements above, the package expression would become messy
117− quickly:
68+ Given the requirements above, the package expression would become messy quickly:
11869<programlisting>
11970preFixup = ''
12071 for f in $(find $out/bin/ $out/libexec/ -type f -executable); do
@@ -128,76 +79,48 @@ preFixup = ''
12879 done
12980'';
13081</programlisting>
131− Fortunately, there is <package>wrapGAppsHook</package>, that does the
132− wrapping for us. In particular, it works in conjunction with other setup
133− hooks that will populate the variable:
82+ Fortunately, there is <package>wrapGAppsHook</package>, that does the wrapping for us. In particular, it works in conjunction with other setup hooks that will populate the variable:
13483 <itemizedlist>
13584 <listitem xml:id="ssec-gnome-hooks-wrapgappshook">
13685 <para>
137− <package>wrapGAppsHook</package> itself will add the package’s
138− <filename>share</filename> directory to <envar>XDG_DATA_DIRS</envar>.
86+ <package>wrapGAppsHook</package> itself will add the package’s <filename>share</filename> directory to <envar>XDG_DATA_DIRS</envar>.
13987 </para>
14088 </listitem>
14189 <listitem xml:id="ssec-gnome-hooks-glib">
14290 <para>
143− <package>glib</package> setup hook will populate
144− <envar>GSETTINGS_SCHEMAS_PATH</envar> and then
145− <package>wrapGAppsHook</package> will prepend it to
146− <envar>XDG_DATA_DIRS</envar>.
91+ <package>glib</package> setup hook will populate <envar>GSETTINGS_SCHEMAS_PATH</envar> and then <package>wrapGAppsHook</package> will prepend it to <envar>XDG_DATA_DIRS</envar>.
14792 </para>
14893 </listitem>
14994 <listitem xml:id="ssec-gnome-hooks-dconf">
15095 <para>
151− <package>gnome3.dconf.lib</package> is a dependency of
152− <package>wrapGAppsHook</package>, which then also adds it to the
153− <envar>GIO_EXTRA_MODULES</envar> variable.
96+ <package>gnome3.dconf.lib</package> is a dependency of <package>wrapGAppsHook</package>, which then also adds it to the <envar>GIO_EXTRA_MODULES</envar> variable.
15497 </para>
15598 </listitem>
15699 <listitem xml:id="ssec-gnome-hooks-hicolor-icon-theme">
157100 <para>
158− <package>hicolor-icon-theme</package>’s setup hook will add icon themes
159− to <envar>XDG_ICON_DIRS</envar> which is prepended to
160− <envar>XDG_DATA_DIRS</envar> by <package>wrapGAppsHook</package>.
101+ <package>hicolor-icon-theme</package>’s setup hook will add icon themes to <envar>XDG_ICON_DIRS</envar> which is prepended to <envar>XDG_DATA_DIRS</envar> by <package>wrapGAppsHook</package>.
161102 </para>
162103 </listitem>
163104 <listitem xml:id="ssec-gnome-hooks-gobject-introspection">
164105 <para>
165− <package>gobject-introspection</package> setup hook populates
166− <envar>GI_TYPELIB_PATH</envar> variable with
167− <filename>lib/girepository-1.0</filename> directories of dependencies,
168− which is then added to wrapper by <package>wrapGAppsHook</package>. It
169− also adds <filename>share</filename> directories of dependencies to
170− <envar>XDG_DATA_DIRS</envar>, which is intended to promote GIR files but
171− it also
172− <link xlink:href="https://github.com/NixOS/nixpkgs/issues/32790">pollutes
173− the closures</link> of packages using <package>wrapGAppsHook</package>.
106+ <package>gobject-introspection</package> setup hook populates <envar>GI_TYPELIB_PATH</envar> variable with <filename>lib/girepository-1.0</filename> directories of dependencies, which is then added to wrapper by <package>wrapGAppsHook</package>. It also adds <filename>share</filename> directories of dependencies to <envar>XDG_DATA_DIRS</envar>, which is intended to promote GIR files but it also <link xlink:href="https://github.com/NixOS/nixpkgs/issues/32790">pollutes the closures</link> of packages using <package>wrapGAppsHook</package>.
174107 </para>
175108 <warning>
176109 <para>
177− The setup hook
178− <link xlink:href="https://github.com/NixOS/nixpkgs/issues/56943">currently</link>
179− does not work in expressions with <literal>strictDeps</literal> enabled,
180− like Python packages. In those cases, you will need to disable it with
181− <code>strictDeps = false;</code>.
110+ The setup hook <link xlink:href="https://github.com/NixOS/nixpkgs/issues/56943">currently</link> does not work in expressions with <literal>strictDeps</literal> enabled, like Python packages. In those cases, you will need to disable it with <code>strictDeps = false;</code>.
182111 </para>
183112 </warning>
184113 </listitem>
185114 <listitem xml:id="ssec-gnome-hooks-gst-grl-plugins">
186115 <para>
187− Setup hooks of <package>gst_all_1.gstreamer</package> and
188− <package>gnome3.grilo</package> will populate the
189− <envar>GST_PLUGIN_SYSTEM_PATH_1_0</envar> and
190− <envar>GRL_PLUGIN_PATH</envar> variables, respectively, which will then
191− be added to the wrapper by <literal>wrapGAppsHook</literal>.
116+ Setup hooks of <package>gst_all_1.gstreamer</package> and <package>gnome3.grilo</package> will populate the <envar>GST_PLUGIN_SYSTEM_PATH_1_0</envar> and <envar>GRL_PLUGIN_PATH</envar> variables, respectively, which will then be added to the wrapper by <literal>wrapGAppsHook</literal>.
192117 </para>
193118 </listitem>
194119 </itemizedlist>
195120 </para>
196121
197122 <para>
198− You can also pass additional arguments to <literal>makeWrapper</literal>
199− using <literal>gappsWrapperArgs</literal> in <literal>preFixup</literal>
200− hook:
123+ You can also pass additional arguments to <literal>makeWrapper</literal> using <literal>gappsWrapperArgs</literal> in <literal>preFixup</literal> hook:
201124<programlisting>
202125preFixup = ''
203126 gappsWrapperArgs+=(
@@ -215,13 +138,7 @@ preFixup = ''
215138 <title>Updating GNOME packages</title>
216139
217140 <para>
218− Most GNOME package offer
219− <link linkend="var-passthru-updateScript"><literal>updateScript</literal></link>,
220− it is therefore possible to update to latest source tarball by running
221− <command>nix-shell maintainers/scripts/update.nix --argstr package
222− gnome3.nautilus</command> or even en masse with <command>nix-shell
223− maintainers/scripts/update.nix --argstr path gnome3</command>. Read the
224− package’s <filename>NEWS</filename> file to see what changed.
141+ Most GNOME package offer <link linkend="var-passthru-updateScript"><literal>updateScript</literal></link>, it is therefore possible to update to latest source tarball by running <command>nix-shell maintainers/scripts/update.nix --argstr package gnome3.nautilus</command> or even en masse with <command>nix-shell maintainers/scripts/update.nix --argstr path gnome3</command>. Read the package’s <filename>NEWS</filename> file to see what changed.
225142 </para>
226143 </section>
227144
@@ -235,17 +152,7 @@ preFixup = ''
235152 </term>
236153 <listitem>
237154 <para>
238− There are no schemas avalable in <envar>XDG_DATA_DIRS</envar>.
239− Temporarily add a random package containing schemas like
240− <package>gsettings-desktop-schemas</package> to
241− <literal>buildInputs</literal>.
242− <link linkend="ssec-gnome-hooks-glib"><package>glib</package></link> and
243− <link linkend="ssec-gnome-hooks-wrapgappshook"><package>wrapGAppsHook</package></link>
244− setup hooks will take care of making the schemas available to application
245− and you will see the actual missing schemas with the
246− <link linkend="ssec-gnome-common-issues-missing-schema">next
247− error</link>. Or you can try looking through the source code for the
248− actual schemas used.
155+ There are no schemas avalable in <envar>XDG_DATA_DIRS</envar>. Temporarily add a random package containing schemas like <package>gsettings-desktop-schemas</package> to <literal>buildInputs</literal>. <link linkend="ssec-gnome-hooks-glib"><package>glib</package></link> and <link linkend="ssec-gnome-hooks-wrapgappshook"><package>wrapGAppsHook</package></link> setup hooks will take care of making the schemas available to application and you will see the actual missing schemas with the <link linkend="ssec-gnome-common-issues-missing-schema">next error</link>. Or you can try looking through the source code for the actual schemas used.
249156 </para>
250157 </listitem>
251158 </varlistentry>
@@ -255,11 +162,7 @@ preFixup = ''
255162 </term>
256163 <listitem>
257164 <para>
258− Package is missing some GSettings schemas. You can find out the package
259− containing the schema with <command>nix-locate
260− <replaceable>org.gnome.foo</replaceable>.gschema.xml</command> and let
261− the hooks handle the wrapping as
262− <link linkend="ssec-gnome-common-issues-no-schemas">above</link>.
165+ Package is missing some GSettings schemas. You can find out the package containing the schema with <command>nix-locate <replaceable>org.gnome.foo</replaceable>.gschema.xml</command> and let the hooks handle the wrapping as <link linkend="ssec-gnome-common-issues-no-schemas">above</link>.
263166 </para>
264167 </listitem>
265168 </varlistentry>
@@ -269,14 +172,7 @@ preFixup = ''
269172 </term>
270173 <listitem>
271174 <para>
272− This is because derivers like
273− <function>python.pkgs.buildPythonApplication</function> or
274− <function>qt5.mkDerivation</function> have setup-hooks automatically
275− added that produce wrappers with <package>makeWrapper</package>. The
276− simplest way to workaround that is to disable the
277− <package>wrapGAppsHook</package> automatic wrapping with
278− <code>dontWrapGApps = true;</code> and pass the arguments it intended to
279− pass to <package>makeWrapper</package> to another.
175+ This is because derivers like <function>python.pkgs.buildPythonApplication</function> or <function>qt5.mkDerivation</function> have setup-hooks automatically added that produce wrappers with <package>makeWrapper</package>. The simplest way to workaround that is to disable the <package>wrapGAppsHook</package> automatic wrapping with <code>dontWrapGApps = true;</code> and pass the arguments it intended to pass to <package>makeWrapper</package> to another.
280176 </para>
281177 <para>
282178 In the case of a Python application it could look like:
@@ -328,55 +224,34 @@ mkDerivation {
328224 </term>
329225 <listitem>
330226 <para>
331− You can rely on applications depending on the library set the necessary
332− environment variables but that it often easy to miss. Instead we
333− recommend to patch the paths in the source code whenever possible. Here
334− are some examples:
227+ You can rely on applications depending on the library set the necessary environment variables but that it often easy to miss. Instead we recommend to patch the paths in the source code whenever possible. Here are some examples:
335228 <itemizedlist>
336229 <listitem xml:id="ssec-gnome-common-issues-unwrappable-package-gnome-shell-ext">
337230 <para>
338− <link xlink:href="https://github.com/NixOS/nixpkgs/blob/7bb8f05f12ca3cff9da72b56caa2f7472d5732bc/pkgs/desktops/gnome-3/core/gnome-shell-extensions/default.nix#L21-L24">Replacing
339− a <envar>GI_TYPELIB_PATH</envar> in GNOME Shell extension</link> –
340− we are using <function>substituteAll</function> to include the path to
341− a typelib into a patch.
231+ <link xlink:href="https://github.com/NixOS/nixpkgs/blob/7bb8f05f12ca3cff9da72b56caa2f7472d5732bc/pkgs/desktops/gnome-3/core/gnome-shell-extensions/default.nix#L21-L24">Replacing a <envar>GI_TYPELIB_PATH</envar> in GNOME Shell extension</link> – we are using <function>substituteAll</function> to include the path to a typelib into a patch.
342232 </para>
343233 </listitem>
344234 <listitem xml:id="ssec-gnome-common-issues-unwrappable-package-gsettings">
345235 <para>
346− The following examples are hardcoding GSettings schema paths. To get
347− the schema paths we use the functions
236+ The following examples are hardcoding GSettings schema paths. To get the schema paths we use the functions
348237 <itemizedlist>
349238 <listitem>
350239 <para>
351− <function>glib.getSchemaPath</function> Takes a nix package
352− attribute as an argument.
240+ <function>glib.getSchemaPath</function> Takes a nix package attribute as an argument.
353241 </para>
354242 </listitem>
355243 <listitem>
356244 <para>
357− <function>glib.makeSchemaPath</function> Takes a package output
358− like <literal>$out</literal> and a derivation name. You should use
359− this if the schemas you need to hardcode are in the same
360− derivation.
245+ <function>glib.makeSchemaPath</function> Takes a package output like <literal>$out</literal> and a derivation name. You should use this if the schemas you need to hardcode are in the same derivation.
361246 </para>
362247 </listitem>
363248 </itemizedlist>
364249 </para>
365250 <para xml:id="ssec-gnome-common-issues-unwrappable-package-gsettings-vala">
366− <link xlink:href="https://github.com/NixOS/nixpkgs/blob/7bb8f05f12ca3cff9da72b56caa2f7472d5732bc/pkgs/desktops/pantheon/apps/elementary-files/default.nix#L78-L86">Hard-coding
367− GSettings schema path in Vala plug-in (dynamically loaded
368− library)</link> – here, <function>substituteAll</function> cannot be
369− used since the schema comes from the same package preventing us from
370− pass its path to the function, probably due to a
371− <link xlink:href="https://github.com/NixOS/nix/issues/1846">Nix
372− bug</link>.
251+ <link xlink:href="https://github.com/NixOS/nixpkgs/blob/7bb8f05f12ca3cff9da72b56caa2f7472d5732bc/pkgs/desktops/pantheon/apps/elementary-files/default.nix#L78-L86">Hard-coding GSettings schema path in Vala plug-in (dynamically loaded library)</link> – here, <function>substituteAll</function> cannot be used since the schema comes from the same package preventing us from pass its path to the function, probably due to a <link xlink:href="https://github.com/NixOS/nix/issues/1846">Nix bug</link>.
373252 </para>
374253 <para xml:id="ssec-gnome-common-issues-unwrappable-package-gsettings-c">
375− <link xlink:href="https://github.com/NixOS/nixpkgs/blob/29c120c065d03b000224872251bed93932d42412/pkgs/development/libraries/glib-networking/default.nix#L31-L34">Hard-coding
376− GSettings schema path in C library</link> – nothing special other
377− than using
378− <link xlink:href="https://github.com/NixOS/nixpkgs/pull/67957#issuecomment-527717467">Coccinelle
379− patch</link> to generate the patch itself.
254+ <link xlink:href="https://github.com/NixOS/nixpkgs/blob/29c120c065d03b000224872251bed93932d42412/pkgs/development/libraries/glib-networking/default.nix#L31-L34">Hard-coding GSettings schema path in C library</link> – nothing special other than using <link xlink:href="https://github.com/NixOS/nixpkgs/pull/67957#issuecomment-527717467">Coccinelle patch</link> to generate the patch itself.
380255 </para>
381256 </listitem>
382257 </itemizedlist>
doc/languages-frameworks/go.xml+19−54
@@ -7,21 +7,16 @@
77 <title>Go modules</title>
88
99 <para>
10− The function <varname> buildGoModule </varname> builds Go programs managed
11− with Go modules. It builds a
12− <link xlink:href="https://github.com/golang/go/wiki/Modules">Go
13− modules</link> through a two phase build:
10+ The function <varname> buildGoModule </varname> builds Go programs managed with Go modules. It builds a <link xlink:href="https://github.com/golang/go/wiki/Modules">Go modules</link> through a two phase build:
1411 <itemizedlist>
1512 <listitem>
1613 <para>
17− An intermediate fetcher derivation. This derivation will be used to fetch
18− all of the dependencies of the Go module.
14+ An intermediate fetcher derivation. This derivation will be used to fetch all of the dependencies of the Go module.
1915 </para>
2016 </listitem>
2117 <listitem>
2218 <para>
23− A final derivation will use the output of the intermediate derivation to
24− build the binaries and produce the final output.
19+ A final derivation will use the output of the intermediate derivation to build the binaries and produce the final output.
2520 </para>
2621 </listitem>
2722 </itemizedlist>
@@ -57,21 +52,16 @@ pet = buildGoModule rec {
5752 </example>
5853
5954 <para>
60− <xref linkend='ex-buildGoModule'/> is an example expression using
61− buildGoModule, the following arguments are of special significance to the
62− function:
55+ <xref linkend='ex-buildGoModule'/> is an example expression using buildGoModule, the following arguments are of special significance to the function:
6356 <calloutlist>
6457 <callout arearefs='ex-buildGoModule-1'>
6558 <para>
66− <varname>modSha256</varname> is the hash of the output of the
67− intermediate fetcher derivation.
59+ <varname>modSha256</varname> is the hash of the output of the intermediate fetcher derivation.
6860 </para>
6961 </callout>
7062 <callout arearefs='ex-buildGoModule-2'>
7163 <para>
72− <varname>subPackages</varname> limits the builder from building child
73− packages that have not been listed. If <varname>subPackages</varname> is
74− not specified, all child packages will be built.
64+ <varname>subPackages</varname> limits the builder from building child packages that have not been listed. If <varname>subPackages</varname> is not specified, all child packages will be built.
7565 </para>
7666 </callout>
7767 </calloutlist>
@@ -82,8 +72,7 @@ pet = buildGoModule rec {
8272 <title>Go legacy</title>
8373
8474 <para>
85− The function <varname> buildGoPackage </varname> builds legacy Go programs,
86− not supporting Go modules.
75+ The function <varname> buildGoPackage </varname> builds legacy Go programs, not supporting Go modules.
8776 </para>
8877
8978 <example xml:id='ex-buildGoPackage'>
@@ -111,49 +100,36 @@ deis = buildGoPackage rec {
111100 </example>
112101
113102 <para>
114− <xref linkend='ex-buildGoPackage'/> is an example expression using
115− buildGoPackage, the following arguments are of special significance to the
116− function:
103+ <xref linkend='ex-buildGoPackage'/> is an example expression using buildGoPackage, the following arguments are of special significance to the function:
117104 <calloutlist>
118105 <callout arearefs='ex-buildGoPackage-1'>
119106 <para>
120− <varname>goPackagePath</varname> specifies the package's canonical Go
121− import path.
107+ <varname>goPackagePath</varname> specifies the package's canonical Go import path.
122108 </para>
123109 </callout>
124110 <callout arearefs='ex-buildGoPackage-2'>
125111 <para>
126− <varname>subPackages</varname> limits the builder from building child
127− packages that have not been listed. If <varname>subPackages</varname> is
128− not specified, all child packages will be built.
112+ <varname>subPackages</varname> limits the builder from building child packages that have not been listed. If <varname>subPackages</varname> is not specified, all child packages will be built.
129113 </para>
130114 <para>
131− In this example only <literal>github.com/deis/deis/client</literal> will
132− be built.
115+ In this example only <literal>github.com/deis/deis/client</literal> will be built.
133116 </para>
134117 </callout>
135118 <callout arearefs='ex-buildGoPackage-3'>
136119 <para>
137− <varname>goDeps</varname> is where the Go dependencies of a Go program
138− are listed as a list of package source identified by Go import path. It
139− could be imported as a separate <varname>deps.nix</varname> file for
140− readability. The dependency data structure is described below.
120+ <varname>goDeps</varname> is where the Go dependencies of a Go program are listed as a list of package source identified by Go import path. It could be imported as a separate <varname>deps.nix</varname> file for readability. The dependency data structure is described below.
141121 </para>
142122 </callout>
143123 <callout arearefs='ex-buildGoPackage-4'>
144124 <para>
145− <varname>buildFlags</varname> is a list of flags passed to the go build
146− command.
125+ <varname>buildFlags</varname> is a list of flags passed to the go build command.
147126 </para>
148127 </callout>
149128 </calloutlist>
150129 </para>
151130
152131 <para>
153− The <varname>goDeps</varname> attribute can be imported from a separate
154− <varname>nix</varname> file that defines which Go libraries are needed and
155− should be included in <varname>GOPATH</varname> for
156− <varname>buildPhase</varname>.
132+ The <varname>goDeps</varname> attribute can be imported from a separate <varname>nix</varname> file that defines which Go libraries are needed and should be included in <varname>GOPATH</varname> for <varname>buildPhase</varname>.
157133 </para>
158134
159135 <example xml:id='ex-goDeps'>
@@ -196,27 +172,18 @@ deis = buildGoPackage rec {
196172 </callout>
197173 <callout arearefs='ex-goDeps-3'>
198174 <para>
199− <varname>fetch type</varname> that needs to be used to get package
200− source. If <varname>git</varname> is used there should be
201− <varname>url</varname>, <varname>rev</varname> and
202− <varname>sha256</varname> defined next to it.
175+ <varname>fetch type</varname> that needs to be used to get package source. If <varname>git</varname> is used there should be <varname>url</varname>, <varname>rev</varname> and <varname>sha256</varname> defined next to it.
203176 </para>
204177 </callout>
205178 </calloutlist>
206179 </para>
207180
208181 <para>
209− To extract dependency information from a Go package in automated way use
210− <link xlink:href="https://github.com/kamilchm/go2nix">go2nix</link>. It can
211− produce complete derivation and <varname>goDeps</varname> file for Go
212− programs.
182+ To extract dependency information from a Go package in automated way use <link xlink:href="https://github.com/kamilchm/go2nix">go2nix</link>. It can produce complete derivation and <varname>goDeps</varname> file for Go programs.
213183 </para>
214184
215185 <para>
216− <varname>buildGoPackage</varname> produces
217− <xref linkend='chap-multiple-output' xrefstyle="select: title" /> where
218− <varname>bin</varname> includes program binaries. You can test build a Go
219− binary as follows:
186+ <varname>buildGoPackage</varname> produces <xref linkend='chap-multiple-output' xrefstyle="select: title" /> where <varname>bin</varname> includes program binaries. You can test build a Go binary as follows:
220187<screen>
221188<prompt>$ </prompt>nix-build -A deis.bin
222189</screen>
@@ -224,13 +191,11 @@ deis = buildGoPackage rec {
224191<screen>
225192<prompt>$ </prompt>nix-build -A deis.all
226193</screen>
227− <varname>bin</varname> output will be installed by default with
228− <varname>nix-env -i</varname> or <varname>systemPackages</varname>.
194+ <varname>bin</varname> output will be installed by default with <varname>nix-env -i</varname> or <varname>systemPackages</varname>.
229195 </para>
230196
231197 <para>
232− You may use Go packages installed into the active Nix profiles by adding the
233− following to your ~/.bashrc:
198+ You may use Go packages installed into the active Nix profiles by adding the following to your ~/.bashrc:
234199<screen>
235200for p in $NIX_PROFILES; do
236201 GOPATH="$p/share/go:$GOPATH"
doc/languages-frameworks/index.xml+1−6
@@ -3,12 +3,7 @@
33 xml:id="chap-language-support">
44 <title>Support for specific programming languages and frameworks</title>
55 <para>
6− The <link linkend="chap-stdenv">standard build environment</link> makes it
7− easy to build typical Autotools-based packages with very little code. Any
8− other kind of package can be accomodated by overriding the appropriate phases
9− of <literal>stdenv</literal>. However, there are specialised functions in
10− Nixpkgs to easily build packages for other programming languages, such as
11− Perl or Haskell. These are described in this chapter.
6+ The <link linkend="chap-stdenv">standard build environment</link> makes it easy to build typical Autotools-based packages with very little code. Any other kind of package can be accomodated by overriding the appropriate phases of <literal>stdenv</literal>. However, there are specialised functions in Nixpkgs to easily build packages for other programming languages, such as Perl or Haskell. These are described in this chapter.
127 </para>
138 <xi:include href="android.section.xml" />
149 <xi:include href="beam.xml" />
doc/languages-frameworks/java.xml+9−31
@@ -15,37 +15,24 @@ stdenv.mkDerivation {
1515 buildPhase = "ant";
1616}
1717</programlisting>
18− Note that <varname>jdk</varname> is an alias for the OpenJDK (self-built
19− where available, or pre-built via Zulu). Platforms with OpenJDK not (yet) in
20− Nixpkgs (<literal>Aarch32</literal>, <literal>Aarch64</literal>) point to the
21− (unfree) <literal>oraclejdk</literal>.
18+ Note that <varname>jdk</varname> is an alias for the OpenJDK (self-built where available, or pre-built via Zulu). Platforms with OpenJDK not (yet) in Nixpkgs (<literal>Aarch32</literal>, <literal>Aarch64</literal>) point to the (unfree) <literal>oraclejdk</literal>.
2219 </para>
2320
2421 <para>
25− JAR files that are intended to be used by other packages should be installed
26− in <filename>$out/share/java</filename>. JDKs have a stdenv setup hook that
27− add any JARs in the <filename>share/java</filename> directories of the build
28− inputs to the <envar>CLASSPATH</envar> environment variable. For instance, if
29− the package <literal>libfoo</literal> installs a JAR named
30− <filename>foo.jar</filename> in its <filename>share/java</filename>
31− directory, and another package declares the attribute
22+ JAR files that are intended to be used by other packages should be installed in <filename>$out/share/java</filename>. JDKs have a stdenv setup hook that add any JARs in the <filename>share/java</filename> directories of the build inputs to the <envar>CLASSPATH</envar> environment variable. For instance, if the package <literal>libfoo</literal> installs a JAR named <filename>foo.jar</filename> in its <filename>share/java</filename> directory, and another package declares the attribute
3223<programlisting>
3324buildInputs = [ libfoo ];
3425nativeBuildInputs = [ jdk ];
3526</programlisting>
36− then <envar>CLASSPATH</envar> will be set to
37− <filename>/nix/store/...-libfoo/share/java/foo.jar</filename>.
27+ then <envar>CLASSPATH</envar> will be set to <filename>/nix/store/...-libfoo/share/java/foo.jar</filename>.
3828 </para>
3929
4030 <para>
41− Private JARs should be installed in a location like
42− <filename>$out/share/<replaceable>package-name</replaceable></filename>.
31+ Private JARs should be installed in a location like <filename>$out/share/<replaceable>package-name</replaceable></filename>.
4332 </para>
4433
4534 <para>
46− If your Java package provides a program, you need to generate a wrapper
47− script to run it using the OpenJRE. You can use
48− <literal>makeWrapper</literal> for this:
35+ If your Java package provides a program, you need to generate a wrapper script to run it using the OpenJRE. You can use <literal>makeWrapper</literal> for this:
4936<programlisting>
5037nativeBuildInputs = [ makeWrapper ];
5138
@@ -56,30 +43,21 @@ installPhase =
5643 --add-flags "-cp $out/share/java/foo.jar org.foo.Main"
5744 '';
5845</programlisting>
59− Note the use of <literal>jre</literal>, which is the part of the OpenJDK
60− package that contains the Java Runtime Environment. By using
61− <literal>${jre}/bin/java</literal> instead of
62− <literal>${jdk}/bin/java</literal>, you prevent your package from depending
63− on the JDK at runtime.
46+ Note the use of <literal>jre</literal>, which is the part of the OpenJDK package that contains the Java Runtime Environment. By using <literal>${jre}/bin/java</literal> instead of <literal>${jdk}/bin/java</literal>, you prevent your package from depending on the JDK at runtime.
6447 </para>
6548
6649 <para>
67− Note all JDKs passthru <literal>home</literal>, so if your application
68− requires environment variables like <envar>JAVA_HOME</envar> being set, that
69− can be done in a generic fashion with the <literal>--set</literal> argument
70− of <literal>makeWrapper</literal>:
50+ Note all JDKs passthru <literal>home</literal>, so if your application requires environment variables like <envar>JAVA_HOME</envar> being set, that can be done in a generic fashion with the <literal>--set</literal> argument of <literal>makeWrapper</literal>:
7151<programlisting>
7252--set JAVA_HOME ${jdk.home}
7353</programlisting>
7454 </para>
7555
7656 <para>
77− It is possible to use a different Java compiler than <command>javac</command>
78− from the OpenJDK. For instance, to use the GNU Java Compiler:
57+ It is possible to use a different Java compiler than <command>javac</command> from the OpenJDK. For instance, to use the GNU Java Compiler:
7958<programlisting>
8059nativeBuildInputs = [ gcj ant ];
8160</programlisting>
82− Here, Ant will automatically use <command>gij</command> (the GNU Java
83− Runtime) instead of the OpenJRE.
61+ Here, Ant will automatically use <command>gij</command> (the GNU Java Runtime) instead of the OpenJRE.
8462 </para>
8563</section>
doc/languages-frameworks/lua.xml+4−16
@@ -4,18 +4,11 @@
44 <title>Lua</title>
55
66 <para>
7− Lua packages are built by the <varname>buildLuaPackage</varname> function.
8− This function is implemented in
9− <link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/lua-modules/generic/default.nix">
10− <filename>pkgs/development/lua-modules/generic/default.nix</filename></link>
11− and works similarly to <varname>buildPerlPackage</varname>. (See
12− <xref linkend="sec-language-perl"/> for details.)
7+ Lua packages are built by the <varname>buildLuaPackage</varname> function. This function is implemented in <link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/lua-modules/generic/default.nix"> <filename>pkgs/development/lua-modules/generic/default.nix</filename></link> and works similarly to <varname>buildPerlPackage</varname>. (See <xref linkend="sec-language-perl"/> for details.)
138 </para>
149
1510 <para>
16− Lua packages are defined in
17− <link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/lua-packages.nix"><filename>pkgs/top-level/lua-packages.nix</filename></link>.
18− Most of them are simple. For example:
11+ Lua packages are defined in <link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/lua-packages.nix"><filename>pkgs/top-level/lua-packages.nix</filename></link>. Most of them are simple. For example:
1912<programlisting>
2013fileSystem = buildLuaPackage {
2114 name = "filesystem-1.6.2";
@@ -33,16 +26,11 @@ fileSystem = buildLuaPackage {
3326 </para>
3427
3528 <para>
36− Though, more complicated package should be placed in a seperate file in
37− <link
29+ Though, more complicated package should be placed in a seperate file in <link
3830 xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/lua-modules"><filename>pkgs/development/lua-modules</filename></link>.
3931 </para>
4032
4133 <para>
42− Lua packages accept additional parameter <varname>disabled</varname>, which
43− defines the condition of disabling package from luaPackages. For example, if
44− package has <varname>disabled</varname> assigned to <literal>lua.luaversion
45− != "5.1"</literal>, it will not be included in any luaPackages except
46− lua51Packages, making it only be built for lua 5.1.
34+ Lua packages accept additional parameter <varname>disabled</varname>, which defines the condition of disabling package from luaPackages. For example, if package has <varname>disabled</varname> assigned to <literal>lua.luaversion != "5.1"</literal>, it will not be included in any luaPackages except lua51Packages, making it only be built for lua 5.1.
4735 </para>
4836</section>
doc/languages-frameworks/ocaml.xml+4−28
@@ -4,35 +4,15 @@
44 <title>OCaml</title>
55
66 <para>
7− OCaml libraries should be installed in
8− <literal>$(out)/lib/ocaml/${ocaml.version}/site-lib/</literal>. Such
9− directories are automatically added to the <literal>$OCAMLPATH</literal>
10− environment variable when building another package that depends on them or
11− when opening a <literal>nix-shell</literal>.
7+ OCaml libraries should be installed in <literal>$(out)/lib/ocaml/${ocaml.version}/site-lib/</literal>. Such directories are automatically added to the <literal>$OCAMLPATH</literal> environment variable when building another package that depends on them or when opening a <literal>nix-shell</literal>.
128 </para>
139
1410 <para>
15− Given that most of the OCaml ecosystem is now built with dune, nixpkgs
16− includes a convenience build support function called
17− <literal>buildDunePackage</literal> that will build an OCaml package using
18− dune, OCaml and findlib and any additional dependencies provided as
19− <literal>buildInputs</literal> or <literal>propagatedBuildInputs</literal>.
11+ Given that most of the OCaml ecosystem is now built with dune, nixpkgs includes a convenience build support function called <literal>buildDunePackage</literal> that will build an OCaml package using dune, OCaml and findlib and any additional dependencies provided as <literal>buildInputs</literal> or <literal>propagatedBuildInputs</literal>.
2012 </para>
2113
2214 <para>
23− Here is a simple package example. It defines an (optional) attribute
24− <literal>minimumOCamlVersion</literal> that will be used to throw a
25− descriptive evaluation error if building with an older OCaml is attempted. It
26− uses the <literal>fetchFromGitHub</literal> fetcher to get its source. It
27− sets the <literal>doCheck</literal> (optional) attribute to
28− <literal>true</literal> which means that tests will be run with <literal>dune
29− runtest -p angstrom</literal> after the build (<literal>dune build -p
30− angstrom</literal>) is complete. It uses <literal>alcotest</literal> as a
31− build input (because it is needed to run the tests) and
32− <literal>bigstringaf</literal> and <literal>result</literal> as propagated
33− build inputs (thus they will also be available to libraries depending on this
34− library). The library will be installed using the
35− <literal>angstrom.install</literal> file that dune generates.
15+ Here is a simple package example. It defines an (optional) attribute <literal>minimumOCamlVersion</literal> that will be used to throw a descriptive evaluation error if building with an older OCaml is attempted. It uses the <literal>fetchFromGitHub</literal> fetcher to get its source. It sets the <literal>doCheck</literal> (optional) attribute to <literal>true</literal> which means that tests will be run with <literal>dune runtest -p angstrom</literal> after the build (<literal>dune build -p angstrom</literal>) is complete. It uses <literal>alcotest</literal> as a build input (because it is needed to run the tests) and <literal>bigstringaf</literal> and <literal>result</literal> as propagated build inputs (thus they will also be available to libraries depending on this library). The library will be installed using the <literal>angstrom.install</literal> file that dune generates.
3616 </para>
3717
3818<programlisting>
@@ -65,11 +45,7 @@ buildDunePackage rec {
6545</programlisting>
6646
6747 <para>
68− Here is a second example, this time using a source archive generated with
69− <literal>dune-release</literal>. It is a good idea to use this archive when
70− it is available as it will usually contain substituted variables such as a
71− <literal>%%VERSION%%</literal> field. This library does not depend on any
72− other OCaml library and no tests are run after building it.
48+ Here is a second example, this time using a source archive generated with <literal>dune-release</literal>. It is a good idea to use this archive when it is available as it will usually contain substituted variables such as a <literal>%%VERSION%%</literal> field. This library does not depend on any other OCaml library and no tests are run after building it.
7349 </para>
7450
7551<programlisting>
doc/languages-frameworks/perl.xml+18−80
@@ -4,24 +4,13 @@
44 <title>Perl</title>
55
66 <para>
7− Nixpkgs provides a function <varname>buildPerlPackage</varname>, a generic
8− package builder function for any Perl package that has a standard
9− <varname>Makefile.PL</varname>. It’s implemented in
10− <link
7+ Nixpkgs provides a function <varname>buildPerlPackage</varname>, a generic package builder function for any Perl package that has a standard <varname>Makefile.PL</varname>. It’s implemented in <link
118xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/perl-modules/generic"><filename>pkgs/development/perl-modules/generic</filename></link>.
129 </para>
1310
1411 <para>
15− Perl packages from CPAN are defined in
16− <link
17−xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/perl-packages.nix"><filename>pkgs/top-level/perl-packages.nix</filename></link>,
18− rather than <filename>pkgs/all-packages.nix</filename>. Most Perl packages
19− are so straight-forward to build that they are defined here directly, rather
20− than having a separate function for each package called from
21− <filename>perl-packages.nix</filename>. However, more complicated packages
22− should be put in a separate file, typically in
23− <filename>pkgs/development/perl-modules</filename>. Here is an example of the
24− former:
12+ Perl packages from CPAN are defined in <link
13+xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/perl-packages.nix"><filename>pkgs/top-level/perl-packages.nix</filename></link>, rather than <filename>pkgs/all-packages.nix</filename>. Most Perl packages are so straight-forward to build that they are defined here directly, rather than having a separate function for each package called from <filename>perl-packages.nix</filename>. However, more complicated packages should be put in a separate file, typically in <filename>pkgs/development/perl-modules</filename>. Here is an example of the former:
2514<programlisting>
2615ClassC3 = buildPerlPackage rec {
2716 name = "Class-C3-0.21";
@@ -31,32 +20,22 @@ ClassC3 = buildPerlPackage rec {
3120 };
3221};
3322</programlisting>
34− Note the use of <literal>mirror://cpan/</literal>, and the
35− <literal>${name}</literal> in the URL definition to ensure that the name
36− attribute is consistent with the source that we’re actually downloading.
37− Perl packages are made available in <filename>all-packages.nix</filename>
38− through the variable <varname>perlPackages</varname>. For instance, if you
39− have a package that needs <varname>ClassC3</varname>, you would typically
40− write
23+ Note the use of <literal>mirror://cpan/</literal>, and the <literal>${name}</literal> in the URL definition to ensure that the name attribute is consistent with the source that we’re actually downloading. Perl packages are made available in <filename>all-packages.nix</filename> through the variable <varname>perlPackages</varname>. For instance, if you have a package that needs <varname>ClassC3</varname>, you would typically write
4124<programlisting>
4225foo = import ../path/to/foo.nix {
4326 inherit stdenv fetchurl ...;
4427 inherit (perlPackages) ClassC3;
4528};
4629</programlisting>
47− in <filename>all-packages.nix</filename>. You can test building a Perl
48− package as follows:
30+ in <filename>all-packages.nix</filename>. You can test building a Perl package as follows:
4931<screen>
5032<prompt>$ </prompt>nix-build -A perlPackages.ClassC3
5133</screen>
52− <varname>buildPerlPackage</varname> adds <literal>perl-</literal> to the
53− start of the name attribute, so the package above is actually called
54− <literal>perl-Class-C3-0.21</literal>. So to install it, you can say:
34+ <varname>buildPerlPackage</varname> adds <literal>perl-</literal> to the start of the name attribute, so the package above is actually called <literal>perl-Class-C3-0.21</literal>. So to install it, you can say:
5535<screen>
5636<prompt>$ </prompt>nix-env -i perl-Class-C3
5737</screen>
58− (Of course you can also install using the attribute name: <literal>nix-env -i
59− -A perlPackages.ClassC3</literal>.)
38+ (Of course you can also install using the attribute name: <literal>nix-env -i -A perlPackages.ClassC3</literal>.)
6039 </para>
6140
6241 <para>
@@ -64,40 +43,24 @@ foo = import ../path/to/foo.nix {
6443 <orderedlist>
6544 <listitem>
6645 <para>
67− In the configure phase, it calls <literal>perl Makefile.PL</literal> to
68− generate a Makefile. You can set the variable
69− <varname>makeMakerFlags</varname> to pass flags to
70− <filename>Makefile.PL</filename>
46+ In the configure phase, it calls <literal>perl Makefile.PL</literal> to generate a Makefile. You can set the variable <varname>makeMakerFlags</varname> to pass flags to <filename>Makefile.PL</filename>
7147 </para>
7248 </listitem>
7349 <listitem>
7450 <para>
75− It adds the contents of the <envar>PERL5LIB</envar> environment variable
76− to <literal>#! .../bin/perl</literal> line of Perl scripts as
77− <literal>-I<replaceable>dir</replaceable></literal> flags. This ensures
78− that a script can find its dependencies. (This can cause this shebang line
79− to become too long for Darwin to handle; see the note below.)
51+ It adds the contents of the <envar>PERL5LIB</envar> environment variable to <literal>#! .../bin/perl</literal> line of Perl scripts as <literal>-I<replaceable>dir</replaceable></literal> flags. This ensures that a script can find its dependencies. (This can cause this shebang line to become too long for Darwin to handle; see the note below.)
8052 </para>
8153 </listitem>
8254 <listitem>
8355 <para>
84− In the fixup phase, it writes the propagated build inputs
85− (<varname>propagatedBuildInputs</varname>) to the file
86− <filename>$out/nix-support/propagated-user-env-packages</filename>.
87− <command>nix-env</command> recursively installs all packages listed in
88− this file when you install a package that has it. This ensures that a Perl
89− package can find its dependencies.
56+ In the fixup phase, it writes the propagated build inputs (<varname>propagatedBuildInputs</varname>) to the file <filename>$out/nix-support/propagated-user-env-packages</filename>. <command>nix-env</command> recursively installs all packages listed in this file when you install a package that has it. This ensures that a Perl package can find its dependencies.
9057 </para>
9158 </listitem>
9259 </orderedlist>
9360 </para>
9461
9562 <para>
96− <varname>buildPerlPackage</varname> is built on top of
97− <varname>stdenv</varname>, so everything can be customised in the usual way.
98− For instance, the <literal>BerkeleyDB</literal> module has a
99− <varname>preConfigure</varname> hook to generate a configuration file used by
100− <filename>Makefile.PL</filename>:
63+ <varname>buildPerlPackage</varname> is built on top of <varname>stdenv</varname>, so everything can be customised in the usual way. For instance, the <literal>BerkeleyDB</literal> module has a <varname>preConfigure</varname> hook to generate a configuration file used by <filename>Makefile.PL</filename>:
10164<programlisting>
10265{ buildPerlPackage, fetchurl, db }:
10366
@@ -118,12 +81,7 @@ buildPerlPackage rec {
11881 </para>
11982
12083 <para>
121− Dependencies on other Perl packages can be specified in the
122− <varname>buildInputs</varname> and <varname>propagatedBuildInputs</varname>
123− attributes. If something is exclusively a build-time dependency, use
124− <varname>buildInputs</varname>; if it’s (also) a runtime dependency, use
125− <varname>propagatedBuildInputs</varname>. For instance, this builds a Perl
126− module that has runtime dependencies on a bunch of other modules:
84+ Dependencies on other Perl packages can be specified in the <varname>buildInputs</varname> and <varname>propagatedBuildInputs</varname> attributes. If something is exclusively a build-time dependency, use <varname>buildInputs</varname>; if it’s (also) a runtime dependency, use <varname>propagatedBuildInputs</varname>. For instance, this builds a Perl module that has runtime dependencies on a bunch of other modules:
12785<programlisting>
12886ClassC3Componentised = buildPerlPackage rec {
12987 name = "Class-C3-Componentised-1.0004";
@@ -139,11 +97,7 @@ ClassC3Componentised = buildPerlPackage rec {
13997 </para>
14098
14199 <para>
142− On Darwin, if a script has too many
143− <literal>-I<replaceable>dir</replaceable></literal> flags in its first line
144− (its “shebang line”), it will not run. This can be worked around by
145− calling the <literal>shortenPerlShebang</literal> function from the
146− <literal>postInstall</literal> phase:
100+ On Darwin, if a script has too many <literal>-I<replaceable>dir</replaceable></literal> flags in its first line (its “shebang line”), it will not run. This can be worked around by calling the <literal>shortenPerlShebang</literal> function from the <literal>postInstall</literal> phase:
147101<programlisting>
148102{ stdenv, buildPerlPackage, fetchurl, shortenPerlShebang }:
149103
@@ -162,20 +116,14 @@ ImageExifTool = buildPerlPackage {
162116 '';
163117};
164118</programlisting>
165− This will remove the <literal>-I</literal> flags from the shebang line,
166− rewrite them in the <literal>use lib</literal> form, and put them on the next
167− line instead. This function can be given any number of Perl scripts as
168− arguments; it will modify them in-place.
119+ This will remove the <literal>-I</literal> flags from the shebang line, rewrite them in the <literal>use lib</literal> form, and put them on the next line instead. This function can be given any number of Perl scripts as arguments; it will modify them in-place.
169120 </para>
170121
171122 <section xml:id="ssec-generation-from-CPAN">
172123 <title>Generation from CPAN</title>
173124
174125 <para>
175− Nix expressions for Perl packages can be generated (almost) automatically
176− from CPAN. This is done by the program
177− <command>nix-generate-from-cpan</command>, which can be installed as
178− follows:
126+ Nix expressions for Perl packages can be generated (almost) automatically from CPAN. This is done by the program <command>nix-generate-from-cpan</command>, which can be installed as follows:
179127 </para>
180128
181129<screen>
@@ -183,9 +131,7 @@ ImageExifTool = buildPerlPackage {
183131</screen>
184132
185133 <para>
186− This program takes a Perl module name, looks it up on CPAN, fetches and
187− unpacks the corresponding package, and prints a Nix expression on standard
188− output. For example:
134+ This program takes a Perl module name, looks it up on CPAN, fetches and unpacks the corresponding package, and prints a Nix expression on standard output. For example:
189135<screen>
190136<prompt>$ </prompt>nix-generate-from-cpan XML::Simple
191137 XMLSimple = buildPerlPackage rec {
@@ -201,9 +147,7 @@ ImageExifTool = buildPerlPackage {
201147 };
202148 };
203149</screen>
204− The output can be pasted into
205− <filename>pkgs/top-level/perl-packages.nix</filename> or wherever else you
206− need it.
150+ The output can be pasted into <filename>pkgs/top-level/perl-packages.nix</filename> or wherever else you need it.
207151 </para>
208152 </section>
209153
@@ -211,13 +155,7 @@ ImageExifTool = buildPerlPackage {
211155 <title>Cross-compiling modules</title>
212156
213157 <para>
214− Nixpkgs has experimental support for cross-compiling Perl modules. In many
215− cases, it will just work out of the box, even for modules with native
216− extensions. Sometimes, however, the Makefile.PL for a module may
217− (indirectly) import a native module. In that case, you will need to make a
218− stub for that module that will satisfy the Makefile.PL and install it into
219− <filename>lib/perl5/site_perl/cross_perl/${perl.version}</filename>. See the
220− <varname>postInstall</varname> for <varname>DBI</varname> for an example.
158+ Nixpkgs has experimental support for cross-compiling Perl modules. In many cases, it will just work out of the box, even for modules with native extensions. Sometimes, however, the Makefile.PL for a module may (indirectly) import a native module. In that case, you will need to make a stub for that module that will satisfy the Makefile.PL and install it into <filename>lib/perl5/site_perl/cross_perl/${perl.version}</filename>. See the <varname>postInstall</varname> for <varname>DBI</varname> for an example.
221159 </para>
222160 </section>
223161</section>
doc/languages-frameworks/qt.xml+13−47
@@ -4,11 +4,7 @@
44 <title>Qt</title>
55
66 <para>
7− This section describes the differences between Nix expressions for Qt
8− libraries and applications and Nix expressions for other C++ software. Some
9− knowledge of the latter is assumed. There are primarily two problems which
10− the Qt infrastructure is designed to address: ensuring consistent versioning
11− of all dependencies and finding dependencies at runtime.
7+ This section describes the differences between Nix expressions for Qt libraries and applications and Nix expressions for other C++ software. Some knowledge of the latter is assumed. There are primarily two problems which the Qt infrastructure is designed to address: ensuring consistent versioning of all dependencies and finding dependencies at runtime.
128 </para>
139
1410 <example xml:id='qt-default-nix'>
@@ -28,38 +24,26 @@ mkDerivation { <co xml:id='qt-default-nix-co-2' />
2824 <calloutlist>
2925 <callout arearefs='qt-default-nix-co-1'>
3026 <para>
31− Import <literal>mkDerivation</literal> and Qt (such as
32− <literal>qtbase</literal> modules directly. <emphasis>Do not</emphasis>
33− import Qt package sets; the Qt versions of dependencies may not be
34− coherent, causing build and runtime failures.
27+ Import <literal>mkDerivation</literal> and Qt (such as <literal>qtbase</literal> modules directly. <emphasis>Do not</emphasis> import Qt package sets; the Qt versions of dependencies may not be coherent, causing build and runtime failures.
3528 </para>
3629 </callout>
3730 <callout arearefs='qt-default-nix-co-2'>
3831 <para>
39− Use <literal>mkDerivation</literal> instead of
40− <literal>stdenv.mkDerivation</literal>. <literal>mkDerivation</literal> is
41− a wrapper around <literal>stdenv.mkDerivation</literal> which applies some
42− Qt-specific settings. This deriver accepts the same arguments as
43− <literal>stdenv.mkDerivation</literal>; refer to
44− <xref linkend='chap-stdenv' /> for details.
32+ Use <literal>mkDerivation</literal> instead of <literal>stdenv.mkDerivation</literal>. <literal>mkDerivation</literal> is a wrapper around <literal>stdenv.mkDerivation</literal> which applies some Qt-specific settings. This deriver accepts the same arguments as <literal>stdenv.mkDerivation</literal>; refer to <xref linkend='chap-stdenv' /> for details.
4533 </para>
4634 <para>
47− To use another deriver instead of <literal>stdenv.mkDerivation</literal>,
48− use <literal>mkDerivationWith</literal>:
35+ To use another deriver instead of <literal>stdenv.mkDerivation</literal>, use <literal>mkDerivationWith</literal>:
4936<programlisting>
5037mkDerivationWith myDeriver {
5138 # ...
5239}
5340</programlisting>
54− If you cannot use <literal>mkDerivationWith</literal>, please refer to
55− <xref linkend='qt-runtime-dependencies' />.
41+ If you cannot use <literal>mkDerivationWith</literal>, please refer to <xref linkend='qt-runtime-dependencies' />.
5642 </para>
5743 </callout>
5844 <callout arearefs='qt-default-nix-co-3'>
5945 <para>
60− <literal>mkDerivation</literal> accepts the same arguments as
61− <literal>stdenv.mkDerivation</literal>, such as
62− <literal>buildInputs</literal>.
46+ <literal>mkDerivation</literal> accepts the same arguments as <literal>stdenv.mkDerivation</literal>, such as <literal>buildInputs</literal>.
6347 </para>
6448 </callout>
6549 </calloutlist>
@@ -67,10 +51,7 @@ mkDerivationWith myDeriver {
6751 <formalpara xml:id='qt-runtime-dependencies'>
6852 <title>Locating runtime dependencies</title>
6953 <para>
70− Qt applications need to be wrapped to find runtime dependencies. If you
71− cannot use <literal>mkDerivation</literal> or
72− <literal>mkDerivationWith</literal> above, include
73− <literal>wrapQtAppsHook</literal> in <literal>nativeBuildInputs</literal>:
54+ Qt applications need to be wrapped to find runtime dependencies. If you cannot use <literal>mkDerivation</literal> or <literal>mkDerivationWith</literal> above, include <literal>wrapQtAppsHook</literal> in <literal>nativeBuildInputs</literal>:
7455<programlisting>
7556stdenv.mkDerivation {
7657 # ...
@@ -82,9 +63,7 @@ stdenv.mkDerivation {
8263 </formalpara>
8364
8465 <para>
85− Entries added to <literal>qtWrapperArgs</literal> are used to modify the
86− wrappers created by <literal>wrapQtAppsHook</literal>. The entries are passed
87− as arguments to <xref linkend='fun-wrapProgram' />.
66+ Entries added to <literal>qtWrapperArgs</literal> are used to modify the wrappers created by <literal>wrapQtAppsHook</literal>. The entries are passed as arguments to <xref linkend='fun-wrapProgram' />.
8867<programlisting>
8968mkDerivation {
9069 # ...
@@ -95,10 +74,7 @@ mkDerivation {
9574 </para>
9675
9776 <para>
98− Set <literal>dontWrapQtApps</literal> to stop applications from being wrapped
99− automatically. It is required to wrap applications manually with
100− <literal>wrapQtApp</literal>, using the syntax of
101− <xref linkend='fun-wrapProgram' />:
77+ Set <literal>dontWrapQtApps</literal> to stop applications from being wrapped automatically. It is required to wrap applications manually with <literal>wrapQtApp</literal>, using the syntax of <xref linkend='fun-wrapProgram' />:
10278<programlisting>
10379mkDerivation {
10480 # ...
@@ -113,17 +89,12 @@ mkDerivation {
11389
11490 <note>
11591 <para>
116− <literal>wrapQtAppsHook</literal> ignores files that are non-ELF
117− executables. This means that scripts won't be automatically wrapped so
118− you'll need to manually wrap them as previously mentioned. An example of
119− when you'd always need to do this is with Python applications that use PyQT.
92+ <literal>wrapQtAppsHook</literal> ignores files that are non-ELF executables. This means that scripts won't be automatically wrapped so you'll need to manually wrap them as previously mentioned. An example of when you'd always need to do this is with Python applications that use PyQT.
12093 </para>
12194 </note>
12295
12396 <para>
124− Libraries are built with every available version of Qt. Use the
125− <literal>meta.broken</literal> attribute to disable the package for
126− unsupported Qt versions:
97+ Libraries are built with every available version of Qt. Use the <literal>meta.broken</literal> attribute to disable the package for unsupported Qt versions:
12798<programlisting>
12899mkDerivation {
129100 # ...
@@ -137,9 +108,7 @@ mkDerivation {
137108 <formalpara>
138109 <title>Adding a library to Nixpkgs</title>
139110 <para>
140− Add a Qt library to <filename>all-packages.nix</filename> by adding it to
141− the collection inside <literal>mkLibsForQt5</literal>. This ensures that the
142− library is built with every available version of Qt as needed.
111+ Add a Qt library to <filename>all-packages.nix</filename> by adding it to the collection inside <literal>mkLibsForQt5</literal>. This ensures that the library is built with every available version of Qt as needed.
143112 <example xml:id='qt-library-all-packages-nix'>
144113 <title>Adding a Qt library to <filename>all-packages.nix</filename></title>
145114<programlisting>
@@ -162,10 +131,7 @@ mkDerivation {
162131 <formalpara>
163132 <title>Adding an application to Nixpkgs</title>
164133 <para>
165− Add a Qt application to <filename>all-packages.nix</filename> using
166− <literal>libsForQt5.callPackage</literal> instead of the usual
167− <literal>callPackage</literal>. The former ensures that all dependencies are
168− built with the same version of Qt.
134+ Add a Qt application to <filename>all-packages.nix</filename> using <literal>libsForQt5.callPackage</literal> instead of the usual <literal>callPackage</literal>. The former ensures that all dependencies are built with the same version of Qt.
169135 <example xml:id='qt-application-all-packages-nix'>
170136 <title>Adding a Qt application to <filename>all-packages.nix</filename></title>
171137<programlisting>
doc/languages-frameworks/ruby.xml+5−32
@@ -4,11 +4,7 @@
44 <title>Ruby</title>
55
66 <para>
7− There currently is support to bundle applications that are packaged as Ruby
8− gems. The utility "bundix" allows you to write a
9− <filename>Gemfile</filename>, let bundler create a
10− <filename>Gemfile.lock</filename>, and then convert this into a nix
11− expression that contains all Gem dependencies automatically.
7+ There currently is support to bundle applications that are packaged as Ruby gems. The utility "bundix" allows you to write a <filename>Gemfile</filename>, let bundler create a <filename>Gemfile.lock</filename>, and then convert this into a nix expression that contains all Gem dependencies automatically.
128 </para>
139
1410 <para>
@@ -45,9 +41,7 @@ bundlerEnv rec {
4541</screen>
4642
4743 <para>
48− Please check in the <filename>Gemfile</filename>,
49− <filename>Gemfile.lock</filename> and the <filename>gemset.nix</filename> so
50− future updates can be run easily.
44+ Please check in the <filename>Gemfile</filename>, <filename>Gemfile.lock</filename> and the <filename>gemset.nix</filename> so future updates can be run easily.
5145 </para>
5246
5347 <para>
@@ -62,10 +56,7 @@ $ nix-shell -p bundix --run 'bundix'
6256</screen>
6357
6458 <para>
65− For tools written in Ruby - i.e. where the desire is to install a package and
66− then execute e.g. <command>rake</command> at the command line, there is an
67− alternative builder called <literal>bundlerApp</literal>. Set up the
68− <filename>gemset.nix</filename> the same way, and then, for example:
59+ For tools written in Ruby - i.e. where the desire is to install a package and then execute e.g. <command>rake</command> at the command line, there is an alternative builder called <literal>bundlerApp</literal>. Set up the <filename>gemset.nix</filename> the same way, and then, for example:
6960 </para>
7061
7162<screen>
@@ -87,29 +78,11 @@ bundlerApp {
8778</screen>
8879
8980 <para>
90− The chief advantage of <literal>bundlerApp</literal> over
91− <literal>bundlerEnv</literal> is the executables introduced in the
92− environment are precisely those selected in the <literal>exes</literal> list,
93− as opposed to <literal>bundlerEnv</literal> which adds all the executables
94− made available by gems in the gemset, which can mean e.g.
95− <command>rspec</command> or <command>rake</command> in unpredictable versions
96− available from various packages.
81+ The chief advantage of <literal>bundlerApp</literal> over <literal>bundlerEnv</literal> is the executables introduced in the environment are precisely those selected in the <literal>exes</literal> list, as opposed to <literal>bundlerEnv</literal> which adds all the executables made available by gems in the gemset, which can mean e.g. <command>rspec</command> or <command>rake</command> in unpredictable versions available from various packages.
9782 </para>
9883
9984 <para>
100− Resulting derivations for both builders also have two helpful attributes,
101− <literal>env</literal> and <literal>wrappedRuby</literal>. The first one
102− allows one to quickly drop into <command>nix-shell</command> with the
103− specified environment present. E.g. <command>nix-shell -A sensu.env</command>
104− would give you an environment with Ruby preset so it has all the libraries
105− necessary for <literal>sensu</literal> in its paths. The second one can be
106− used to make derivations from custom Ruby scripts which have
107− <filename>Gemfile</filename>s with their dependencies specified. It is a
108− derivation with <command>ruby</command> wrapped so it can find all the needed
109− dependencies. For example, to make a derivation <literal>my-script</literal>
110− for a <filename>my-script.rb</filename> (which should be placed in
111− <filename>bin</filename>) you should run <command>bundix</command> as
112− specified above and then use <literal>bundlerEnv</literal> like this:
85+ Resulting derivations for both builders also have two helpful attributes, <literal>env</literal> and <literal>wrappedRuby</literal>. The first one allows one to quickly drop into <command>nix-shell</command> with the specified environment present. E.g. <command>nix-shell -A sensu.env</command> would give you an environment with Ruby preset so it has all the libraries necessary for <literal>sensu</literal> in its paths. The second one can be used to make derivations from custom Ruby scripts which have <filename>Gemfile</filename>s with their dependencies specified. It is a derivation with <command>ruby</command> wrapped so it can find all the needed dependencies. For example, to make a derivation <literal>my-script</literal> for a <filename>my-script.rb</filename> (which should be placed in <filename>bin</filename>) you should run <command>bundix</command> as specified above and then use <literal>bundlerEnv</literal> like this:
11386 </para>
11487
11588<programlisting>
doc/languages-frameworks/texlive.xml+8−19
@@ -4,8 +4,7 @@
44 <title>TeX Live</title>
55
66 <para>
7− Since release 15.09 there is a new TeX Live packaging that lives entirely
8− under attribute <varname>texlive</varname>.
7+ Since release 15.09 there is a new TeX Live packaging that lives entirely under attribute <varname>texlive</varname>.
98 </para>
109
1110 <section xml:id="sec-language-texlive-users-guide">
@@ -14,28 +13,23 @@
1413 <itemizedlist>
1514 <listitem>
1615 <para>
17− For basic usage just pull <varname>texlive.combined.scheme-basic</varname>
18− for an environment with basic LaTeX support.
16+ For basic usage just pull <varname>texlive.combined.scheme-basic</varname> for an environment with basic LaTeX support.
1917 </para>
2018 </listitem>
2119 <listitem>
2220 <para>
23− It typically won't work to use separately installed packages together.
24− Instead, you can build a custom set of packages like this:
21+ It typically won't work to use separately installed packages together. Instead, you can build a custom set of packages like this:
2522<programlisting>
2623texlive.combine {
2724 inherit (texlive) scheme-small collection-langkorean algorithms cm-super;
2825}
2926</programlisting>
30− There are all the schemes, collections and a few thousand packages, as
31− defined upstream (perhaps with tiny differences).
27+ There are all the schemes, collections and a few thousand packages, as defined upstream (perhaps with tiny differences).
3228 </para>
3329 </listitem>
3430 <listitem>
3531 <para>
36− By default you only get executables and files needed during runtime, and a
37− little documentation for the core packages. To change that, you need to
38− add <varname>pkgFilter</varname> function to <varname>combine</varname>.
32+ By default you only get executables and files needed during runtime, and a little documentation for the core packages. To change that, you need to add <varname>pkgFilter</varname> function to <varname>combine</varname>.
3933<programlisting>
4034texlive.combine {
4135 # inherit (texlive) whatever-you-want;
@@ -59,10 +53,7 @@ nix-repl> texlive.collection-<TAB>
5953 </listitem>
6054 <listitem>
6155 <para>
62− Note that the wrapper assumes that the result has a chance to be useful.
63− For example, the core executables should be present, as well as some core
64− data files. The supported way of ensuring this is by including some
65− scheme, for example <varname>scheme-basic</varname>, into the combination.
56+ Note that the wrapper assumes that the result has a chance to be useful. For example, the core executables should be present, as well as some core data files. The supported way of ensuring this is by including some scheme, for example <varname>scheme-basic</varname>, into the combination.
6657 </para>
6758 </listitem>
6859 </itemizedlist>
@@ -84,14 +75,12 @@ nix-repl> texlive.collection-<TAB>
8475 </listitem>
8576 <listitem>
8677 <para>
87− feature/bug: when a package is rejected by <varname>pkgFilter</varname>,
88− its dependencies are still propagated;
78+ feature/bug: when a package is rejected by <varname>pkgFilter</varname>, its dependencies are still propagated;
8979 </para>
9080 </listitem>
9181 <listitem>
9282 <para>
93− in case of any bugs or feature requests, file a github issue or better a
94− pull request and /cc @vcunat.
83+ in case of any bugs or feature requests, file a github issue or better a pull request and /cc @vcunat.
9584 </para>
9685 </listitem>
9786 </itemizedlist>
doc/meta.xml+36−128
@@ -3,10 +3,7 @@
33 xml:id="chap-meta">
44 <title>Meta-attributes</title>
55 <para>
6− Nix packages can declare <emphasis>meta-attributes</emphasis> that contain
7− information about a package such as a description, its homepage, its license,
8− and so on. For instance, the GNU Hello package has a <varname>meta</varname>
9− declaration like this:
6+ Nix packages can declare <emphasis>meta-attributes</emphasis> that contain information about a package such as a description, its homepage, its license, and so on. For instance, the GNU Hello package has a <varname>meta</varname> declaration like this:
107<programlisting>
118meta = with stdenv.lib; {
129 description = "A program that produces a familiar, friendly greeting";
@@ -22,13 +19,10 @@ meta = with stdenv.lib; {
2219</programlisting>
2320 </para>
2421 <para>
25− Meta-attributes are not passed to the builder of the package. Thus, a change
26− to a meta-attribute doesn’t trigger a recompilation of the package. The
27− value of a meta-attribute must be a string.
22+ Meta-attributes are not passed to the builder of the package. Thus, a change to a meta-attribute doesn’t trigger a recompilation of the package. The value of a meta-attribute must be a string.
2823 </para>
2924 <para>
30− The meta-attributes of a package can be queried from the command-line using
31− <command>nix-env</command>:
25+ The meta-attributes of a package can be queried from the command-line using <command>nix-env</command>:
3226<screen>
3327<prompt>$ </prompt>nix-env -qa hello --json
3428{
@@ -67,8 +61,7 @@ meta = with stdenv.lib; {
6761
6862
6963</screen>
70− <command>nix-env</command> knows about the <varname>description</varname>
71− field specifically:
64+ <command>nix-env</command> knows about the <varname>description</varname> field specifically:
7265<screen>
7366<prompt>$ </prompt>nix-env -qa hello --description
7467hello-2.3 A program that produces a familiar, friendly greeting
@@ -88,18 +81,13 @@ hello-2.3 A program that produces a familiar, friendly greeting
8881 </term>
8982 <listitem>
9083 <para>
91− A short (one-line) description of the package. This is shown by
92− <command>nix-env -q --description</command> and also on the Nixpkgs
93− release pages.
84+ A short (one-line) description of the package. This is shown by <command>nix-env -q --description</command> and also on the Nixpkgs release pages.
9485 </para>
9586 <para>
96− Don’t include a period at the end. Don’t include newline characters.
97− Capitalise the first character. For brevity, don’t repeat the name of
98− package — just describe what it does.
87+ Don’t include a period at the end. Don’t include newline characters. Capitalise the first character. For brevity, don’t repeat the name of package — just describe what it does.
9988 </para>
10089 <para>
101− Wrong: <literal>"libpng is a library that allows you to decode PNG
102− images."</literal>
90+ Wrong: <literal>"libpng is a library that allows you to decode PNG images."</literal>
10391 </para>
10492 <para>
10593 Right: <literal>"A library for decoding PNG images"</literal>
@@ -122,9 +110,7 @@ hello-2.3 A program that produces a familiar, friendly greeting
122110 </term>
123111 <listitem>
124112 <para>
125− Release branch. Used to specify that a package is not going to receive
126− updates that are not in this branch; for example, Linux kernel 3.0 is
127− supposed to be updated to 3.0.X, not 3.1.
113+ Release branch. Used to specify that a package is not going to receive updates that are not in this branch; for example, Linux kernel 3.0 is supposed to be updated to 3.0.X, not 3.1.
128114 </para>
129115 </listitem>
130116 </varlistentry>
@@ -134,8 +120,7 @@ hello-2.3 A program that produces a familiar, friendly greeting
134120 </term>
135121 <listitem>
136122 <para>
137− The package’s homepage. Example:
138− <literal>https://www.gnu.org/software/hello/manual/</literal>
123+ The package’s homepage. Example: <literal>https://www.gnu.org/software/hello/manual/</literal>
139124 </para>
140125 </listitem>
141126 </varlistentry>
@@ -145,8 +130,7 @@ hello-2.3 A program that produces a familiar, friendly greeting
145130 </term>
146131 <listitem>
147132 <para>
148− The page where a link to the current version can be found. Example:
149− <literal>https://ftp.gnu.org/gnu/hello/</literal>
133+ The page where a link to the current version can be found. Example: <literal>https://ftp.gnu.org/gnu/hello/</literal>
150134 </para>
151135 </listitem>
152136 </varlistentry>
@@ -156,10 +140,7 @@ hello-2.3 A program that produces a familiar, friendly greeting
156140 </term>
157141 <listitem>
158142 <para>
159− A link or a list of links to the location of Changelog for a package. A
160− link may use expansion to refer to the correct changelog version.
161− Example:
162− <literal>"https://git.savannah.gnu.org/cgit/hello.git/plain/NEWS?h=v${version}"</literal>
143+ A link or a list of links to the location of Changelog for a package. A link may use expansion to refer to the correct changelog version. Example: <literal>"https://git.savannah.gnu.org/cgit/hello.git/plain/NEWS?h=v${version}"</literal>
163144 </para>
164145 </listitem>
165146 </varlistentry>
@@ -169,46 +150,32 @@ hello-2.3 A program that produces a familiar, friendly greeting
169150 </term>
170151 <listitem>
171152 <para>
172− The license, or licenses, for the package. One from the attribute set
173− defined in
174− <link
175− xlink:href="https://github.com/NixOS/nixpkgs/blob/master/lib/licenses.nix">
176− <filename>nixpkgs/lib/licenses.nix</filename></link>. At this moment
177− using both a list of licenses and a single license is valid. If the
178− license field is in the form of a list representation, then it means that
179− parts of the package are licensed differently. Each license should
180− preferably be referenced by their attribute. The non-list attribute value
181− can also be a space delimited string representation of the contained
182− attribute shortNames or spdxIds. The following are all valid examples:
153+ The license, or licenses, for the package. One from the attribute set defined in <link
154+ xlink:href="https://github.com/NixOS/nixpkgs/blob/master/lib/licenses.nix"> <filename>nixpkgs/lib/licenses.nix</filename></link>. At this moment using both a list of licenses and a single license is valid. If the license field is in the form of a list representation, then it means that parts of the package are licensed differently. Each license should preferably be referenced by their attribute. The non-list attribute value can also be a space delimited string representation of the contained attribute shortNames or spdxIds. The following are all valid examples:
183155 <itemizedlist>
184156 <listitem>
185157 <para>
186− Single license referenced by attribute (preferred)
187− <literal>stdenv.lib.licenses.gpl3</literal>.
158+ Single license referenced by attribute (preferred) <literal>stdenv.lib.licenses.gpl3</literal>.
188159 </para>
189160 </listitem>
190161 <listitem>
191162 <para>
192− Single license referenced by its attribute shortName (frowned upon)
193− <literal>"gpl3"</literal>.
163+ Single license referenced by its attribute shortName (frowned upon) <literal>"gpl3"</literal>.
194164 </para>
195165 </listitem>
196166 <listitem>
197167 <para>
198− Single license referenced by its attribute spdxId (frowned upon)
199− <literal>"GPL-3.0"</literal>.
168+ Single license referenced by its attribute spdxId (frowned upon) <literal>"GPL-3.0"</literal>.
200169 </para>
201170 </listitem>
202171 <listitem>
203172 <para>
204− Multiple licenses referenced by attribute (preferred) <literal>with
205− stdenv.lib.licenses; [ asl20 free ofl ]</literal>.
173+ Multiple licenses referenced by attribute (preferred) <literal>with stdenv.lib.licenses; [ asl20 free ofl ]</literal>.
206174 </para>
207175 </listitem>
208176 <listitem>
209177 <para>
210− Multiple licenses referenced as a space delimited string of attribute
211− shortNames (frowned upon) <literal>"asl20 free ofl"</literal>.
178+ Multiple licenses referenced as a space delimited string of attribute shortNames (frowned upon) <literal>"asl20 free ofl"</literal>.
212179 </para>
213180 </listitem>
214181 </itemizedlist>
@@ -222,13 +189,8 @@ hello-2.3 A program that produces a familiar, friendly greeting
222189 </term>
223190 <listitem>
224191 <para>
225− A list of names and e-mail addresses of the maintainers of this Nix
226− expression. If you would like to be a maintainer of a package, you may
227− want to add yourself to
228− <link
229− xlink:href="https://github.com/NixOS/nixpkgs/blob/master/maintainers/maintainer-list.nix"><filename>nixpkgs/maintainers/maintainer-list.nix</filename></link>
230− and write something like <literal>[ stdenv.lib.maintainers.alice
231− stdenv.lib.maintainers.bob ]</literal>.
192+ A list of names and e-mail addresses of the maintainers of this Nix expression. If you would like to be a maintainer of a package, you may want to add yourself to <link
193+ xlink:href="https://github.com/NixOS/nixpkgs/blob/master/maintainers/maintainer-list.nix"><filename>nixpkgs/maintainers/maintainer-list.nix</filename></link> and write something like <literal>[ stdenv.lib.maintainers.alice stdenv.lib.maintainers.bob ]</literal>.
232194 </para>
233195 </listitem>
234196 </varlistentry>
@@ -238,10 +200,7 @@ hello-2.3 A program that produces a familiar, friendly greeting
238200 </term>
239201 <listitem>
240202 <para>
241− The <emphasis>priority</emphasis> of the package, used by
242− <command>nix-env</command> to resolve file name conflicts between
243− packages. See the Nix manual page for <command>nix-env</command> for
244− details. Example: <literal>"10"</literal> (a low-priority package).
203+ The <emphasis>priority</emphasis> of the package, used by <command>nix-env</command> to resolve file name conflicts between packages. See the Nix manual page for <command>nix-env</command> for details. Example: <literal>"10"</literal> (a low-priority package).
245204 </para>
246205 </listitem>
247206 </varlistentry>
@@ -251,15 +210,11 @@ hello-2.3 A program that produces a familiar, friendly greeting
251210 </term>
252211 <listitem>
253212 <para>
254− The list of Nix platform types on which the package is supported. Hydra
255− builds packages according to the platform specified. If no platform is
256− specified, the package does not have prebuilt binaries. An example is:
213+ The list of Nix platform types on which the package is supported. Hydra builds packages according to the platform specified. If no platform is specified, the package does not have prebuilt binaries. An example is:
257214<programlisting>
258215meta.platforms = stdenv.lib.platforms.linux;
259216</programlisting>
260− Attribute Set <varname>stdenv.lib.platforms</varname> defines
261− <link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/lib/systems/doubles.nix">
262− various common lists</link> of platforms types.
217+ Attribute Set <varname>stdenv.lib.platforms</varname> defines <link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/lib/systems/doubles.nix"> various common lists</link> of platforms types.
263218 </para>
264219 </listitem>
265220 </varlistentry>
@@ -270,23 +225,14 @@ meta.platforms = stdenv.lib.platforms.linux;
270225 <listitem>
271226 <warning>
272227 <para>
273− This attribute is special in that it is not actually under the
274− <literal>meta</literal> attribute set but rather under the
275− <literal>passthru</literal> attribute set. This is due to how
276− <literal>meta</literal> attributes work, and the fact that they are
277− supposed to contain only metadata, not derivations.
228+ This attribute is special in that it is not actually under the <literal>meta</literal> attribute set but rather under the <literal>passthru</literal> attribute set. This is due to how <literal>meta</literal> attributes work, and the fact that they are supposed to contain only metadata, not derivations.
278229 </para>
279230 </warning>
280231 <para>
281− An attribute set with as values tests. A test is a derivation, which
282− builds successfully when the test passes, and fails to build otherwise. A
283− derivation that is a test needs to have <literal>meta.timeout</literal>
284− defined.
232+ An attribute set with as values tests. A test is a derivation, which builds successfully when the test passes, and fails to build otherwise. A derivation that is a test needs to have <literal>meta.timeout</literal> defined.
285233 </para>
286234 <para>
287− The NixOS tests are available as <literal>nixosTests</literal> in
288− parameters of derivations. For instance, the OpenSMTPD derivation
289− includes lines similar to:
235+ The NixOS tests are available as <literal>nixosTests</literal> in parameters of derivations. For instance, the OpenSMTPD derivation includes lines similar to:
290236<programlisting>
291237{ /* ... */, nixosTests }:
292238{
@@ -305,13 +251,7 @@ meta.platforms = stdenv.lib.platforms.linux;
305251 </term>
306252 <listitem>
307253 <para>
308− A timeout (in seconds) for building the derivation. If the derivation
309− takes longer than this time to build, it can fail due to breaking the
310− timeout. However, all computers do not have the same computing power,
311− hence some builders may decide to apply a multiplicative factor to this
312− value. When filling this value in, try to keep it approximately
313− consistent with other values already present in
314− <literal>nixpkgs</literal>.
254+ A timeout (in seconds) for building the derivation. If the derivation takes longer than this time to build, it can fail due to breaking the timeout. However, all computers do not have the same computing power, hence some builders may decide to apply a multiplicative factor to this value. When filling this value in, try to keep it approximately consistent with other values already present in <literal>nixpkgs</literal>.
315255 </para>
316256 </listitem>
317257 </varlistentry>
@@ -321,13 +261,7 @@ meta.platforms = stdenv.lib.platforms.linux;
321261 </term>
322262 <listitem>
323263 <para>
324− The list of Nix platform types for which the Hydra instance at
325− <literal>hydra.nixos.org</literal> will build the package. (Hydra is the
326− Nix-based continuous build system.) It defaults to the value of
327− <varname>meta.platforms</varname>. Thus, the only reason to set
328− <varname>meta.hydraPlatforms</varname> is if you want
329− <literal>hydra.nixos.org</literal> to build the package on a subset of
330− <varname>meta.platforms</varname>, or not at all, e.g.
264+ The list of Nix platform types for which the Hydra instance at <literal>hydra.nixos.org</literal> will build the package. (Hydra is the Nix-based continuous build system.) It defaults to the value of <varname>meta.platforms</varname>. Thus, the only reason to set <varname>meta.hydraPlatforms</varname> is if you want <literal>hydra.nixos.org</literal> to build the package on a subset of <varname>meta.platforms</varname>, or not at all, e.g.
331265<programlisting>
332266meta.platforms = stdenv.lib.platforms.linux;
333267meta.hydraPlatforms = [];
@@ -341,10 +275,7 @@ meta.hydraPlatforms = [];
341275 </term>
342276 <listitem>
343277 <para>
344− If set to <literal>true</literal>, the package is marked as “broken”,
345− meaning that it won’t show up in <literal>nix-env -qa</literal>, and
346− cannot be built or installed. Such packages should be removed from
347− Nixpkgs eventually unless they are fixed.
278+ If set to <literal>true</literal>, the package is marked as “broken”, meaning that it won’t show up in <literal>nix-env -qa</literal>, and cannot be built or installed. Such packages should be removed from Nixpkgs eventually unless they are fixed.
348279 </para>
349280 </listitem>
350281 </varlistentry>
@@ -354,12 +285,7 @@ meta.hydraPlatforms = [];
354285 </term>
355286 <listitem>
356287 <para>
357− If set to <literal>true</literal>, the package is tested to be updated
358− correctly by the <literal>update-walker.sh</literal> script without
359− additional settings. Such packages have <varname>meta.version</varname>
360− set and their homepage (or the page specified by
361− <varname>meta.downloadPage</varname>) contains a direct link to the
362− package tarball.
288+ If set to <literal>true</literal>, the package is tested to be updated correctly by the <literal>update-walker.sh</literal> script without additional settings. Such packages have <varname>meta.version</varname> set and their homepage (or the page specified by <varname>meta.downloadPage</varname>) contains a direct link to the package tarball.
363289 </para>
364290 </listitem>
365291 </varlistentry>
@@ -369,17 +295,11 @@ meta.hydraPlatforms = [];
369295 <title>Licenses</title>
370296
371297 <para>
372− The <varname>meta.license</varname> attribute should preferrably contain a
373− value from <varname>stdenv.lib.licenses</varname> defined in
374− <link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/lib/licenses.nix">
375− <filename>nixpkgs/lib/licenses.nix</filename></link>, or in-place license
376− description of the same format if the license is unlikely to be useful in
377− another expression.
298+ The <varname>meta.license</varname> attribute should preferrably contain a value from <varname>stdenv.lib.licenses</varname> defined in <link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/lib/licenses.nix"> <filename>nixpkgs/lib/licenses.nix</filename></link>, or in-place license description of the same format if the license is unlikely to be useful in another expression.
378299 </para>
379300
380301 <para>
381− Although it's typically better to indicate the specific license, a few
382− generic options are available:
302+ Although it's typically better to indicate the specific license, a few generic options are available:
383303 <variablelist>
384304 <varlistentry>
385305 <term>
@@ -397,18 +317,10 @@ meta.hydraPlatforms = [];
397317 </term>
398318 <listitem>
399319 <para>
400− Unfree package that can be redistributed in binary form. That is, it’s
401− legal to redistribute the <emphasis>output</emphasis> of the derivation.
402− This means that the package can be included in the Nixpkgs channel.
320+ Unfree package that can be redistributed in binary form. That is, it’s legal to redistribute the <emphasis>output</emphasis> of the derivation. This means that the package can be included in the Nixpkgs channel.
403321 </para>
404322 <para>
405− Sometimes proprietary software can only be redistributed unmodified.
406− Make sure the builder doesn’t actually modify the original binaries;
407− otherwise we’re breaking the license. For instance, the NVIDIA X11
408− drivers can be redistributed unmodified, but our builder applies
409− <command>patchelf</command> to make them work. Thus, its license is
410− <varname>"unfree"</varname> and it cannot be included in the Nixpkgs
411− channel.
323+ Sometimes proprietary software can only be redistributed unmodified. Make sure the builder doesn’t actually modify the original binaries; otherwise we’re breaking the license. For instance, the NVIDIA X11 drivers can be redistributed unmodified, but our builder applies <command>patchelf</command> to make them work. Thus, its license is <varname>"unfree"</varname> and it cannot be included in the Nixpkgs channel.
412324 </para>
413325 </listitem>
414326 </varlistentry>
@@ -418,9 +330,7 @@ meta.hydraPlatforms = [];
418330 </term>
419331 <listitem>
420332 <para>
421− Unfree package that cannot be redistributed. You can build it yourself,
422− but you cannot redistribute the output of the derivation. Thus it cannot
423− be included in the Nixpkgs channel.
333+ Unfree package that cannot be redistributed. You can build it yourself, but you cannot redistribute the output of the derivation. Thus it cannot be included in the Nixpkgs channel.
424334 </para>
425335 </listitem>
426336 </varlistentry>
@@ -430,9 +340,7 @@ meta.hydraPlatforms = [];
430340 </term>
431341 <listitem>
432342 <para>
433− This package supplies unfree, redistributable firmware. This is a
434− separate value from <varname>unfree-redistributable</varname> because
435− not everybody cares whether firmware is free.
343+ This package supplies unfree, redistributable firmware. This is a separate value from <varname>unfree-redistributable</varname> because not everybody cares whether firmware is free.
436344 </para>
437345 </listitem>
438346 </varlistentry>
doc/multiple-output.xml+30−128
@@ -10,31 +10,16 @@
1010 <title>Introduction</title>
1111
1212 <para>
13− The Nix language allows a derivation to produce multiple outputs, which is
14− similar to what is utilized by other Linux distribution packaging systems.
15− The outputs reside in separate Nix store paths, so they can be mostly
16− handled independently of each other, including passing to build inputs,
17− garbage collection or binary substitution. The exception is that building
18− from source always produces all the outputs.
13+ The Nix language allows a derivation to produce multiple outputs, which is similar to what is utilized by other Linux distribution packaging systems. The outputs reside in separate Nix store paths, so they can be mostly handled independently of each other, including passing to build inputs, garbage collection or binary substitution. The exception is that building from source always produces all the outputs.
1914 </para>
2015
2116 <para>
22− The main motivation is to save disk space by reducing runtime closure sizes;
23− consequently also sizes of substituted binaries get reduced. Splitting can
24− be used to have more granular runtime dependencies, for example the typical
25− reduction is to split away development-only files, as those are typically
26− not needed during runtime. As a result, closure sizes of many packages can
27− get reduced to a half or even much less.
17+ The main motivation is to save disk space by reducing runtime closure sizes; consequently also sizes of substituted binaries get reduced. Splitting can be used to have more granular runtime dependencies, for example the typical reduction is to split away development-only files, as those are typically not needed during runtime. As a result, closure sizes of many packages can get reduced to a half or even much less.
2818 </para>
2919
3020 <note>
3121 <para>
32− The reduction effects could be instead achieved by building the parts in
33− completely separate derivations. That would often additionally reduce
34− build-time closures, but it tends to be much harder to write such
35− derivations, as build systems typically assume all parts are being built at
36− once. This compromise approach of single source package producing multiple
37− binary packages is also utilized often by rpm and deb.
22+ The reduction effects could be instead achieved by building the parts in completely separate derivations. That would often additionally reduce build-time closures, but it tends to be much harder to write such derivations, as build systems typically assume all parts are being built at once. This compromise approach of single source package producing multiple binary packages is also utilized often by rpm and deb.
3823 </para>
3924 </note>
4025 </section>
@@ -42,23 +27,18 @@
4227 <title>Installing a split package</title>
4328
4429 <para>
45− When installing a package via <varname>systemPackages</varname> or
46− <command>nix-env</command> you have several options:
30+ When installing a package via <varname>systemPackages</varname> or <command>nix-env</command> you have several options:
4731 </para>
4832
4933 <itemizedlist>
5034 <listitem>
5135 <para>
52− You can install particular outputs explicitly, as each is available in the
53− Nix language as an attribute of the package. The
54− <varname>outputs</varname> attribute contains a list of output names.
36+ You can install particular outputs explicitly, as each is available in the Nix language as an attribute of the package. The <varname>outputs</varname> attribute contains a list of output names.
5537 </para>
5638 </listitem>
5739 <listitem>
5840 <para>
59− You can let it use the default outputs. These are handled by
60− <varname>meta.outputsToInstall</varname> attribute that contains a list of
61− output names.
41+ You can let it use the default outputs. These are handled by <varname>meta.outputsToInstall</varname> attribute that contains a list of output names.
6242 </para>
6343 <para>
6444 TODO: more about tweaking the attribute, etc.
@@ -66,19 +46,11 @@
6646 </listitem>
6747 <listitem>
6848 <para>
69− NixOS provides configuration option
70− <varname>environment.extraOutputsToInstall</varname> that allows adding
71− extra outputs of <varname>environment.systemPackages</varname> atop the
72− default ones. It's mainly meant for documentation and debug symbols, and
73− it's also modified by specific options.
49+ NixOS provides configuration option <varname>environment.extraOutputsToInstall</varname> that allows adding extra outputs of <varname>environment.systemPackages</varname> atop the default ones. It's mainly meant for documentation and debug symbols, and it's also modified by specific options.
7450 </para>
7551 <note>
7652 <para>
77− At this moment there is no similar configurability for packages installed
78− by <command>nix-env</command>. You can still use approach from
79− <xref linkend="sec-modify-via-packageOverrides" /> to override
80− <varname>meta.outputsToInstall</varname> attributes, but that's a rather
81− inconvenient way.
53+ At this moment there is no similar configurability for packages installed by <command>nix-env</command>. You can still use approach from <xref linkend="sec-modify-via-packageOverrides" /> to override <varname>meta.outputsToInstall</varname> attributes, but that's a rather inconvenient way.
8254 </para>
8355 </note>
8456 </listitem>
@@ -88,25 +60,15 @@
8860 <title>Using a split package</title>
8961
9062 <para>
91− In the Nix language the individual outputs can be reached explicitly as
92− attributes, e.g. <varname>coreutils.info</varname>, but the typical case is
93− just using packages as build inputs.
63+ In the Nix language the individual outputs can be reached explicitly as attributes, e.g. <varname>coreutils.info</varname>, but the typical case is just using packages as build inputs.
9464 </para>
9565
9666 <para>
97− When a multiple-output derivation gets into a build input of another
98− derivation, the <varname>dev</varname> output is added if it exists,
99− otherwise the first output is added. In addition to that,
100− <varname>propagatedBuildOutputs</varname> of that package which by default
101− contain <varname>$outputBin</varname> and <varname>$outputLib</varname> are
102− also added. (See <xref linkend="multiple-output-file-type-groups" />.)
67+ When a multiple-output derivation gets into a build input of another derivation, the <varname>dev</varname> output is added if it exists, otherwise the first output is added. In addition to that, <varname>propagatedBuildOutputs</varname> of that package which by default contain <varname>$outputBin</varname> and <varname>$outputLib</varname> are also added. (See <xref linkend="multiple-output-file-type-groups" />.)
10368 </para>
10469
10570 <para>
106− In some cases it may be desirable to combine different outputs under a
107− single store path. A function <literal>symlinkJoin</literal> can be used to
108− do this. (Note that it may negate some closure size benefits of using a
109− multiple-output package.)
71+ In some cases it may be desirable to combine different outputs under a single store path. A function <literal>symlinkJoin</literal> can be used to do this. (Note that it may negate some closure size benefits of using a multiple-output package.)
11072 </para>
11173 </section>
11274 <section xml:id="sec-multiple-outputs-">
@@ -117,29 +79,18 @@
11779 </para>
11880
11981 <para>
120− In nixpkgs there is a framework supporting multiple-output derivations. It
121− tries to cover most cases by default behavior. You can find the source
122− separated in
123− &lt;<filename>nixpkgs/pkgs/build-support/setup-hooks/multiple-outputs.sh</filename>&gt;;
124− it's relatively well-readable. The whole machinery is triggered by defining
125− the <varname>outputs</varname> attribute to contain the list of desired
126− output names (strings).
82+ In nixpkgs there is a framework supporting multiple-output derivations. It tries to cover most cases by default behavior. You can find the source separated in &lt;<filename>nixpkgs/pkgs/build-support/setup-hooks/multiple-outputs.sh</filename>&gt;; it's relatively well-readable. The whole machinery is triggered by defining the <varname>outputs</varname> attribute to contain the list of desired output names (strings).
12783 </para>
12884
12985<programlisting>outputs = [ "bin" "dev" "out" "doc" ];</programlisting>
13086
13187 <para>
132− Often such a single line is enough. For each output an equally named
133− environment variable is passed to the builder and contains the path in nix
134− store for that output. Typically you also want to have the main
135− <varname>out</varname> output, as it catches any files that didn't get
136− elsewhere.
88+ Often such a single line is enough. For each output an equally named environment variable is passed to the builder and contains the path in nix store for that output. Typically you also want to have the main <varname>out</varname> output, as it catches any files that didn't get elsewhere.
13789 </para>
13890
13991 <note>
14092 <para>
141− There is a special handling of the <varname>debug</varname> output,
142− described at <xref linkend="stdenv-separateDebugInfo" />.
93+ There is a special handling of the <varname>debug</varname> output, described at <xref linkend="stdenv-separateDebugInfo" />.
14394 </para>
14495 </note>
14596
@@ -147,36 +98,15 @@
14798 <title><quote>Binaries first</quote></title>
14899
149100 <para>
150− A commonly adopted convention in <literal>nixpkgs</literal> is that
151− executables provided by the package are contained within its first output.
152− This convention allows the dependent packages to reference the executables
153− provided by packages in a uniform manner. For instance, provided with the
154− knowledge that the <literal>perl</literal> package contains a
155− <literal>perl</literal> executable it can be referenced as
156− <literal>${pkgs.perl}/bin/perl</literal> within a Nix derivation that needs
157− to execute a Perl script.
101+ A commonly adopted convention in <literal>nixpkgs</literal> is that executables provided by the package are contained within its first output. This convention allows the dependent packages to reference the executables provided by packages in a uniform manner. For instance, provided with the knowledge that the <literal>perl</literal> package contains a <literal>perl</literal> executable it can be referenced as <literal>${pkgs.perl}/bin/perl</literal> within a Nix derivation that needs to execute a Perl script.
158102 </para>
159103
160104 <para>
161− The <literal>glibc</literal> package is a deliberate single exception to
162− the <quote>binaries first</quote> convention. The <literal>glibc</literal>
163− has <literal>libs</literal> as its first output allowing the libraries
164− provided by <literal>glibc</literal> to be referenced directly (e.g.
165− <literal>${stdenv.glibc}/lib/ld-linux-x86-64.so.2</literal>). The
166− executables provided by <literal>glibc</literal> can be accessed via its
167− <literal>bin</literal> attribute (e.g.
168− <literal>${stdenv.glibc.bin}/bin/ldd</literal>).
105+ The <literal>glibc</literal> package is a deliberate single exception to the <quote>binaries first</quote> convention. The <literal>glibc</literal> has <literal>libs</literal> as its first output allowing the libraries provided by <literal>glibc</literal> to be referenced directly (e.g. <literal>${stdenv.glibc}/lib/ld-linux-x86-64.so.2</literal>). The executables provided by <literal>glibc</literal> can be accessed via its <literal>bin</literal> attribute (e.g. <literal>${stdenv.glibc.bin}/bin/ldd</literal>).
169106 </para>
170107
171108 <para>
172− The reason for why <literal>glibc</literal> deviates from the convention is
173− because referencing a library provided by <literal>glibc</literal> is a
174− very common operation among Nix packages. For instance, third-party
175− executables packaged by Nix are typically patched and relinked with the
176− relevant version of <literal>glibc</literal> libraries from Nix packages
177− (please see the documentation on
178− <link xlink:href="https://nixos.org/patchelf.html">patchelf</link> for more
179− details).
109+ The reason for why <literal>glibc</literal> deviates from the convention is because referencing a library provided by <literal>glibc</literal> is a very common operation among Nix packages. For instance, third-party executables packaged by Nix are typically patched and relinked with the relevant version of <literal>glibc</literal> libraries from Nix packages (please see the documentation on <link xlink:href="https://nixos.org/patchelf.html">patchelf</link> for more details).
180110 </para>
181111 </section>
182112
@@ -184,13 +114,7 @@
184114 <title>File type groups</title>
185115
186116 <para>
187− The support code currently recognizes some particular kinds of outputs and
188− either instructs the build system of the package to put files into their
189− desired outputs or it moves the files during the fixup phase. Each group of
190− file types has an <varname>outputFoo</varname> variable specifying the
191− output name where they should go. If that variable isn't defined by the
192− derivation writer, it is guessed &ndash; a default output name is defined,
193− falling back to other possibilities if the output isn't defined.
117+ The support code currently recognizes some particular kinds of outputs and either instructs the build system of the package to put files into their desired outputs or it moves the files during the fixup phase. Each group of file types has an <varname>outputFoo</varname> variable specifying the output name where they should go. If that variable isn't defined by the derivation writer, it is guessed &ndash; a default output name is defined, falling back to other possibilities if the output isn't defined.
194118 </para>
195119
196120 <variablelist>
@@ -200,9 +124,7 @@
200124 </term>
201125 <listitem>
202126 <para>
203− is for development-only files. These include C(++) headers, pkg-config,
204− cmake and aclocal files. They go to <varname>dev</varname> or
205− <varname>out</varname> by default.
127+ is for development-only files. These include C(++) headers, pkg-config, cmake and aclocal files. They go to <varname>dev</varname> or <varname>out</varname> by default.
206128 </para>
207129 </listitem>
208130 </varlistentry>
@@ -212,8 +134,7 @@
212134 </term>
213135 <listitem>
214136 <para>
215− is meant for user-facing binaries, typically residing in bin/. They go
216− to <varname>bin</varname> or <varname>out</varname> by default.
137+ is meant for user-facing binaries, typically residing in bin/. They go to <varname>bin</varname> or <varname>out</varname> by default.
217138 </para>
218139 </listitem>
219140 </varlistentry>
@@ -223,9 +144,7 @@
223144 </term>
224145 <listitem>
225146 <para>
226− is meant for libraries, typically residing in <filename>lib/</filename>
227− and <filename>libexec/</filename>. They go to <varname>lib</varname> or
228− <varname>out</varname> by default.
147+ is meant for libraries, typically residing in <filename>lib/</filename> and <filename>libexec/</filename>. They go to <varname>lib</varname> or <varname>out</varname> by default.
229148 </para>
230149 </listitem>
231150 </varlistentry>
@@ -235,9 +154,7 @@
235154 </term>
236155 <listitem>
237156 <para>
238− is for user documentation, typically residing in
239− <filename>share/doc/</filename>. It goes to <varname>doc</varname> or
240− <varname>out</varname> by default.
157+ is for user documentation, typically residing in <filename>share/doc/</filename>. It goes to <varname>doc</varname> or <varname>out</varname> by default.
241158 </para>
242159 </listitem>
243160 </varlistentry>
@@ -247,10 +164,7 @@
247164 </term>
248165 <listitem>
249166 <para>
250− is for <emphasis>developer</emphasis> documentation. Currently we count
251− gtk-doc and devhelp books in there. It goes to <varname>devdoc</varname>
252− or is removed (!) by default. This is because e.g. gtk-doc tends to be
253− rather large and completely unused by nixpkgs users.
167+ is for <emphasis>developer</emphasis> documentation. Currently we count gtk-doc and devhelp books in there. It goes to <varname>devdoc</varname> or is removed (!) by default. This is because e.g. gtk-doc tends to be rather large and completely unused by nixpkgs users.
254168 </para>
255169 </listitem>
256170 </varlistentry>
@@ -260,8 +174,7 @@
260174 </term>
261175 <listitem>
262176 <para>
263− is for man pages (except for section 3). They go to
264− <varname>man</varname> or <varname>$outputBin</varname> by default.
177+ is for man pages (except for section 3). They go to <varname>man</varname> or <varname>$outputBin</varname> by default.
265178 </para>
266179 </listitem>
267180 </varlistentry>
@@ -271,8 +184,7 @@
271184 </term>
272185 <listitem>
273186 <para>
274− is for section 3 man pages. They go to <varname>devman</varname> or
275− <varname>$outputMan</varname> by default.
187+ is for section 3 man pages. They go to <varname>devman</varname> or <varname>$outputMan</varname> by default.
276188 </para>
277189 </listitem>
278190 </varlistentry>
@@ -282,8 +194,7 @@
282194 </term>
283195 <listitem>
284196 <para>
285− is for info pages. They go to <varname>info</varname> or
286− <varname>$outputBin</varname> by default.
197+ is for info pages. They go to <varname>info</varname> or <varname>$outputBin</varname> by default.
287198 </para>
288199 </listitem>
289200 </varlistentry>
@@ -296,31 +207,22 @@
296207 <itemizedlist>
297208 <listitem>
298209 <para>
299− Some configure scripts don't like some of the parameters passed by
300− default by the framework, e.g. <literal>--docdir=/foo/bar</literal>. You
301− can disable this by setting <literal>setOutputFlags = false;</literal>.
210+ Some configure scripts don't like some of the parameters passed by default by the framework, e.g. <literal>--docdir=/foo/bar</literal>. You can disable this by setting <literal>setOutputFlags = false;</literal>.
302211 </para>
303212 </listitem>
304213 <listitem>
305214 <para>
306− The outputs of a single derivation can retain references to each other,
307− but note that circular references are not allowed. (And each
308− strongly-connected component would act as a single output anyway.)
215+ The outputs of a single derivation can retain references to each other, but note that circular references are not allowed. (And each strongly-connected component would act as a single output anyway.)
309216 </para>
310217 </listitem>
311218 <listitem>
312219 <para>
313− Most of split packages contain their core functionality in libraries.
314− These libraries tend to refer to various kind of data that typically gets
315− into <varname>out</varname>, e.g. locale strings, so there is often no
316− advantage in separating the libraries into <varname>lib</varname>, as
317− keeping them in <varname>out</varname> is easier.
220+ Most of split packages contain their core functionality in libraries. These libraries tend to refer to various kind of data that typically gets into <varname>out</varname>, e.g. locale strings, so there is often no advantage in separating the libraries into <varname>lib</varname>, as keeping them in <varname>out</varname> is easier.
318221 </para>
319222 </listitem>
320223 <listitem>
321224 <para>
322− Some packages have hidden assumptions on install paths, which complicates
323− splitting.
225+ Some packages have hidden assumptions on install paths, which complicates splitting.
324226 </para>
325227 </listitem>
326228 </itemizedlist>
doc/overlays.xml+19−74
@@ -3,47 +3,32 @@
33 xml:id="chap-overlays">
44 <title>Overlays</title>
55 <para>
6− This chapter describes how to extend and change Nixpkgs using overlays.
7− Overlays are used to add layers in the fixed-point used by Nixpkgs to compose
8− the set of all packages.
6+ This chapter describes how to extend and change Nixpkgs using overlays. Overlays are used to add layers in the fixed-point used by Nixpkgs to compose the set of all packages.
97 </para>
108 <para>
11− Nixpkgs can be configured with a list of overlays, which are applied in
12− order. This means that the order of the overlays can be significant if
13− multiple layers override the same package.
9+ Nixpkgs can be configured with a list of overlays, which are applied in order. This means that the order of the overlays can be significant if multiple layers override the same package.
1410 </para>
1511<!--============================================================-->
1612 <section xml:id="sec-overlays-install">
1713 <title>Installing overlays</title>
1814
1915 <para>
20− The list of overlays can be set either explicitly in a Nix expression, or
21− through <literal>&lt;nixpkgs-overlays></literal> or user configuration
22− files.
16+ The list of overlays can be set either explicitly in a Nix expression, or through <literal>&lt;nixpkgs-overlays></literal> or user configuration files.
2317 </para>
2418
2519 <section xml:id="sec-overlays-argument">
2620 <title>Set overlays in NixOS or Nix expressions</title>
2721
2822 <para>
29− On a NixOS system the value of the <literal>nixpkgs.overlays</literal>
30− option, if present, is passed to the system Nixpkgs directly as an
31− argument. Note that this does not affect the overlays for non-NixOS
32− operations (e.g. <literal>nix-env</literal>), which are
33− <link xlink:href="#sec-overlays-lookup">looked</link> up independently.
23+ On a NixOS system the value of the <literal>nixpkgs.overlays</literal> option, if present, is passed to the system Nixpkgs directly as an argument. Note that this does not affect the overlays for non-NixOS operations (e.g. <literal>nix-env</literal>), which are <link xlink:href="#sec-overlays-lookup">looked</link> up independently.
3424 </para>
3525
3626 <para>
37− The list of overlays can be passed explicitly when importing nixpkgs, for
38− example <literal>import &lt;nixpkgs> { overlays = [ overlay1 overlay2 ];
39− }</literal>.
27+ The list of overlays can be passed explicitly when importing nixpkgs, for example <literal>import &lt;nixpkgs> { overlays = [ overlay1 overlay2 ]; }</literal>.
4028 </para>
4129
4230 <para>
43− Further overlays can be added by calling the <literal>pkgs.extend</literal>
44− or <literal>pkgs.appendOverlays</literal>, although it is often preferable
45− to avoid these functions, because they recompute the Nixpkgs fixpoint,
46− which is somewhat expensive to do.
31+ Further overlays can be added by calling the <literal>pkgs.extend</literal> or <literal>pkgs.appendOverlays</literal>, although it is often preferable to avoid these functions, because they recompute the Nixpkgs fixpoint, which is somewhat expensive to do.
4732 </para>
4833 </section>
4934
@@ -58,30 +43,20 @@
5843 <orderedlist>
5944 <listitem>
6045 <para>
61− First, if an
62− <link xlink:href="#sec-overlays-argument"><varname>overlays</varname>
63− argument</link> to the Nixpkgs function itself is given, then that is
64− used and no path lookup will be performed.
46+ First, if an <link xlink:href="#sec-overlays-argument"><varname>overlays</varname> argument</link> to the Nixpkgs function itself is given, then that is used and no path lookup will be performed.
6547 </para>
6648 </listitem>
6749 <listitem>
6850 <para>
69− Otherwise, if the Nix path entry
70− <literal>&lt;nixpkgs-overlays></literal> exists, we look for overlays at
71− that path, as described below.
51+ Otherwise, if the Nix path entry <literal>&lt;nixpkgs-overlays></literal> exists, we look for overlays at that path, as described below.
7252 </para>
7353 <para>
74− See the section on <literal>NIX_PATH</literal> in the Nix manual for
75− more details on how to set a value for
76− <literal>&lt;nixpkgs-overlays>.</literal>
54+ See the section on <literal>NIX_PATH</literal> in the Nix manual for more details on how to set a value for <literal>&lt;nixpkgs-overlays>.</literal>
7755 </para>
7856 </listitem>
7957 <listitem>
8058 <para>
81− If one of <filename>~/.config/nixpkgs/overlays.nix</filename> and
82− <filename>~/.config/nixpkgs/overlays/</filename> exists, then we look
83− for overlays at that path, as described below. It is an error if both
84− exist.
59+ If one of <filename>~/.config/nixpkgs/overlays.nix</filename> and <filename>~/.config/nixpkgs/overlays/</filename> exists, then we look for overlays at that path, as described below. It is an error if both exist.
8560 </para>
8661 </listitem>
8762 </orderedlist>
@@ -92,15 +67,12 @@
9267 <itemizedlist>
9368 <listitem>
9469 <para>
95− If the path is a file, then the file is imported as a Nix expression and
96− used as the list of overlays.
70+ If the path is a file, then the file is imported as a Nix expression and used as the list of overlays.
9771 </para>
9872 </listitem>
9973 <listitem>
10074 <para>
101− If the path is a directory, then we take the content of the directory,
102− order it lexicographically, and attempt to interpret each as an overlay
103− by:
75+ If the path is a directory, then we take the content of the directory, order it lexicographically, and attempt to interpret each as an overlay by:
10476 <itemizedlist>
10577 <listitem>
10678 <para>
@@ -109,8 +81,7 @@
10981 </listitem>
11082 <listitem>
11183 <para>
112− Importing a top-level <filename>default.nix</filename> file, if it is
113− a directory.
84+ Importing a top-level <filename>default.nix</filename> file, if it is a directory.
11485 </para>
11586 </listitem>
11687 </itemizedlist>
@@ -120,12 +91,7 @@
12091 </para>
12192
12293 <para>
123− Because overlays that are set in NixOS configuration do not affect
124− non-NixOS operations such as <literal>nix-env</literal>, the
125− <filename>overlays.nix</filename> option provides a convenient way to use
126− the same overlays for a NixOS system configuration and user configuration:
127− the same file can be used as <filename>overlays.nix</filename> and imported
128− as the value of <literal>nixpkgs.overlays</literal>.
94+ Because overlays that are set in NixOS configuration do not affect non-NixOS operations such as <literal>nix-env</literal>, the <filename>overlays.nix</filename> option provides a convenient way to use the same overlays for a NixOS system configuration and user configuration: the same file can be used as <filename>overlays.nix</filename> and imported as the value of <literal>nixpkgs.overlays</literal>.
12995 </para>
13096
13197<!-- TODO: Example of sharing overlays between NixOS configuration
@@ -139,9 +105,7 @@
139105 <title>Defining overlays</title>
140106
141107 <para>
142− Overlays are Nix functions which accept two arguments, conventionally called
143− <varname>self</varname> and <varname>super</varname>, and return a set of
144− packages. For example, the following is a valid overlay.
108+ Overlays are Nix functions which accept two arguments, conventionally called <varname>self</varname> and <varname>super</varname>, and return a set of packages. For example, the following is a valid overlay.
145109 </para>
146110
147111<programlisting>
@@ -158,38 +122,19 @@ self: super:
158122</programlisting>
159123
160124 <para>
161− The first argument (<varname>self</varname>) corresponds to the final
162− package set. You should use this set for the dependencies of all packages
163− specified in your overlay. For example, all the dependencies of
164− <varname>rr</varname> in the example above come from
165− <varname>self</varname>, as well as the overridden dependencies used in the
166− <varname>boost</varname> override.
125+ The first argument (<varname>self</varname>) corresponds to the final package set. You should use this set for the dependencies of all packages specified in your overlay. For example, all the dependencies of <varname>rr</varname> in the example above come from <varname>self</varname>, as well as the overridden dependencies used in the <varname>boost</varname> override.
167126 </para>
168127
169128 <para>
170− The second argument (<varname>super</varname>) corresponds to the result of
171− the evaluation of the previous stages of Nixpkgs. It does not contain any of
172− the packages added by the current overlay, nor any of the following
173− overlays. This set should be used either to refer to packages you wish to
174− override, or to access functions defined in Nixpkgs. For example, the
175− original recipe of <varname>boost</varname> in the above example, comes from
176− <varname>super</varname>, as well as the <varname>callPackage</varname>
177− function.
129+ The second argument (<varname>super</varname>) corresponds to the result of the evaluation of the previous stages of Nixpkgs. It does not contain any of the packages added by the current overlay, nor any of the following overlays. This set should be used either to refer to packages you wish to override, or to access functions defined in Nixpkgs. For example, the original recipe of <varname>boost</varname> in the above example, comes from <varname>super</varname>, as well as the <varname>callPackage</varname> function.
178130 </para>
179131
180132 <para>
181− The value returned by this function should be a set similar to
182− <filename>pkgs/top-level/all-packages.nix</filename>, containing overridden
183− and/or new packages.
133+ The value returned by this function should be a set similar to <filename>pkgs/top-level/all-packages.nix</filename>, containing overridden and/or new packages.
184134 </para>
185135
186136 <para>
187− Overlays are similar to other methods for customizing Nixpkgs, in particular
188− the <literal>packageOverrides</literal> attribute described in
189− <xref linkend="sec-modify-via-packageOverrides"/>. Indeed,
190− <literal>packageOverrides</literal> acts as an overlay with only the
191− <varname>super</varname> argument. It is therefore appropriate for basic
192− use, but overlays are more powerful and easier to distribute.
137+ Overlays are similar to other methods for customizing Nixpkgs, in particular the <literal>packageOverrides</literal> attribute described in <xref linkend="sec-modify-via-packageOverrides"/>. Indeed, <literal>packageOverrides</literal> acts as an overlay with only the <varname>super</varname> argument. It is therefore appropriate for basic use, but overlays are more powerful and easier to distribute.
193138 </para>
194139 </section>
195140</chapter>
doc/package-notes.xml+47−215
@@ -3,38 +3,23 @@
33 xml:id="chap-package-notes">
44 <title>Package Notes</title>
55 <para>
6− This chapter contains information about how to use and maintain the Nix
7− expressions for a number of specific packages, such as the Linux kernel or
8− X.org.
6+ This chapter contains information about how to use and maintain the Nix expressions for a number of specific packages, such as the Linux kernel or X.org.
97 </para>
108<!--============================================================-->
119 <section xml:id="sec-linux-kernel">
1210 <title>Linux kernel</title>
1311
1412 <para>
15− The Nix expressions to build the Linux kernel are in
16− <link
13+ The Nix expressions to build the Linux kernel are in <link
1714xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/os-specific/linux/kernel"><filename>pkgs/os-specific/linux/kernel</filename></link>.
1815 </para>
1916
2017 <para>
21− The function that builds the kernel has an argument
22− <varname>kernelPatches</varname> which should be a list of <literal>{name,
23− patch, extraConfig}</literal> attribute sets, where <varname>name</varname>
24− is the name of the patch (which is included in the kernel’s
25− <varname>meta.description</varname> attribute), <varname>patch</varname> is
26− the patch itself (possibly compressed), and <varname>extraConfig</varname>
27− (optional) is a string specifying extra options to be concatenated to the
28− kernel configuration file (<filename>.config</filename>).
18+ The function that builds the kernel has an argument <varname>kernelPatches</varname> which should be a list of <literal>{name, patch, extraConfig}</literal> attribute sets, where <varname>name</varname> is the name of the patch (which is included in the kernel’s <varname>meta.description</varname> attribute), <varname>patch</varname> is the patch itself (possibly compressed), and <varname>extraConfig</varname> (optional) is a string specifying extra options to be concatenated to the kernel configuration file (<filename>.config</filename>).
2919 </para>
3020
3121 <para>
32− The kernel derivation exports an attribute <varname>features</varname>
33− specifying whether optional functionality is or isn’t enabled. This is
34− used in NixOS to implement kernel-specific behaviour. For instance, if the
35− kernel has the <varname>iwlwifi</varname> feature (i.e. has built-in support
36− for Intel wireless chipsets), then NixOS doesn’t have to build the
37− external <varname>iwlwifi</varname> package:
22+ The kernel derivation exports an attribute <varname>features</varname> specifying whether optional functionality is or isn’t enabled. This is used in NixOS to implement kernel-specific behaviour. For instance, if the kernel has the <varname>iwlwifi</varname> feature (i.e. has built-in support for Intel wireless chipsets), then NixOS doesn’t have to build the external <varname>iwlwifi</varname> package:
3823<programlisting>
3924modulesTree = [kernel]
4025 ++ pkgs.lib.optional (!kernel.features ? iwlwifi) kernelPackages.iwlwifi
@@ -47,45 +32,31 @@ modulesTree = [kernel]
4732 <orderedlist>
4833 <listitem>
4934 <para>
50− Copy the old Nix expression (e.g. <filename>linux-2.6.21.nix</filename>)
51− to the new one (e.g. <filename>linux-2.6.22.nix</filename>) and update
52− it.
35+ Copy the old Nix expression (e.g. <filename>linux-2.6.21.nix</filename>) to the new one (e.g. <filename>linux-2.6.22.nix</filename>) and update it.
5336 </para>
5437 </listitem>
5538 <listitem>
5639 <para>
57− Add the new kernel to <filename>all-packages.nix</filename> (e.g., create
58− an attribute <varname>kernel_2_6_22</varname>).
40+ Add the new kernel to <filename>all-packages.nix</filename> (e.g., create an attribute <varname>kernel_2_6_22</varname>).
5941 </para>
6042 </listitem>
6143 <listitem>
6244 <para>
63− Now we’re going to update the kernel configuration. First unpack the
64− kernel. Then for each supported platform (<literal>i686</literal>,
65− <literal>x86_64</literal>, <literal>uml</literal>) do the following:
45+ Now we’re going to update the kernel configuration. First unpack the kernel. Then for each supported platform (<literal>i686</literal>, <literal>x86_64</literal>, <literal>uml</literal>) do the following:
6646 <orderedlist>
6747 <listitem>
6848 <para>
69− Make an copy from the old config (e.g.
70− <filename>config-2.6.21-i686-smp</filename>) to the new one (e.g.
71− <filename>config-2.6.22-i686-smp</filename>).
49+ Make an copy from the old config (e.g. <filename>config-2.6.21-i686-smp</filename>) to the new one (e.g. <filename>config-2.6.22-i686-smp</filename>).
7250 </para>
7351 </listitem>
7452 <listitem>
7553 <para>
76− Copy the config file for this platform (e.g.
77− <filename>config-2.6.22-i686-smp</filename>) to
78− <filename>.config</filename> in the kernel source tree.
54+ Copy the config file for this platform (e.g. <filename>config-2.6.22-i686-smp</filename>) to <filename>.config</filename> in the kernel source tree.
7955 </para>
8056 </listitem>
8157 <listitem>
8258 <para>
83− Run <literal>make oldconfig
84− ARCH=<replaceable>{i386,x86_64,um}</replaceable></literal> and answer
85− all questions. (For the uml configuration, also add
86− <literal>SHELL=bash</literal>.) Make sure to keep the configuration
87− consistent between platforms (i.e. don’t enable some feature on
88− <literal>i686</literal> and disable it on <literal>x86_64</literal>).
59+ Run <literal>make oldconfig ARCH=<replaceable>{i386,x86_64,um}</replaceable></literal> and answer all questions. (For the uml configuration, also add <literal>SHELL=bash</literal>.) Make sure to keep the configuration consistent between platforms (i.e. don’t enable some feature on <literal>i686</literal> and disable it on <literal>x86_64</literal>).
8960 </para>
9061 </listitem>
9162 <listitem>
@@ -99,8 +70,7 @@ modulesTree = [kernel]
9970 </listitem>
10071 <listitem>
10172 <para>
102− Copy <filename>.config</filename> over the new config file (e.g.
103− <filename>config-2.6.22-i686-smp</filename>).
73+ Copy <filename>.config</filename> over the new config file (e.g. <filename>config-2.6.22-i686-smp</filename>).
10474 </para>
10575 </listitem>
10676 </orderedlist>
@@ -108,18 +78,12 @@ modulesTree = [kernel]
10878 </listitem>
10979 <listitem>
11080 <para>
111− Test building the kernel: <literal>nix-build -A kernel_2_6_22</literal>.
112− If it compiles, ship it! For extra credit, try booting NixOS with it.
81+ Test building the kernel: <literal>nix-build -A kernel_2_6_22</literal>. If it compiles, ship it! For extra credit, try booting NixOS with it.
11382 </para>
11483 </listitem>
11584 <listitem>
11685 <para>
117− It may be that the new kernel requires updating the external kernel
118− modules and kernel-dependent packages listed in the
119− <varname>linuxPackagesFor</varname> function in
120− <filename>all-packages.nix</filename> (such as the NVIDIA drivers, AUFS,
121− etc.). If the updated packages aren’t backwards compatible with older
122− kernels, you may need to keep the older versions around.
86+ It may be that the new kernel requires updating the external kernel modules and kernel-dependent packages listed in the <varname>linuxPackagesFor</varname> function in <filename>all-packages.nix</filename> (such as the NVIDIA drivers, AUFS, etc.). If the updated packages aren’t backwards compatible with older kernels, you may need to keep the older versions around.
12387 </para>
12488 </listitem>
12589 </orderedlist>
@@ -130,13 +94,7 @@ modulesTree = [kernel]
13094 <title>X.org</title>
13195
13296 <para>
133− The Nix expressions for the X.org packages reside in
134− <filename>pkgs/servers/x11/xorg/default.nix</filename>. This file is
135− automatically generated from lists of tarballs in an X.org release. As such
136− it should not be modified directly; rather, you should modify the lists, the
137− generator script or the file
138− <filename>pkgs/servers/x11/xorg/overrides.nix</filename>, in which you can
139− override or add to the derivations produced by the generator.
97+ The Nix expressions for the X.org packages reside in <filename>pkgs/servers/x11/xorg/default.nix</filename>. This file is automatically generated from lists of tarballs in an X.org release. As such it should not be modified directly; rather, you should modify the lists, the generator script or the file <filename>pkgs/servers/x11/xorg/overrides.nix</filename>, in which you can override or add to the derivations produced by the generator.
14098 </para>
14199
142100 <para>
@@ -146,37 +104,22 @@ modulesTree = [kernel]
146104<prompt>$ </prompt>cat tarballs-7.5.list extra.list old.list \
147105 | perl ./generate-expr-from-tarballs.pl
148106</screen>
149− For each of the tarballs in the <filename>.list</filename> files, the script
150− downloads it, unpacks it, and searches its <filename>configure.ac</filename>
151− and <filename>*.pc.in</filename> files for dependencies. This information is
152− used to generate <filename>default.nix</filename>. The generator caches
153− downloaded tarballs between runs. Pay close attention to the <literal>NOT
154− FOUND: <replaceable>name</replaceable></literal> messages at the end of the
155− run, since they may indicate missing dependencies. (Some might be optional
156− dependencies, however.)
107+ For each of the tarballs in the <filename>.list</filename> files, the script downloads it, unpacks it, and searches its <filename>configure.ac</filename> and <filename>*.pc.in</filename> files for dependencies. This information is used to generate <filename>default.nix</filename>. The generator caches downloaded tarballs between runs. Pay close attention to the <literal>NOT FOUND: <replaceable>name</replaceable></literal> messages at the end of the run, since they may indicate missing dependencies. (Some might be optional dependencies, however.)
157108 </para>
158109
159110 <para>
160− A file like <filename>tarballs-7.5.list</filename> contains all tarballs in
161− a X.org release. It can be generated like this:
111+ A file like <filename>tarballs-7.5.list</filename> contains all tarballs in a X.org release. It can be generated like this:
162112<screen>
163113<prompt>$ </prompt>export i="mirror://xorg/X11R7.4/src/everything/"
164114<prompt>$ </prompt>cat $(PRINT_PATH=1 nix-prefetch-url $i | tail -n 1) \
165115 | perl -e 'while (&lt;>) { if (/(href|HREF)="([^"]*.bz2)"/) { print "$ENV{'i'}$2\n"; }; }' \
166116 | sort > tarballs-7.4.list
167117</screen>
168− <filename>extra.list</filename> contains libraries that aren’t part of
169− X.org proper, but are closely related to it, such as
170− <literal>libxcb</literal>. <filename>old.list</filename> contains some
171− packages that were removed from X.org, but are still needed by some people
172− or by other packages (such as <varname>imake</varname>).
118+ <filename>extra.list</filename> contains libraries that aren’t part of X.org proper, but are closely related to it, such as <literal>libxcb</literal>. <filename>old.list</filename> contains some packages that were removed from X.org, but are still needed by some people or by other packages (such as <varname>imake</varname>).
173119 </para>
174120
175121 <para>
176− If the expression for a package requires derivation attributes that the
177− generator cannot figure out automatically (say, <varname>patches</varname>
178− or a <varname>postInstall</varname> hook), you should modify
179− <filename>pkgs/servers/x11/xorg/overrides.nix</filename>.
122+ If the expression for a package requires derivation attributes that the generator cannot figure out automatically (say, <varname>patches</varname> or a <varname>postInstall</varname> hook), you should modify <filename>pkgs/servers/x11/xorg/overrides.nix</filename>.
180123 </para>
181124 </section>
182125<!--============================================================-->
@@ -199,41 +142,19 @@ modulesTree = [kernel]
199142 <title>Eclipse</title>
200143
201144 <para>
202− The Nix expressions related to the Eclipse platform and IDE are in
203− <link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/eclipse"><filename>pkgs/applications/editors/eclipse</filename></link>.
145+ The Nix expressions related to the Eclipse platform and IDE are in <link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/eclipse"><filename>pkgs/applications/editors/eclipse</filename></link>.
204146 </para>
205147
206148 <para>
207− Nixpkgs provides a number of packages that will install Eclipse in its
208− various forms. These range from the bare-bones Eclipse Platform to the more
209− fully featured Eclipse SDK or Scala-IDE packages and multiple version are
210− often available. It is possible to list available Eclipse packages by
211− issuing the command:
149+ Nixpkgs provides a number of packages that will install Eclipse in its various forms. These range from the bare-bones Eclipse Platform to the more fully featured Eclipse SDK or Scala-IDE packages and multiple version are often available. It is possible to list available Eclipse packages by issuing the command:
212150<screen>
213151<prompt>$ </prompt>nix-env -f '&lt;nixpkgs&gt;' -qaP -A eclipses --description
214152</screen>
215− Once an Eclipse variant is installed it can be run using the
216− <command>eclipse</command> command, as expected. From within Eclipse it is
217− then possible to install plugins in the usual manner by either manually
218− specifying an Eclipse update site or by installing the Marketplace Client
219− plugin and using it to discover and install other plugins. This installation
220− method provides an Eclipse installation that closely resemble a manually
221− installed Eclipse.
153+ Once an Eclipse variant is installed it can be run using the <command>eclipse</command> command, as expected. From within Eclipse it is then possible to install plugins in the usual manner by either manually specifying an Eclipse update site or by installing the Marketplace Client plugin and using it to discover and install other plugins. This installation method provides an Eclipse installation that closely resemble a manually installed Eclipse.
222154 </para>
223155
224156 <para>
225− If you prefer to install plugins in a more declarative manner then Nixpkgs
226− also offer a number of Eclipse plugins that can be installed in an
227− <emphasis>Eclipse environment</emphasis>. This type of environment is
228− created using the function <varname>eclipseWithPlugins</varname> found
229− inside the <varname>nixpkgs.eclipses</varname> attribute set. This function
230− takes as argument <literal>{ eclipse, plugins ? [], jvmArgs ? [] }</literal>
231− where <varname>eclipse</varname> is a one of the Eclipse packages described
232− above, <varname>plugins</varname> is a list of plugin derivations, and
233− <varname>jvmArgs</varname> is a list of arguments given to the JVM running
234− the Eclipse. For example, say you wish to install the latest Eclipse
235− Platform with the popular Eclipse Color Theme plugin and also allow Eclipse
236− to use more RAM. You could then add
157+ If you prefer to install plugins in a more declarative manner then Nixpkgs also offer a number of Eclipse plugins that can be installed in an <emphasis>Eclipse environment</emphasis>. This type of environment is created using the function <varname>eclipseWithPlugins</varname> found inside the <varname>nixpkgs.eclipses</varname> attribute set. This function takes as argument <literal>{ eclipse, plugins ? [], jvmArgs ? [] }</literal> where <varname>eclipse</varname> is a one of the Eclipse packages described above, <varname>plugins</varname> is a list of plugin derivations, and <varname>jvmArgs</varname> is a list of arguments given to the JVM running the Eclipse. For example, say you wish to install the latest Eclipse Platform with the popular Eclipse Color Theme plugin and also allow Eclipse to use more RAM. You could then add
237158<screen>
238159packageOverrides = pkgs: {
239160 myEclipse = with pkgs.eclipses; eclipseWithPlugins {
@@ -243,38 +164,18 @@ packageOverrides = pkgs: {
243164 };
244165}
245166</screen>
246− to your Nixpkgs configuration
247− (<filename>~/.config/nixpkgs/config.nix</filename>) and install it by
248− running <command>nix-env -f '&lt;nixpkgs&gt;' -iA myEclipse</command> and
249− afterward run Eclipse as usual. It is possible to find out which plugins are
250− available for installation using <varname>eclipseWithPlugins</varname> by
251− running
167+ to your Nixpkgs configuration (<filename>~/.config/nixpkgs/config.nix</filename>) and install it by running <command>nix-env -f '&lt;nixpkgs&gt;' -iA myEclipse</command> and afterward run Eclipse as usual. It is possible to find out which plugins are available for installation using <varname>eclipseWithPlugins</varname> by running
252168<screen>
253169<prompt>$ </prompt>nix-env -f '&lt;nixpkgs&gt;' -qaP -A eclipses.plugins --description
254170</screen>
255171 </para>
256172
257173 <para>
258− If there is a need to install plugins that are not available in Nixpkgs then
259− it may be possible to define these plugins outside Nixpkgs using the
260− <varname>buildEclipseUpdateSite</varname> and
261− <varname>buildEclipsePlugin</varname> functions found in the
262− <varname>nixpkgs.eclipses.plugins</varname> attribute set. Use the
263− <varname>buildEclipseUpdateSite</varname> function to install a plugin
264− distributed as an Eclipse update site. This function takes <literal>{ name,
265− src }</literal> as argument where <literal>src</literal> indicates the
266− Eclipse update site archive. All Eclipse features and plugins within the
267− downloaded update site will be installed. When an update site archive is not
268− available then the <varname>buildEclipsePlugin</varname> function can be
269− used to install a plugin that consists of a pair of feature and plugin JARs.
270− This function takes an argument <literal>{ name, srcFeature, srcPlugin
271− }</literal> where <literal>srcFeature</literal> and
272− <literal>srcPlugin</literal> are the feature and plugin JARs, respectively.
174+ If there is a need to install plugins that are not available in Nixpkgs then it may be possible to define these plugins outside Nixpkgs using the <varname>buildEclipseUpdateSite</varname> and <varname>buildEclipsePlugin</varname> functions found in the <varname>nixpkgs.eclipses.plugins</varname> attribute set. Use the <varname>buildEclipseUpdateSite</varname> function to install a plugin distributed as an Eclipse update site. This function takes <literal>{ name, src }</literal> as argument where <literal>src</literal> indicates the Eclipse update site archive. All Eclipse features and plugins within the downloaded update site will be installed. When an update site archive is not available then the <varname>buildEclipsePlugin</varname> function can be used to install a plugin that consists of a pair of feature and plugin JARs. This function takes an argument <literal>{ name, srcFeature, srcPlugin }</literal> where <literal>srcFeature</literal> and <literal>srcPlugin</literal> are the feature and plugin JARs, respectively.
273175 </para>
274176
275177 <para>
276− Expanding the previous example with two plugins using the above functions we
277− have
178+ Expanding the previous example with two plugins using the above functions we have
278179<screen>
279180packageOverrides = pkgs: {
280181 myEclipse = with pkgs.eclipses; eclipseWithPlugins {
@@ -311,19 +212,15 @@ packageOverrides = pkgs: {
311212 <title>Elm</title>
312213
313214 <para>
314− To start a development environment do <command>nix-shell -p elmPackages.elm
315− elmPackages.elm-format</command>
215+ To start a development environment do <command>nix-shell -p elmPackages.elm elmPackages.elm-format</command>
316216 </para>
317217
318218 <para>
319− To update Elm compiler, see
320− <filename>nixpkgs/pkgs/development/compilers/elm/README.md</filename>.
219+ To update Elm compiler, see <filename>nixpkgs/pkgs/development/compilers/elm/README.md</filename>.
321220 </para>
322221
323222 <para>
324− To package Elm applications,
325− <link xlink:href="https://github.com/hercules-ci/elm2nix#elm2nix">read about
326− elm2nix</link>.
223+ To package Elm applications, <link xlink:href="https://github.com/hercules-ci/elm2nix#elm2nix">read about elm2nix</link>.
327224 </para>
328225 </section>
329226 <section xml:id="sec-kakoune">
@@ -342,11 +239,7 @@ packageOverrides = pkgs: {
342239 <title>Interactive shell helpers</title>
343240
344241 <para>
345− Some packages provide the shell integration to be more useful. But unlike
346− other systems, nix doesn't have a standard share directory location. This is
347− why a bunch <command>PACKAGE-share</command> scripts are shipped that print
348− the location of the corresponding shared folder. Current list of such
349− packages is as following:
242+ Some packages provide the shell integration to be more useful. But unlike other systems, nix doesn't have a standard share directory location. This is why a bunch <command>PACKAGE-share</command> scripts are shipped that print the location of the corresponding shared folder. Current list of such packages is as following:
350243 <itemizedlist>
351244 <listitem>
352245 <para>
@@ -369,31 +262,20 @@ packageOverrides = pkgs: {
369262 <title>Weechat</title>
370263
371264 <para>
372− Weechat can be configured to include your choice of plugins, reducing its
373− closure size from the default configuration which includes all available
374− plugins. To make use of this functionality, install an expression that
375− overrides its configuration such as
265+ Weechat can be configured to include your choice of plugins, reducing its closure size from the default configuration which includes all available plugins. To make use of this functionality, install an expression that overrides its configuration such as
376266<programlisting>weechat.override {configure = {availablePlugins, ...}: {
377267 plugins = with availablePlugins; [ python perl ];
378268 }
379269}</programlisting>
380− If the <literal>configure</literal> function returns an attrset without the
381− <literal>plugins</literal> attribute, <literal>availablePlugins</literal>
382− will be used automatically.
270+ If the <literal>configure</literal> function returns an attrset without the <literal>plugins</literal> attribute, <literal>availablePlugins</literal> will be used automatically.
383271 </para>
384272
385273 <para>
386− The plugins currently available are <literal>python</literal>,
387− <literal>perl</literal>, <literal>ruby</literal>, <literal>guile</literal>,
388− <literal>tcl</literal> and <literal>lua</literal>.
274+ The plugins currently available are <literal>python</literal>, <literal>perl</literal>, <literal>ruby</literal>, <literal>guile</literal>, <literal>tcl</literal> and <literal>lua</literal>.
389275 </para>
390276
391277 <para>
392− The python and perl plugins allows the addition of extra libraries. For
393− instance, the <literal>inotify.py</literal> script in weechat-scripts
394− requires D-Bus or libnotify, and the <literal>fish.py</literal> script
395− requires pycrypto. To use these scripts, use the plugin's
396− <literal>withPackages</literal> attribute:
278+ The python and perl plugins allows the addition of extra libraries. For instance, the <literal>inotify.py</literal> script in weechat-scripts requires D-Bus or libnotify, and the <literal>fish.py</literal> script requires pycrypto. To use these scripts, use the plugin's <literal>withPackages</literal> attribute:
397279<programlisting>weechat.override { configure = {availablePlugins, ...}: {
398280 plugins = with availablePlugins; [
399281 (python.withPackages (ps: with ps; [ pycrypto python-dbus ]))
@@ -404,8 +286,7 @@ packageOverrides = pkgs: {
404286 </para>
405287
406288 <para>
407− In order to also keep all default plugins installed, it is possible to use
408− the following method:
289+ In order to also keep all default plugins installed, it is possible to use the following method:
409290<programlisting>weechat.override { configure = { availablePlugins, ... }: {
410291 plugins = builtins.attrValues (availablePlugins // {
411292 python = availablePlugins.python.withPackages (ps: with ps; [ pycrypto python-dbus ]);
@@ -415,9 +296,7 @@ packageOverrides = pkgs: {
415296 </para>
416297
417298 <para>
418− WeeChat allows to set defaults on startup using the
419− <literal>--run-command</literal>. The <literal>configure</literal> method
420− can be used to pass commands to the program:
299+ WeeChat allows to set defaults on startup using the <literal>--run-command</literal>. The <literal>configure</literal> method can be used to pass commands to the program:
421300<programlisting>weechat.override {
422301 configure = { availablePlugins, ... }: {
423302 init = ''
@@ -426,14 +305,11 @@ packageOverrides = pkgs: {
426305 '';
427306 };
428307}</programlisting>
429− Further values can be added to the list of commands when running
430− <literal>weechat --run-command "your-commands"</literal>.
308+ Further values can be added to the list of commands when running <literal>weechat --run-command "your-commands"</literal>.
431309 </para>
432310
433311 <para>
434− Additionally it's possible to specify scripts to be loaded when starting
435− <literal>weechat</literal>. These will be loaded before the commands from
436− <literal>init</literal>:
312+ Additionally it's possible to specify scripts to be loaded when starting <literal>weechat</literal>. These will be loaded before the commands from <literal>init</literal>:
437313<programlisting>weechat.override {
438314 configure = { availablePlugins, ... }: {
439315 scripts = with pkgs.weechatScripts; [
@@ -447,11 +323,7 @@ packageOverrides = pkgs: {
447323 </para>
448324
449325 <para>
450− In <literal>nixpkgs</literal> there's a subpackage which contains
451− derivations for WeeChat scripts. Such derivations expect a
452− <literal>passthru.scripts</literal> attribute which contains a list of all
453− scripts inside the store path. Furthermore all scripts have to live in
454− <literal>$out/share</literal>. An exemplary derivation looks like this:
326+ In <literal>nixpkgs</literal> there's a subpackage which contains derivations for WeeChat scripts. Such derivations expect a <literal>passthru.scripts</literal> attribute which contains a list of all scripts inside the store path. Furthermore all scripts have to live in <literal>$out/share</literal>. An exemplary derivation looks like this:
455327<programlisting>{ stdenv, fetchurl }:
456328
457329stdenv.mkDerivation {
@@ -480,18 +352,11 @@ stdenv.mkDerivation {
480352 <title>Activating the engine</title>
481353
482354 <para>
483− IBus needs to be configured accordingly to activate
484− <literal>typing-booster</literal>. The configuration depends on the desktop
485− manager in use. For detailed instructions, please refer to the
486− <link xlink:href="https://mike-fabian.github.io/ibus-typing-booster/documentation.html">upstream
487− docs</link>.
355+ IBus needs to be configured accordingly to activate <literal>typing-booster</literal>. The configuration depends on the desktop manager in use. For detailed instructions, please refer to the <link xlink:href="https://mike-fabian.github.io/ibus-typing-booster/documentation.html">upstream docs</link>.
488356 </para>
489357
490358 <para>
491− On NixOS you need to explicitly enable <literal>ibus</literal> with given
492− engines before customizing your desktop to use
493− <literal>typing-booster</literal>. This can be achieved using the
494− <literal>ibus</literal> module:
359+ On NixOS you need to explicitly enable <literal>ibus</literal> with given engines before customizing your desktop to use <literal>typing-booster</literal>. This can be achieved using the <literal>ibus</literal> module:
495360<programlisting>{ pkgs, ... }: {
496361 i18n.inputMethod = {
497362 enabled = "ibus";
@@ -505,21 +370,14 @@ stdenv.mkDerivation {
505370 <title>Using custom hunspell dictionaries</title>
506371
507372 <para>
508− The IBus engine is based on <literal>hunspell</literal> to support
509− completion in many languages. By default the dictionaries
510− <literal>de-de</literal>, <literal>en-us</literal>,
511− <literal>fr-moderne</literal> <literal>es-es</literal>,
512− <literal>it-it</literal>, <literal>sv-se</literal> and
513− <literal>sv-fi</literal> are in use. To add another dictionary, the package
514− can be overridden like this:
373+ The IBus engine is based on <literal>hunspell</literal> to support completion in many languages. By default the dictionaries <literal>de-de</literal>, <literal>en-us</literal>, <literal>fr-moderne</literal> <literal>es-es</literal>, <literal>it-it</literal>, <literal>sv-se</literal> and <literal>sv-fi</literal> are in use. To add another dictionary, the package can be overridden like this:
515374<programlisting>ibus-engines.typing-booster.override {
516375 langs = [ "de-at" "en-gb" ];
517376}</programlisting>
518377 </para>
519378
520379 <para>
521− <emphasis>Note: each language passed to <literal>langs</literal> must be an
522− attribute name in <literal>pkgs.hunspellDicts</literal>.</emphasis>
380+ <emphasis>Note: each language passed to <literal>langs</literal> must be an attribute name in <literal>pkgs.hunspellDicts</literal>.</emphasis>
523381 </para>
524382 </section>
525383
@@ -527,10 +385,7 @@ stdenv.mkDerivation {
527385 <title>Built-in emoji picker</title>
528386
529387 <para>
530− The <literal>ibus-engines.typing-booster</literal> package contains a
531− program named <literal>emoji-picker</literal>. To display all emojis
532− correctly, a special font such as <literal>noto-fonts-emoji</literal> is
533− needed:
388+ The <literal>ibus-engines.typing-booster</literal> package contains a program named <literal>emoji-picker</literal>. To display all emojis correctly, a special font such as <literal>noto-fonts-emoji</literal> is needed:
534389 </para>
535390
536391 <para>
@@ -545,45 +400,22 @@ stdenv.mkDerivation {
545400 <title>Nginx</title>
546401
547402 <para>
548− <link xlink:href="https://nginx.org/">Nginx</link> is a reverse proxy and
549− lightweight webserver.
403+ <link xlink:href="https://nginx.org/">Nginx</link> is a reverse proxy and lightweight webserver.
550404 </para>
551405
552406 <section xml:id="sec-nginx-etag">
553407 <title>ETags on static files served from the Nix store</title>
554408
555409 <para>
556− HTTP has a couple different mechanisms for caching to prevent clients from
557− having to download the same content repeatedly if a resource has not
558− changed since the last time it was requested. When nginx is used as a
559− server for static files, it implements the caching mechanism based on the
560− <link xlink:href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Last-Modified"><literal>Last-Modified</literal></link>
561− response header automatically; unfortunately, it works by using filesystem
562− timestamps to determine the value of the <literal>Last-Modified</literal>
563− header. This doesn't give the desired behavior when the file is in the Nix
564− store, because all file timestamps are set to 0 (for reasons related to
565− build reproducibility).
410+ HTTP has a couple different mechanisms for caching to prevent clients from having to download the same content repeatedly if a resource has not changed since the last time it was requested. When nginx is used as a server for static files, it implements the caching mechanism based on the <link xlink:href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Last-Modified"><literal>Last-Modified</literal></link> response header automatically; unfortunately, it works by using filesystem timestamps to determine the value of the <literal>Last-Modified</literal> header. This doesn't give the desired behavior when the file is in the Nix store, because all file timestamps are set to 0 (for reasons related to build reproducibility).
566411 </para>
567412
568413 <para>
569− Fortunately, HTTP supports an alternative (and more effective) caching
570− mechanism: the
571− <link xlink:href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag"><literal>ETag</literal></link>
572− response header. The value of the <literal>ETag</literal> header specifies
573− some identifier for the particular content that the server is sending (e.g.
574− a hash). When a client makes a second request for the same resource, it
575− sends that value back in an <literal>If-None-Match</literal> header. If the
576− ETag value is unchanged, then the server does not need to resend the
577− content.
414+ Fortunately, HTTP supports an alternative (and more effective) caching mechanism: the <link xlink:href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag"><literal>ETag</literal></link> response header. The value of the <literal>ETag</literal> header specifies some identifier for the particular content that the server is sending (e.g. a hash). When a client makes a second request for the same resource, it sends that value back in an <literal>If-None-Match</literal> header. If the ETag value is unchanged, then the server does not need to resend the content.
578415 </para>
579416
580417 <para>
581− As of NixOS 19.09, the nginx package in Nixpkgs is patched such that when
582− nginx serves a file out of <filename>/nix/store</filename>, the hash in the
583− store path is used as the <literal>ETag</literal> header in the HTTP
584− response, thus providing proper caching functionality. This happens
585− automatically; you do not need to do modify any configuration to get this
586− behavior.
418+ As of NixOS 19.09, the nginx package in Nixpkgs is patched such that when nginx serves a file out of <filename>/nix/store</filename>, the hash in the store path is used as the <literal>ETag</literal> header in the HTTP response, thus providing proper caching functionality. This happens automatically; you do not need to do modify any configuration to get this behavior.
587419 </para>
588420 </section>
589421 </section>
doc/package-specific-user-notes.xml+28−147
@@ -1,46 +1,24 @@
11<chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="package-specific-user-notes">
22 <title>Package-specific usage notes</title>
33 <para>
4− These chapters includes some notes that apply to specific packages and should
5− answer some of the frequently asked questions related to Nixpkgs use. Some
6− useful information related to package use can be found in
7− <link linkend="chap-package-notes">package-specific development notes</link>.
4+ These chapters includes some notes that apply to specific packages and should answer some of the frequently asked questions related to Nixpkgs use. Some useful information related to package use can be found in <link linkend="chap-package-notes">package-specific development notes</link>.
85 </para>
96 <section xml:id="opengl">
107 <title>OpenGL</title>
118
129 <para>
13− Packages that use OpenGL have NixOS desktop as their primary target. The
14− current solution for loading the GPU-specific drivers is based on
15− <literal>libglvnd</literal> and looks for the driver implementation in
16− <literal>LD_LIBRARY_PATH</literal>. If you are using a non-NixOS
17− GNU/Linux/X11 desktop with free software video drivers, consider launching
18− OpenGL-dependent programs from Nixpkgs with Nixpkgs versions of
19− <literal>libglvnd</literal> and <literal>mesa_drivers</literal> in
20− <literal>LD_LIBRARY_PATH</literal>. For proprietary video drivers you might
21− have luck with also adding the corresponding video driver package.
10+ Packages that use OpenGL have NixOS desktop as their primary target. The current solution for loading the GPU-specific drivers is based on <literal>libglvnd</literal> and looks for the driver implementation in <literal>LD_LIBRARY_PATH</literal>. If you are using a non-NixOS GNU/Linux/X11 desktop with free software video drivers, consider launching OpenGL-dependent programs from Nixpkgs with Nixpkgs versions of <literal>libglvnd</literal> and <literal>mesa_drivers</literal> in <literal>LD_LIBRARY_PATH</literal>. For proprietary video drivers you might have luck with also adding the corresponding video driver package.
2211 </para>
2312 </section>
2413 <section xml:id="locales">
2514 <title>Locales</title>
2615
2716 <para>
28− To allow simultaneous use of packages linked against different versions of
29− <literal>glibc</literal> with different locale archive formats Nixpkgs
30− patches <literal>glibc</literal> to rely on
31− <literal>LOCALE_ARCHIVE</literal> environment variable.
17+ To allow simultaneous use of packages linked against different versions of <literal>glibc</literal> with different locale archive formats Nixpkgs patches <literal>glibc</literal> to rely on <literal>LOCALE_ARCHIVE</literal> environment variable.
3218 </para>
3319
3420 <para>
35− On non-NixOS distributions this variable is obviously not set. This can
36− cause regressions in language support or even crashes in some
37− Nixpkgs-provided programs. The simplest way to mitigate this problem is
38− exporting the <literal>LOCALE_ARCHIVE</literal> variable pointing to
39− <literal>${glibcLocales}/lib/locale/locale-archive</literal>. The drawback
40− (and the reason this is not the default) is the relatively large (a hundred
41− MiB) size of the full set of locales. It is possible to build a custom set
42− of locales by overriding parameters <literal>allLocales</literal> and
43− <literal>locales</literal> of the package.
21+ On non-NixOS distributions this variable is obviously not set. This can cause regressions in language support or even crashes in some Nixpkgs-provided programs. The simplest way to mitigate this problem is exporting the <literal>LOCALE_ARCHIVE</literal> variable pointing to <literal>${glibcLocales}/lib/locale/locale-archive</literal>. The drawback (and the reason this is not the default) is the relatively large (a hundred MiB) size of the full set of locales. It is possible to build a custom set of locales by overriding parameters <literal>allLocales</literal> and <literal>locales</literal> of the package.
4422 </para>
4523 </section>
4624 <section xml:id="sec-emacs">
@@ -50,15 +28,7 @@
5028 <title>Configuring Emacs</title>
5129
5230 <para>
53− The Emacs package comes with some extra helpers to make it easier to
54− configure. <varname>emacsWithPackages</varname> allows you to manage
55− packages from ELPA. This means that you will not have to install that
56− packages from within Emacs. For instance, if you wanted to use
57− <literal>company</literal>, <literal>counsel</literal>,
58− <literal>flycheck</literal>, <literal>ivy</literal>,
59− <literal>magit</literal>, <literal>projectile</literal>, and
60− <literal>use-package</literal> you could use this as a
61− <filename>~/.config/nixpkgs/config.nix</filename> override:
31+ The Emacs package comes with some extra helpers to make it easier to configure. <varname>emacsWithPackages</varname> allows you to manage packages from ELPA. This means that you will not have to install that packages from within Emacs. For instance, if you wanted to use <literal>company</literal>, <literal>counsel</literal>, <literal>flycheck</literal>, <literal>ivy</literal>, <literal>magit</literal>, <literal>projectile</literal>, and <literal>use-package</literal> you could use this as a <filename>~/.config/nixpkgs/config.nix</filename> override:
6232 </para>
6333
6434<screen>
@@ -78,15 +48,7 @@
7848</screen>
7949
8050 <para>
81− You can install it like any other packages via <command>nix-env -iA
82− myEmacs</command>. However, this will only install those packages. It will
83− not <literal>configure</literal> them for us. To do this, we need to
84− provide a configuration file. Luckily, it is possible to do this from
85− within Nix! By modifying the above example, we can make Emacs load a custom
86− config file. The key is to create a package that provide a
87− <filename>default.el</filename> file in
88− <filename>/share/emacs/site-start/</filename>. Emacs knows to load this
89− file automatically when it starts.
51+ You can install it like any other packages via <command>nix-env -iA myEmacs</command>. However, this will only install those packages. It will not <literal>configure</literal> them for us. To do this, we need to provide a configuration file. Luckily, it is possible to do this from within Nix! By modifying the above example, we can make Emacs load a custom config file. The key is to create a package that provide a <filename>default.el</filename> file in <filename>/share/emacs/site-start/</filename>. Emacs knows to load this file automatically when it starts.
9052 </para>
9153
9254<screen>
@@ -168,22 +130,11 @@ cp ${myEmacsConfig} $out/share/emacs/site-lisp/default.el
168130</screen>
169131
170132 <para>
171− This provides a fairly full Emacs start file. It will load in addition to
172− the user's presonal config. You can always disable it by passing
173− <command>-q</command> to the Emacs command.
133+ This provides a fairly full Emacs start file. It will load in addition to the user's presonal config. You can always disable it by passing <command>-q</command> to the Emacs command.
174134 </para>
175135
176136 <para>
177− Sometimes <varname>emacsWithPackages</varname> is not enough, as this
178− package set has some priorities imposed on packages (with the lowest
179− priority assigned to Melpa Unstable, and the highest for packages manually
180− defined in <filename>pkgs/top-level/emacs-packages.nix</filename>). But you
181− can't control this priorities when some package is installed as a
182− dependency. You can override it on per-package-basis, providing all the
183− required dependencies manually - but it's tedious and there is always a
184− possibility that an unwanted dependency will sneak in through some other
185− package. To completely override such a package you can use
186− <varname>overrideScope'</varname>.
137+ Sometimes <varname>emacsWithPackages</varname> is not enough, as this package set has some priorities imposed on packages (with the lowest priority assigned to Melpa Unstable, and the highest for packages manually defined in <filename>pkgs/top-level/emacs-packages.nix</filename>). But you can't control this priorities when some package is installed as a dependency. You can override it on per-package-basis, providing all the required dependencies manually - but it's tedious and there is always a possibility that an unwanted dependency will sneak in through some other package. To completely override such a package you can use <varname>overrideScope'</varname>.
187138 </para>
188139
189140<screen>
@@ -203,23 +154,18 @@ overrides = self: super: rec {
203154 <title>DLib</title>
204155
205156 <para>
206− <link xlink:href="http://dlib.net/">DLib</link> is a modern, C++-based
207− toolkit which provides several machine learning algorithms.
157+ <link xlink:href="http://dlib.net/">DLib</link> is a modern, C++-based toolkit which provides several machine learning algorithms.
208158 </para>
209159
210160 <section xml:id="compiling-without-avx-support">
211161 <title>Compiling without AVX support</title>
212162
213163 <para>
214− Especially older CPUs don't support
215− <link xlink:href="https://en.wikipedia.org/wiki/Advanced_Vector_Extensions">AVX</link>
216− (<abbrev>Advanced Vector Extensions</abbrev>) instructions that are used by
217− DLib to optimize their algorithms.
164+ Especially older CPUs don't support <link xlink:href="https://en.wikipedia.org/wiki/Advanced_Vector_Extensions">AVX</link> (<abbrev>Advanced Vector Extensions</abbrev>) instructions that are used by DLib to optimize their algorithms.
218165 </para>
219166
220167 <para>
221− On the affected hardware errors like <literal>Illegal instruction</literal>
222− will occur. In those cases AVX support needs to be disabled:
168+ On the affected hardware errors like <literal>Illegal instruction</literal> will occur. In those cases AVX support needs to be disabled:
223169<programlisting>self: super: {
224170 dlib = super.dlib.override { avxSupport = false; };
225171}</programlisting>
@@ -230,22 +176,11 @@ overrides = self: super: rec {
230176 <title>Unfree software</title>
231177
232178 <para>
233− All users of Nixpkgs are free software users, and many users (and
234− developers) of Nixpkgs want to limit and tightly control their exposure to
235− unfree software. At the same time, many users need (or want) to run some
236− specific pieces of proprietary software. Nixpkgs includes some expressions
237− for unfree software packages. By default unfree software cannot be installed
238− and doesn’t show up in searches. To allow installing unfree software in a
239− single Nix invocation one can export
240− <literal>NIXPKGS_ALLOW_UNFREE=1</literal>. For a persistent solution, users
241− can set <literal>allowUnfree</literal> in the Nixpkgs configuration.
179+ All users of Nixpkgs are free software users, and many users (and developers) of Nixpkgs want to limit and tightly control their exposure to unfree software. At the same time, many users need (or want) to run some specific pieces of proprietary software. Nixpkgs includes some expressions for unfree software packages. By default unfree software cannot be installed and doesn’t show up in searches. To allow installing unfree software in a single Nix invocation one can export <literal>NIXPKGS_ALLOW_UNFREE=1</literal>. For a persistent solution, users can set <literal>allowUnfree</literal> in the Nixpkgs configuration.
242180 </para>
243181
244182 <para>
245− Fine-grained control is possible by defining
246− <literal>allowUnfreePredicate</literal> function in config; it takes the
247− <literal>mkDerivation</literal> parameter attrset and returns
248− <literal>true</literal> for unfree packages that should be allowed.
183+ Fine-grained control is possible by defining <literal>allowUnfreePredicate</literal> function in config; it takes the <literal>mkDerivation</literal> parameter attrset and returns <literal>true</literal> for unfree packages that should be allowed.
249184 </para>
250185 </section>
251186 <section xml:id="sec-steam">
@@ -255,13 +190,7 @@ overrides = self: super: rec {
255190 <title>Steam in Nix</title>
256191
257192 <para>
258− Steam is distributed as a <filename>.deb</filename> file, for now only as
259− an i686 package (the amd64 package only has documentation). When unpacked,
260− it has a script called <filename>steam</filename> that in Ubuntu (their
261− target distro) would go to <filename>/usr/bin </filename>. When run for the
262− first time, this script copies some files to the user's home, which include
263− another script that is the ultimate responsible for launching the steam
264− binary, which is also in $HOME.
193+ Steam is distributed as a <filename>.deb</filename> file, for now only as an i686 package (the amd64 package only has documentation). When unpacked, it has a script called <filename>steam</filename> that in Ubuntu (their target distro) would go to <filename>/usr/bin </filename>. When run for the first time, this script copies some files to the user's home, which include another script that is the ultimate responsible for launching the steam binary, which is also in $HOME.
265194 </para>
266195
267196 <para>
@@ -269,8 +198,7 @@ overrides = self: super: rec {
269198 <itemizedlist>
270199 <listitem>
271200 <para>
272− We don't have <filename>/bin/bash</filename> and many scripts point
273− there. Similarly for <filename>/usr/bin/python</filename> .
201+ We don't have <filename>/bin/bash</filename> and many scripts point there. Similarly for <filename>/usr/bin/python</filename> .
274202 </para>
275203 </listitem>
276204 <listitem>
@@ -280,8 +208,7 @@ overrides = self: super: rec {
280208 </listitem>
281209 <listitem>
282210 <para>
283− The <filename>steam.sh</filename> script in $HOME can not be patched, as
284− it is checked and rewritten by steam.
211+ The <filename>steam.sh</filename> script in $HOME can not be patched, as it is checked and rewritten by steam.
285212 </para>
286213 </listitem>
287214 <listitem>
@@ -293,11 +220,7 @@ overrides = self: super: rec {
293220 </para>
294221
295222 <para>
296− The current approach to deploy Steam in NixOS is composing a FHS-compatible
297− chroot environment, as documented
298− <link xlink:href="http://sandervanderburg.blogspot.nl/2013/09/composing-fhs-compatible-chroot.html">here</link>.
299− This allows us to have binaries in the expected paths without disrupting
300− the system, and to avoid patching them to work in a non FHS environment.
223+ The current approach to deploy Steam in NixOS is composing a FHS-compatible chroot environment, as documented <link xlink:href="http://sandervanderburg.blogspot.nl/2013/09/composing-fhs-compatible-chroot.html">here</link>. This allows us to have binaries in the expected paths without disrupting the system, and to avoid patching them to work in a non FHS environment.
301224 </para>
302225 </section>
303226
@@ -309,9 +232,7 @@ overrides = self: super: rec {
309232<programlisting>hardware.opengl.driSupport32Bit = true;</programlisting>
310233 in your <filename>/etc/nixos/configuration.nix</filename>. You'll also need
311234<programlisting>hardware.pulseaudio.support32Bit = true;</programlisting>
312− if you are using PulseAudio - this will enable 32bit ALSA apps integration.
313− To use the Steam controller or other Steam supported controllers such as
314− the DualShock 4 or Nintendo Switch Pro, you need to add
235+ if you are using PulseAudio - this will enable 32bit ALSA apps integration. To use the Steam controller or other Steam supported controllers such as the DualShock 4 or Nintendo Switch Pro, you need to add
315236<programlisting>hardware.steam-hardware.enable = true;</programlisting>
316237 to your configuration.
317238 </para>
@@ -342,19 +263,14 @@ overrides = self: super: rec {
342263 <itemizedlist>
343264 <listitem>
344265 <para>
345− The <literal>newStdcpp</literal> parameter was removed since NixOS
346− 17.09 and should not be needed anymore.
266+ The <literal>newStdcpp</literal> parameter was removed since NixOS 17.09 and should not be needed anymore.
347267 </para>
348268 </listitem>
349269 <listitem>
350270 <para>
351− Steam ships statically linked with a version of libcrypto that
352− conflics with the one dynamically loaded by radeonsi_dri.so. If you
353− get the error
271+ Steam ships statically linked with a version of libcrypto that conflics with the one dynamically loaded by radeonsi_dri.so. If you get the error
354272<programlisting>steam.sh: line 713: 7842 Segmentation fault (core dumped)</programlisting>
355− have a look at
356− <link xlink:href="https://github.com/NixOS/nixpkgs/pull/20269">this
357− pull request</link>.
273+ have a look at <link xlink:href="https://github.com/NixOS/nixpkgs/pull/20269">this pull request</link>.
358274 </para>
359275 </listitem>
360276 </itemizedlist>
@@ -368,8 +284,7 @@ overrides = self: super: rec {
368284 <orderedlist>
369285 <listitem>
370286 <para>
371− There is no java in steam chrootenv by default. If you get a message
372− like
287+ There is no java in steam chrootenv by default. If you get a message like
373288<programlisting>/home/foo/.local/share/Steam/SteamApps/common/towns/towns.sh: line 1: java: command not found</programlisting>
374289 You need to add
375290<programlisting> steam.override { withJava = true; };</programlisting>
@@ -387,8 +302,7 @@ overrides = self: super: rec {
387302 <title>steam-run</title>
388303
389304 <para>
390− The FHS-compatible chroot used for steam can also be used to run other
391− linux games that expect a FHS environment. To do it, add
305+ The FHS-compatible chroot used for steam can also be used to run other linux games that expect a FHS environment. To do it, add
392306<programlisting>pkgs.(steam.override {
393307 nativeOnly = true;
394308 newStdcpp = true;
@@ -404,46 +318,23 @@ overrides = self: super: rec {
404318 <para>
405319 <note>
406320 <para>
407− Please note that the <literal>citrix_receiver</literal> package has been
408− deprecated since its development was
409− <link xlink:href="https://docs.citrix.com/en-us/citrix-workspace-app.html">discontinued
410− by upstream</link> and has been replaced by
411− <link xlink:href="https://www.citrix.com/products/workspace-app/">the
412− citrix workspace app</link>.
321+ Please note that the <literal>citrix_receiver</literal> package has been deprecated since its development was <link xlink:href="https://docs.citrix.com/en-us/citrix-workspace-app.html">discontinued by upstream</link> and has been replaced by <link xlink:href="https://www.citrix.com/products/workspace-app/">the citrix workspace app</link>.
413322 </para>
414323 </note>
415− <link xlink:href="https://www.citrix.com/products/receiver/">Citrix
416− Receiver</link> and
417− <link xlink:href="https://www.citrix.com/products/workspace-app/">Citrix
418− Workspace App</link> are a remote desktop viewers which provide access to
419− <link xlink:href="https://www.citrix.com/products/xenapp-xendesktop/">XenDesktop</link>
420− installations.
324+ <link xlink:href="https://www.citrix.com/products/receiver/">Citrix Receiver</link> and <link xlink:href="https://www.citrix.com/products/workspace-app/">Citrix Workspace App</link> are a remote desktop viewers which provide access to <link xlink:href="https://www.citrix.com/products/xenapp-xendesktop/">XenDesktop</link> installations.
421325 </para>
422326
423327 <section xml:id="sec-citrix-base">
424328 <title>Basic usage</title>
425329
426330 <para>
427− The tarball archive needs to be downloaded manually as the license
428− agreements of the vendor for
429− <link xlink:href="https://www.citrix.com/downloads/citrix-receiver/">Citrix
430− Receiver</link> or
431− <link xlink:href="https://www.citrix.de/downloads/workspace-app/linux/workspace-app-for-linux-latest.html">Citrix
432− Workspace</link> need to be accepted first. Then run
433− <command>nix-prefetch-url file://$PWD/linuxx64-$version.tar.gz</command>.
434− With the archive available in the store the package can be built and
435− installed with Nix.
331+ The tarball archive needs to be downloaded manually as the license agreements of the vendor for <link xlink:href="https://www.citrix.com/downloads/citrix-receiver/">Citrix Receiver</link> or <link xlink:href="https://www.citrix.de/downloads/workspace-app/linux/workspace-app-for-linux-latest.html">Citrix Workspace</link> need to be accepted first. Then run <command>nix-prefetch-url file://$PWD/linuxx64-$version.tar.gz</command>. With the archive available in the store the package can be built and installed with Nix.
436332 </para>
437333
438334 <warning>
439335 <title>Caution with <command>nix-shell</command> installs</title>
440336 <para>
441− It's recommended to install <literal>Citrix Receiver</literal> and/or
442− <literal>Citrix Workspace</literal> using <literal>nix-env -i</literal> or
443− globally to ensure that the <literal>.desktop</literal> files are
444− installed properly into <literal>$XDG_CONFIG_DIRS</literal>. Otherwise it
445− won't be possible to open <literal>.ica</literal> files automatically from
446− the browser to start a Citrix connection.
337+ It's recommended to install <literal>Citrix Receiver</literal> and/or <literal>Citrix Workspace</literal> using <literal>nix-env -i</literal> or globally to ensure that the <literal>.desktop</literal> files are installed properly into <literal>$XDG_CONFIG_DIRS</literal>. Otherwise it won't be possible to open <literal>.ica</literal> files automatically from the browser to start a Citrix connection.
447338 </para>
448339 </warning>
449340 </section>
@@ -452,17 +343,7 @@ overrides = self: super: rec {
452343 <title>Custom certificates</title>
453344
454345 <para>
455− The <literal>Citrix Workspace App</literal> in <literal>nixpkgs</literal>
456− trust several certificates
457− <link xlink:href="https://curl.haxx.se/docs/caextract.html">from the
458− Mozilla database</link> by default. However several companies using Citrix
459− might require their own corporate certificate. On distros with imperative
460− packaging these certs can be stored easily in
461− <link xlink:href="https://developer-docs.citrix.com/projects/receiver-for-linux-command-reference/en/13.7/"><literal>$ICAROOT</literal></link>,
462− however this directory is a store path in <literal>nixpkgs</literal>. In
463− order to work around this issue the package provides a simple mechanism to
464− add custom certificates without rebuilding the entire package using
465− <literal>symlinkJoin</literal>:
346+ The <literal>Citrix Workspace App</literal> in <literal>nixpkgs</literal> trust several certificates <link xlink:href="https://curl.haxx.se/docs/caextract.html">from the Mozilla database</link> by default. However several companies using Citrix might require their own corporate certificate. On distros with imperative packaging these certs can be stored easily in <link xlink:href="https://developer-docs.citrix.com/projects/receiver-for-linux-command-reference/en/13.7/"><literal>$ICAROOT</literal></link>, however this directory is a store path in <literal>nixpkgs</literal>. In order to work around this issue the package provides a simple mechanism to add custom certificates without rebuilding the entire package using <literal>symlinkJoin</literal>:
466347<programlisting>
467348<![CDATA[with import <nixpkgs> { config.allowUnfree = true; };
468349let extraCerts = [ ./custom-cert-1.pem ./custom-cert-2.pem /* ... */ ]; in
doc/platform-notes.xml+6−28
@@ -12,12 +12,7 @@
1212 <itemizedlist>
1313 <listitem>
1414 <para>
15− The Darwin <literal>stdenv</literal> uses clang instead of gcc. When
16− referring to the compiler <varname>$CC</varname> or <command>cc</command>
17− will work in both cases. Some builds hardcode gcc/g++ in their build
18− scripts, that can usually be fixed with using something like
19− <literal>makeFlags = [ "CC=cc" ];</literal> or by patching the build
20− scripts.
15+ The Darwin <literal>stdenv</literal> uses clang instead of gcc. When referring to the compiler <varname>$CC</varname> or <command>cc</command> will work in both cases. Some builds hardcode gcc/g++ in their build scripts, that can usually be fixed with using something like <literal>makeFlags = [ "CC=cc" ];</literal> or by patching the build scripts.
2116 </para>
2217<programlisting>
2318stdenv.mkDerivation {
@@ -31,12 +26,7 @@ stdenv.mkDerivation {
3126 </listitem>
3227 <listitem>
3328 <para>
34− On Darwin, libraries are linked using absolute paths, libraries are
35− resolved by their <literal>install_name</literal> at link time. Sometimes
36− packages won't set this correctly causing the library lookups to fail at
37− runtime. This can be fixed by adding extra linker flags or by running
38− <command>install_name_tool -id</command> during the
39− <function>fixupPhase</function>.
29+ On Darwin, libraries are linked using absolute paths, libraries are resolved by their <literal>install_name</literal> at link time. Sometimes packages won't set this correctly causing the library lookups to fail at runtime. This can be fixed by adding extra linker flags or by running <command>install_name_tool -id</command> during the <function>fixupPhase</function>.
4030 </para>
4131<programlisting>
4232stdenv.mkDerivation {
@@ -48,16 +38,10 @@ stdenv.mkDerivation {
4838 </listitem>
4939 <listitem>
5040 <para>
51− Even if the libraries are linked using absolute paths and resolved via
52− their <literal>install_name</literal> correctly, tests can sometimes fail
53− to run binaries. This happens because the <varname>checkPhase</varname>
54− runs before the libraries are installed.
41+ Even if the libraries are linked using absolute paths and resolved via their <literal>install_name</literal> correctly, tests can sometimes fail to run binaries. This happens because the <varname>checkPhase</varname> runs before the libraries are installed.
5542 </para>
5643 <para>
57− This can usually be solved by running the tests after the
58− <varname>installPhase</varname> or alternatively by using
59− <varname>DYLD_LIBRARY_PATH</varname>. More information about this variable
60− can be found in the <citerefentry>
44+ This can usually be solved by running the tests after the <varname>installPhase</varname> or alternatively by using <varname>DYLD_LIBRARY_PATH</varname>. More information about this variable can be found in the <citerefentry>
6145 <refentrytitle>dyld</refentrytitle>
6246 <manvolnum>1</manvolnum></citerefentry> manpage.
6347 </para>
@@ -78,11 +62,7 @@ stdenv.mkDerivation {
7862 </listitem>
7963 <listitem>
8064 <para>
81− Some packages assume xcode is available and use <command>xcrun</command>
82− to resolve build tools like <command>clang</command>, etc. This causes
83− errors like <code>xcode-select: error: no developer tools were found at
84− '/Applications/Xcode.app'</code> while the build doesn't actually depend
85− on xcode.
65+ Some packages assume xcode is available and use <command>xcrun</command> to resolve build tools like <command>clang</command>, etc. This causes errors like <code>xcode-select: error: no developer tools were found at '/Applications/Xcode.app'</code> while the build doesn't actually depend on xcode.
8666 </para>
8767<programlisting>
8868stdenv.mkDerivation {
@@ -95,9 +75,7 @@ stdenv.mkDerivation {
9575}
9676</programlisting>
9777 <para>
98− The package <literal>xcbuild</literal> can be used to build projects that
99− really depend on Xcode. However, this replacement is not 100% compatible
100− with Xcode and can occasionally cause issues.
78+ The package <literal>xcbuild</literal> can be used to build projects that really depend on Xcode. However, this replacement is not 100% compatible with Xcode and can occasionally cause issues.
10179 </para>
10280 </listitem>
10381 </itemizedlist>
doc/quick-start.xml+36−108
@@ -15,120 +15,75 @@
1515 </listitem>
1616 <listitem>
1717 <para>
18− Find a good place in the Nixpkgs tree to add the Nix expression for your
19− package. For instance, a library package typically goes into
20− <filename>pkgs/development/libraries/<replaceable>pkgname</replaceable></filename>,
21− while a web browser goes into
22− <filename>pkgs/applications/networking/browsers/<replaceable>pkgname</replaceable></filename>.
23− See <xref linkend="sec-organisation" /> for some hints on the tree
24− organisation. Create a directory for your package, e.g.
18+ Find a good place in the Nixpkgs tree to add the Nix expression for your package. For instance, a library package typically goes into <filename>pkgs/development/libraries/<replaceable>pkgname</replaceable></filename>, while a web browser goes into <filename>pkgs/applications/networking/browsers/<replaceable>pkgname</replaceable></filename>. See <xref linkend="sec-organisation" /> for some hints on the tree organisation. Create a directory for your package, e.g.
2519<screen>
2620<prompt>$ </prompt>mkdir pkgs/development/libraries/libfoo</screen>
2721 </para>
2822 </listitem>
2923 <listitem>
3024 <para>
31− In the package directory, create a Nix expression — a piece of code that
32− describes how to build the package. In this case, it should be a
33− <emphasis>function</emphasis> that is called with the package dependencies
34− as arguments, and returns a build of the package in the Nix store. The
35− expression should usually be called <filename>default.nix</filename>.
25+ In the package directory, create a Nix expression — a piece of code that describes how to build the package. In this case, it should be a <emphasis>function</emphasis> that is called with the package dependencies as arguments, and returns a build of the package in the Nix store. The expression should usually be called <filename>default.nix</filename>.
3626<screen>
3727<prompt>$ </prompt>emacs pkgs/development/libraries/libfoo/default.nix
3828<prompt>$ </prompt>git add pkgs/development/libraries/libfoo/default.nix</screen>
3929 </para>
4030 <para>
41− You can have a look at the existing Nix expressions under
42− <filename>pkgs/</filename> to see how it’s done. Here are some good
43− ones:
31+ You can have a look at the existing Nix expressions under <filename>pkgs/</filename> to see how it’s done. Here are some good ones:
4432 <itemizedlist>
4533 <listitem>
4634 <para>
47− GNU Hello:
48− <link
49− xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/misc/hello/default.nix"><filename>pkgs/applications/misc/hello/default.nix</filename></link>.
50− Trivial package, which specifies some <varname>meta</varname>
51− attributes which is good practice.
35+ GNU Hello: <link
36+ xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/misc/hello/default.nix"><filename>pkgs/applications/misc/hello/default.nix</filename></link>. Trivial package, which specifies some <varname>meta</varname> attributes which is good practice.
5237 </para>
5338 </listitem>
5439 <listitem>
5540 <para>
56− GNU cpio:
57− <link
58− xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/tools/archivers/cpio/default.nix"><filename>pkgs/tools/archivers/cpio/default.nix</filename></link>.
59− Also a simple package. The generic builder in <varname>stdenv</varname>
60− does everything for you. It has no dependencies beyond
61− <varname>stdenv</varname>.
41+ GNU cpio: <link
42+ xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/tools/archivers/cpio/default.nix"><filename>pkgs/tools/archivers/cpio/default.nix</filename></link>. Also a simple package. The generic builder in <varname>stdenv</varname> does everything for you. It has no dependencies beyond <varname>stdenv</varname>.
6243 </para>
6344 </listitem>
6445 <listitem>
6546 <para>
66− GNU Multiple Precision arithmetic library (GMP):
67− <link
68− xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/libraries/gmp/5.1.x.nix"><filename>pkgs/development/libraries/gmp/5.1.x.nix</filename></link>.
69− Also done by the generic builder, but has a dependency on
70− <varname>m4</varname>.
47+ GNU Multiple Precision arithmetic library (GMP): <link
48+ xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/libraries/gmp/5.1.x.nix"><filename>pkgs/development/libraries/gmp/5.1.x.nix</filename></link>. Also done by the generic builder, but has a dependency on <varname>m4</varname>.
7149 </para>
7250 </listitem>
7351 <listitem>
7452 <para>
75− Pan, a GTK-based newsreader:
76− <link
77− xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/networking/newsreaders/pan/default.nix"><filename>pkgs/applications/networking/newsreaders/pan/default.nix</filename></link>.
78− Has an optional dependency on <varname>gtkspell</varname>, which is
79− only built if <varname>spellCheck</varname> is <literal>true</literal>.
53+ Pan, a GTK-based newsreader: <link
54+ xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/networking/newsreaders/pan/default.nix"><filename>pkgs/applications/networking/newsreaders/pan/default.nix</filename></link>. Has an optional dependency on <varname>gtkspell</varname>, which is only built if <varname>spellCheck</varname> is <literal>true</literal>.
8055 </para>
8156 </listitem>
8257 <listitem>
8358 <para>
84− Apache HTTPD:
85− <link
86− xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/servers/http/apache-httpd/2.4.nix"><filename>pkgs/servers/http/apache-httpd/2.4.nix</filename></link>.
87− A bunch of optional features, variable substitutions in the configure
88− flags, a post-install hook, and miscellaneous hackery.
59+ Apache HTTPD: <link
60+ xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/servers/http/apache-httpd/2.4.nix"><filename>pkgs/servers/http/apache-httpd/2.4.nix</filename></link>. A bunch of optional features, variable substitutions in the configure flags, a post-install hook, and miscellaneous hackery.
8961 </para>
9062 </listitem>
9163 <listitem>
9264 <para>
93− Thunderbird:
94− <link
95− xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/networking/mailreaders/thunderbird/default.nix"><filename>pkgs/applications/networking/mailreaders/thunderbird/default.nix</filename></link>.
96− Lots of dependencies.
65+ Thunderbird: <link
66+ xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/networking/mailreaders/thunderbird/default.nix"><filename>pkgs/applications/networking/mailreaders/thunderbird/default.nix</filename></link>. Lots of dependencies.
9767 </para>
9868 </listitem>
9969 <listitem>
10070 <para>
101− JDiskReport, a Java utility:
102− <link
103− xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/tools/misc/jdiskreport/default.nix"><filename>pkgs/tools/misc/jdiskreport/default.nix</filename></link>
104− (and the
105− <link
106− xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/tools/misc/jdiskreport/builder.sh">builder</link>).
107− Nixpkgs doesn’t have a decent <varname>stdenv</varname> for Java yet
108− so this is pretty ad-hoc.
71+ JDiskReport, a Java utility: <link
72+ xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/tools/misc/jdiskreport/default.nix"><filename>pkgs/tools/misc/jdiskreport/default.nix</filename></link> (and the <link
73+ xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/tools/misc/jdiskreport/builder.sh">builder</link>). Nixpkgs doesn’t have a decent <varname>stdenv</varname> for Java yet so this is pretty ad-hoc.
10974 </para>
11075 </listitem>
11176 <listitem>
11277 <para>
113− XML::Simple, a Perl module:
114− <link
115− xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/perl-packages.nix"><filename>pkgs/top-level/perl-packages.nix</filename></link>
116− (search for the <varname>XMLSimple</varname> attribute). Most Perl
117− modules are so simple to build that they are defined directly in
118− <filename>perl-packages.nix</filename>; no need to make a separate file
119− for them.
78+ XML::Simple, a Perl module: <link
79+ xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/perl-packages.nix"><filename>pkgs/top-level/perl-packages.nix</filename></link> (search for the <varname>XMLSimple</varname> attribute). Most Perl modules are so simple to build that they are defined directly in <filename>perl-packages.nix</filename>; no need to make a separate file for them.
12080 </para>
12181 </listitem>
12282 <listitem>
12383 <para>
124− Adobe Reader:
125− <link
126− xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/misc/adobe-reader/default.nix"><filename>pkgs/applications/misc/adobe-reader/default.nix</filename></link>.
127− Shows how binary-only packages can be supported. In particular the
128− <link
129− xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/misc/adobe-reader/builder.sh">builder</link>
130− uses <command>patchelf</command> to set the RUNPATH and ELF interpreter
131− of the executables so that the right libraries are found at runtime.
84+ Adobe Reader: <link
85+ xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/misc/adobe-reader/default.nix"><filename>pkgs/applications/misc/adobe-reader/default.nix</filename></link>. Shows how binary-only packages can be supported. In particular the <link
86+ xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/misc/adobe-reader/builder.sh">builder</link> uses <command>patchelf</command> to set the RUNPATH and ELF interpreter of the executables so that the right libraries are found at runtime.
13287 </para>
13388 </listitem>
13489 </itemizedlist>
@@ -138,67 +93,45 @@
13893 <itemizedlist>
13994 <listitem>
14095 <para>
141− All <varname linkend="chap-meta">meta</varname> attributes are
142− optional, but it’s still a good idea to provide at least the
143− <varname>description</varname>, <varname>homepage</varname> and
144− <varname
96+ All <varname linkend="chap-meta">meta</varname> attributes are optional, but it’s still a good idea to provide at least the <varname>description</varname>, <varname>homepage</varname> and <varname
14597 linkend="sec-meta-license">license</varname>.
14698 </para>
14799 </listitem>
148100 <listitem>
149101 <para>
150− You can use <command>nix-prefetch-url</command>
151− <replaceable>url</replaceable> to get the SHA-256 hash of source
152− distributions. There are similar commands as
153− <command>nix-prefetch-git</command> and
154− <command>nix-prefetch-hg</command> available in
155− <literal>nix-prefetch-scripts</literal> package.
102+ You can use <command>nix-prefetch-url</command> <replaceable>url</replaceable> to get the SHA-256 hash of source distributions. There are similar commands as <command>nix-prefetch-git</command> and <command>nix-prefetch-hg</command> available in <literal>nix-prefetch-scripts</literal> package.
156103 </para>
157104 </listitem>
158105 <listitem>
159106 <para>
160− A list of schemes for <literal>mirror://</literal> URLs can be found in
161− <link
107+ A list of schemes for <literal>mirror://</literal> URLs can be found in <link
162108 xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/fetchurl/mirrors.nix"><filename>pkgs/build-support/fetchurl/mirrors.nix</filename></link>.
163109 </para>
164110 </listitem>
165111 </itemizedlist>
166112 </para>
167113 <para>
168− The exact syntax and semantics of the Nix expression language, including
169− the built-in function, are described in the Nix manual in the
170− <link
171− xlink:href="http://hydra.nixos.org/job/nix/trunk/tarball/latest/download-by-type/doc/manual/#chap-writing-nix-expressions">chapter
172− on writing Nix expressions</link>.
114+ The exact syntax and semantics of the Nix expression language, including the built-in function, are described in the Nix manual in the <link
115+ xlink:href="http://hydra.nixos.org/job/nix/trunk/tarball/latest/download-by-type/doc/manual/#chap-writing-nix-expressions">chapter on writing Nix expressions</link>.
173116 </para>
174117 </listitem>
175118 <listitem>
176119 <para>
177− Add a call to the function defined in the previous step to
178− <link
179− xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/all-packages.nix"><filename>pkgs/top-level/all-packages.nix</filename></link>
180− with some descriptive name for the variable, e.g.
181− <varname>libfoo</varname>.
120+ Add a call to the function defined in the previous step to <link
121+ xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/all-packages.nix"><filename>pkgs/top-level/all-packages.nix</filename></link> with some descriptive name for the variable, e.g. <varname>libfoo</varname>.
182122<screen>
183123<prompt>$ </prompt>emacs pkgs/top-level/all-packages.nix</screen>
184124 </para>
185125 <para>
186− The attributes in that file are sorted by category (like “Development /
187− Libraries”) that more-or-less correspond to the directory structure of
188− Nixpkgs, and then by attribute name.
126+ The attributes in that file are sorted by category (like “Development / Libraries”) that more-or-less correspond to the directory structure of Nixpkgs, and then by attribute name.
189127 </para>
190128 </listitem>
191129 <listitem>
192130 <para>
193− To test whether the package builds, run the following command from the
194− root of the nixpkgs source tree:
131+ To test whether the package builds, run the following command from the root of the nixpkgs source tree:
195132<screen>
196133<prompt>$ </prompt>nix-build -A libfoo</screen>
197− where <varname>libfoo</varname> should be the variable name defined in the
198− previous step. You may want to add the flag <option>-K</option> to keep
199− the temporary build directory in case something fails. If the build
200− succeeds, a symlink <filename>./result</filename> to the package in the
201− Nix store is created.
134+ where <varname>libfoo</varname> should be the variable name defined in the previous step. You may want to add the flag <option>-K</option> to keep the temporary build directory in case something fails. If the build succeeds, a symlink <filename>./result</filename> to the package in the Nix store is created.
202135 </para>
203136 </listitem>
204137 <listitem>
@@ -210,14 +143,9 @@
210143 </listitem>
211144 <listitem>
212145 <para>
213− Optionally commit the new package and open a pull request
214− <link
215− xlink:href="https://github.com/NixOS/nixpkgs/pulls">to
216− nixpkgs</link>, or use
217− <link
218− xlink:href="https://discourse.nixos.org/t/about-the-patches-category/477">
219− the Patches category</link> on Discourse for sending a patch without a
220− GitHub account.
146+ Optionally commit the new package and open a pull request <link
147+ xlink:href="https://github.com/NixOS/nixpkgs/pulls">to nixpkgs</link>, or use <link
148+ xlink:href="https://discourse.nixos.org/t/about-the-patches-category/477"> the Patches category</link> on Discourse for sending a patch without a GitHub account.
221149 </para>
222150 </listitem>
223151 </orderedlist>
doc/release-notes.xml+55−205
@@ -6,15 +6,11 @@
66 <title>Release 0.14 (June 4, 2012)</title>
77
88 <para>
9− In preparation for the switch from Subversion to Git, this release is mainly
10− the prevent the Nixpkgs version number from going backwards. (This would
11− happen because prerelease version numbers produced for the Git repository
12− are lower than those for the Subversion repository.)
9+ In preparation for the switch from Subversion to Git, this release is mainly the prevent the Nixpkgs version number from going backwards. (This would happen because prerelease version numbers produced for the Git repository are lower than those for the Subversion repository.)
1310 </para>
1411
1512 <para>
16− Since the last release, there have been thousands of changes and new
17− packages by numerous contributors. For details, see the commit logs.
13+ Since the last release, there have been thousands of changes and new packages by numerous contributors. For details, see the commit logs.
1814 </para>
1915 </section>
2016 <section xml:id="release-notes-0.13">
@@ -55,14 +51,11 @@
5551 <title>Release 0.12 (April 24, 2009)</title>
5652
5753 <para>
58− There are way too many additions to Nixpkgs since the last release to list
59− here: for example, the number of packages on Linux has increased from 1002
60− to 2159. However, some specific improvements are worth listing:
54+ There are way too many additions to Nixpkgs since the last release to list here: for example, the number of packages on Linux has increased from 1002 to 2159. However, some specific improvements are worth listing:
6155 <itemizedlist>
6256 <listitem>
6357 <para>
64− Nixpkgs now has a manual. In particular, it describes the standard build
65− environment in detail.
58+ Nixpkgs now has a manual. In particular, it describes the standard build environment in detail.
6659 </para>
6760 </listitem>
6861 <listitem>
@@ -122,9 +115,7 @@
122115 </listitem>
123116 <listitem>
124117 <para>
125− Support for building derivations in a virtual machine, including RPM and
126− Debian builds in automatically generated VM images. See
127− <filename>pkgs/build-support/vm/default.nix</filename> for details.
118+ Support for building derivations in a virtual machine, including RPM and Debian builds in automatically generated VM images. See <filename>pkgs/build-support/vm/default.nix</filename> for details.
128119 </para>
129120 </listitem>
130121 <listitem>
@@ -136,13 +127,7 @@
136127 </para>
137128
138129 <para>
139− The following people contributed to this release: Andres Löh, Arie
140− Middelkoop, Armijn Hemel, Eelco Dolstra, Lluís Batlle, Ludovic Courtès,
141− Marc Weber, Mart Kolthof, Martin Bravenboer, Michael Raskin, Nicolas
142− Pierron, Peter Simons, Pjotr Prins, Rob Vermaas, Sander van der Burg, Tobias
143− Hammerschmidt, Valentin David, Wouter den Breejen and Yury G. Kudryashov. In
144− addition, several people contributed patches on the
145− <literal>nix-dev</literal> mailing list.
130+ The following people contributed to this release: Andres Löh, Arie Middelkoop, Armijn Hemel, Eelco Dolstra, Lluís Batlle, Ludovic Courtès, Marc Weber, Mart Kolthof, Martin Bravenboer, Michael Raskin, Nicolas Pierron, Peter Simons, Pjotr Prins, Rob Vermaas, Sander van der Burg, Tobias Hammerschmidt, Valentin David, Wouter den Breejen and Yury G. Kudryashov. In addition, several people contributed patches on the <literal>nix-dev</literal> mailing list.
146131 </para>
147132 </section>
148133 <section xml:id="release-notes-0.11">
@@ -153,25 +138,12 @@
153138 <itemizedlist>
154139 <listitem>
155140 <para>
156− The standard build environment (<literal>stdenv</literal>) is now pure on
157− the <literal>x86_64-linux</literal> and <literal>powerpc-linux</literal>
158− platforms, just as on <literal>i686-linux</literal>. (Purity means that
159− building and using the standard environment has no dependencies outside
160− of the Nix store. For instance, it doesn’t require an external C
161− compiler such as <filename>/usr/bin/gcc</filename>.) Also, the statically
162− linked binaries used in the bootstrap process are now automatically
163− reproducible, making it easy to update the bootstrap tools and to add
164− support for other Linux platforms. See
165− <filename>pkgs/stdenv/linux/make-bootstrap-tools.nix</filename> for
166− details.
141+ The standard build environment (<literal>stdenv</literal>) is now pure on the <literal>x86_64-linux</literal> and <literal>powerpc-linux</literal> platforms, just as on <literal>i686-linux</literal>. (Purity means that building and using the standard environment has no dependencies outside of the Nix store. For instance, it doesn’t require an external C compiler such as <filename>/usr/bin/gcc</filename>.) Also, the statically linked binaries used in the bootstrap process are now automatically reproducible, making it easy to update the bootstrap tools and to add support for other Linux platforms. See <filename>pkgs/stdenv/linux/make-bootstrap-tools.nix</filename> for details.
167142 </para>
168143 </listitem>
169144 <listitem>
170145 <para>
171− Hook variables in the generic builder are now executed using the
172− <function>eval</function> shell command. This has a major advantage: you
173− can write hooks directly in Nix expressions. For instance, rather than
174− writing a builder like this:
146+ Hook variables in the generic builder are now executed using the <function>eval</function> shell command. This has a major advantage: you can write hooks directly in Nix expressions. For instance, rather than writing a builder like this:
175147<programlisting>
176148source $stdenv/setup
177149
@@ -182,91 +154,57 @@ postInstall() {
182154}
183155
184156genericBuild</programlisting>
185− (the <literal>gzip</literal> builder), you can just add this attribute to
186− the derivation:
157+ (the <literal>gzip</literal> builder), you can just add this attribute to the derivation:
187158<programlisting>
188159postInstall = "ln -sf gzip $out/bin/gunzip; ln -sf gzip $out/bin/zcat";</programlisting>
189− and so a separate build script becomes unnecessary. This should allow us
190− to get rid of most builders in Nixpkgs.
160+ and so a separate build script becomes unnecessary. This should allow us to get rid of most builders in Nixpkgs.
191161 </para>
192162 </listitem>
193163 <listitem>
194164 <para>
195− It is now possible to have the generic builder pass arguments to
196− <command>configure</command> and <command>make</command> that contain
197− whitespace. Previously, for example, you could say in a builder,
165+ It is now possible to have the generic builder pass arguments to <command>configure</command> and <command>make</command> that contain whitespace. Previously, for example, you could say in a builder,
198166<programlisting>
199167configureFlags="CFLAGS=-O0"</programlisting>
200168 but not
201169<programlisting>
202170configureFlags="CFLAGS=-O0 -g"</programlisting>
203− since the <literal>-g</literal> would be interpreted as a separate
204− argument to <command>configure</command>. Now you can say
171+ since the <literal>-g</literal> would be interpreted as a separate argument to <command>configure</command>. Now you can say
205172<programlisting>
206173configureFlagsArray=("CFLAGS=-O0 -g")</programlisting>
207174 or similarly
208175<programlisting>
209176configureFlagsArray=("CFLAGS=-O0 -g" "LDFLAGS=-L/foo -L/bar")</programlisting>
210− which does the right thing. Idem for <literal>makeFlags</literal>,
211− <literal>installFlags</literal>, <literal>checkFlags</literal> and
212− <literal>distFlags</literal>.
177+ which does the right thing. Idem for <literal>makeFlags</literal>, <literal>installFlags</literal>, <literal>checkFlags</literal> and <literal>distFlags</literal>.
213178 </para>
214179 <para>
215− Unfortunately you can't pass arrays to Bash through the environment, so
216− you can't put the array above in a Nix expression, e.g.,
180+ Unfortunately you can't pass arrays to Bash through the environment, so you can't put the array above in a Nix expression, e.g.,
217181<programlisting>
218182configureFlagsArray = ["CFLAGS=-O0 -g"];</programlisting>
219− since it would just be flattened to a since string. However, you
220− <emphasis>can</emphasis> use the inline hooks described above:
183+ since it would just be flattened to a since string. However, you <emphasis>can</emphasis> use the inline hooks described above:
221184<programlisting>
222185preConfigure = "configureFlagsArray=(\"CFLAGS=-O0 -g\")";</programlisting>
223186 </para>
224187 </listitem>
225188 <listitem>
226189 <para>
227− The function <function>fetchurl</function> now has support for two
228− different kinds of mirroring of files. First, it has support for
229− <emphasis>content-addressable mirrors</emphasis>. For example, given the
230− <function>fetchurl</function> call
190+ The function <function>fetchurl</function> now has support for two different kinds of mirroring of files. First, it has support for <emphasis>content-addressable mirrors</emphasis>. For example, given the <function>fetchurl</function> call
231191<programlisting>
232192fetchurl {
233193 url = http://releases.mozilla.org/<replaceable>...</replaceable>/firefox-2.0.0.6-source.tar.bz2;
234194 sha1 = "eb72f55e4a8bf08e8c6ef227c0ade3d068ba1082";
235195}</programlisting>
236− <function>fetchurl</function> will first try to download this file from
237− <link
238− xlink:href="http://tarballs.nixos.org/sha1/eb72f55e4a8bf08e8c6ef227c0ade3d068ba1082"/>.
239− If that file doesn’t exist, it will try the original URL. In general,
240− the “content-addressed” location is
241− <replaceable>mirror</replaceable><literal>/</literal><replaceable>hash-type</replaceable><literal>/</literal><replaceable>hash</replaceable>.
242− There is currently only one content-addressable mirror
243− (<link
244− xlink:href="http://tarballs.nixos.org"/>), but more can be
245− specified in the <varname>hashedMirrors</varname> attribute in
246− <filename>pkgs/build-support/fetchurl/mirrors.nix</filename>, or by
247− setting the <envar>NIX_HASHED_MIRRORS</envar> environment variable to a
248− whitespace-separated list of URLs.
196+ <function>fetchurl</function> will first try to download this file from <link
197+ xlink:href="http://tarballs.nixos.org/sha1/eb72f55e4a8bf08e8c6ef227c0ade3d068ba1082"/>. If that file doesn’t exist, it will try the original URL. In general, the “content-addressed” location is <replaceable>mirror</replaceable><literal>/</literal><replaceable>hash-type</replaceable><literal>/</literal><replaceable>hash</replaceable>. There is currently only one content-addressable mirror (<link
198+ xlink:href="http://tarballs.nixos.org"/>), but more can be specified in the <varname>hashedMirrors</varname> attribute in <filename>pkgs/build-support/fetchurl/mirrors.nix</filename>, or by setting the <envar>NIX_HASHED_MIRRORS</envar> environment variable to a whitespace-separated list of URLs.
249199 </para>
250200 <para>
251− Second, <function>fetchurl</function> has support for widely-mirrored
252− distribution sites such as SourceForge or the Linux kernel archives.
253− Given a URL of the form
254− <literal>mirror://<replaceable>site</replaceable>/<replaceable>path</replaceable></literal>,
255− it will try to download <replaceable>path</replaceable> from a
256− configurable list of mirrors for <replaceable>site</replaceable>. (This
257− idea was borrowed from Gentoo Linux.) Example:
201+ Second, <function>fetchurl</function> has support for widely-mirrored distribution sites such as SourceForge or the Linux kernel archives. Given a URL of the form <literal>mirror://<replaceable>site</replaceable>/<replaceable>path</replaceable></literal>, it will try to download <replaceable>path</replaceable> from a configurable list of mirrors for <replaceable>site</replaceable>. (This idea was borrowed from Gentoo Linux.) Example:
258202<programlisting>
259203fetchurl {
260204 url = mirror://gnu/gcc/gcc-4.2.0/gcc-core-4.2.0.tar.bz2;
261205 sha256 = "0ykhzxhr8857dr97z0j9wyybfz1kjr71xk457cfapfw5fjas4ny1";
262206}</programlisting>
263− Currently <replaceable>site</replaceable> can be
264− <literal>sourceforge</literal>, <literal>gnu</literal> and
265− <literal>kernel</literal>. The list of mirrors is defined in
266− <filename>pkgs/build-support/fetchurl/mirrors.nix</filename>. You can
267− override the list of mirrors for a particular site by setting the
268− environment variable
269− <envar>NIX_MIRRORS_<replaceable>site</replaceable></envar>, e.g.
207+ Currently <replaceable>site</replaceable> can be <literal>sourceforge</literal>, <literal>gnu</literal> and <literal>kernel</literal>. The list of mirrors is defined in <filename>pkgs/build-support/fetchurl/mirrors.nix</filename>. You can override the list of mirrors for a particular site by setting the environment variable <envar>NIX_MIRRORS_<replaceable>site</replaceable></envar>, e.g.
270208<programlisting>
271209export NIX_MIRRORS_sourceforge=http://osdn.dl.sourceforge.net/sourceforge/</programlisting>
272210 </para>
@@ -339,9 +277,7 @@ export NIX_MIRRORS_sourceforge=http://osdn.dl.sourceforge.net/sourceforge/</prog
339277 </para>
340278
341279 <para>
342− The following people contributed to this release: Andres Löh, Arie
343− Middelkoop, Armijn Hemel, Eelco Dolstra, Marc Weber, Mart Kolthof, Martin
344− Bravenboer, Michael Raskin, Wouter den Breejen and Yury G. Kudryashov.
280+ The following people contributed to this release: Andres Löh, Arie Middelkoop, Armijn Hemel, Eelco Dolstra, Marc Weber, Mart Kolthof, Martin Bravenboer, Michael Raskin, Wouter den Breejen and Yury G. Kudryashov.
345281 </para>
346282 </section>
347283 <section xml:id="release-notes-0.10">
@@ -349,10 +285,8 @@ export NIX_MIRRORS_sourceforge=http://osdn.dl.sourceforge.net/sourceforge/</prog
349285
350286 <note>
351287 <para>
352− This release of Nixpkgs requires
353− <link
354−xlink:href='http://nixos.org/releases/nix/nix-0.10/'>Nix 0.10</link>
355− or higher.
288+ This release of Nixpkgs requires <link
289+xlink:href='http://nixos.org/releases/nix/nix-0.10/'>Nix 0.10</link> or higher.
356290 </para>
357291 </note>
358292
@@ -363,32 +297,15 @@ xlink:href='http://nixos.org/releases/nix/nix-0.10/'>Nix 0.10</link>
363297 <itemizedlist>
364298 <listitem>
365299 <para>
366− <filename>pkgs/system/all-packages-generic.nix</filename> is gone, we now
367− just have <filename>pkgs/top-level/all-packages.nix</filename> that
368− contains all available packages. This should cause much less confusion
369− with users. <filename>all-packages.nix</filename> is a function that by
370− default returns packages for the current platform, but you can override
371− this by specifying a different <varname>system</varname> argument.
300+ <filename>pkgs/system/all-packages-generic.nix</filename> is gone, we now just have <filename>pkgs/top-level/all-packages.nix</filename> that contains all available packages. This should cause much less confusion with users. <filename>all-packages.nix</filename> is a function that by default returns packages for the current platform, but you can override this by specifying a different <varname>system</varname> argument.
372301 </para>
373302 </listitem>
374303 <listitem>
375304 <para>
376− Certain packages in Nixpkgs are now user-configurable through a
377− configuration file, i.e., without having to edit the Nix expressions in
378− Nixpkgs. For instance, the Firefox provided in the Nixpkgs channel is
379− built without the RealPlayer plugin (for legal reasons). Previously, you
380− could easily enable RealPlayer support by editing the call to the Firefox
381− function in <filename>all-packages.nix</filename>, but such changes are
382− not respected when Firefox is subsequently updated through the Nixpkgs
383− channel.
305+ Certain packages in Nixpkgs are now user-configurable through a configuration file, i.e., without having to edit the Nix expressions in Nixpkgs. For instance, the Firefox provided in the Nixpkgs channel is built without the RealPlayer plugin (for legal reasons). Previously, you could easily enable RealPlayer support by editing the call to the Firefox function in <filename>all-packages.nix</filename>, but such changes are not respected when Firefox is subsequently updated through the Nixpkgs channel.
384306 </para>
385307 <para>
386− The Nixpkgs configuration file (found in
387− <filename>~/.nixpkgs/config.nix</filename> or through the
388− <envar>NIXPKGS_CONFIG</envar> environment variable) is an attribute set
389− that contains configuration options that
390− <filename>all-packages.nix</filename> reads and uses for certain packages.
391− For instance, the following configuration file:
308+ The Nixpkgs configuration file (found in <filename>~/.nixpkgs/config.nix</filename> or through the <envar>NIXPKGS_CONFIG</envar> environment variable) is an attribute set that contains configuration options that <filename>all-packages.nix</filename> reads and uses for certain packages. For instance, the following configuration file:
392309<programlisting>
393310{
394311 firefox = {
@@ -398,9 +315,7 @@ xlink:href='http://nixos.org/releases/nix/nix-0.10/'>Nix 0.10</link>
398315 persistently enables RealPlayer support in the Firefox build.
399316 </para>
400317 <para>
401− (Actually, <literal>firefox.enableRealPlayer</literal> is the
402− <emphasis>only</emphasis> configuration option currently available, but
403− more are sure to be added.)
318+ (Actually, <literal>firefox.enableRealPlayer</literal> is the <emphasis>only</emphasis> configuration option currently available, but more are sure to be added.)
404319 </para>
405320 </listitem>
406321 <listitem>
@@ -409,17 +324,8 @@ xlink:href='http://nixos.org/releases/nix/nix-0.10/'>Nix 0.10</link>
409324 <itemizedlist>
410325 <listitem>
411326 <para>
412− <literal>i686-cygwin</literal>, i.e., Windows (using
413− <link xlink:href="http://www.cygwin.com/">Cygwin</link>). The standard
414− environment on <literal>i686-cygwin</literal> by default builds
415− binaries for the Cygwin environment (i.e., it uses Cygwin tools and
416− produces executables that use the Cygwin library). However, there is
417− also a standard environment that produces binaries that use
418− <link
419− xlink:href="http://www.mingw.org/">MinGW</link>. You can
420− use it by calling <filename>all-package.nix</filename> with the
421− <varname>stdenvType</varname> argument set to
422− <literal>"i686-mingw"</literal>.
327+ <literal>i686-cygwin</literal>, i.e., Windows (using <link xlink:href="http://www.cygwin.com/">Cygwin</link>). The standard environment on <literal>i686-cygwin</literal> by default builds binaries for the Cygwin environment (i.e., it uses Cygwin tools and produces executables that use the Cygwin library). However, there is also a standard environment that produces binaries that use <link
328+ xlink:href="http://www.mingw.org/">MinGW</link>. You can use it by calling <filename>all-package.nix</filename> with the <varname>stdenvType</varname> argument set to <literal>"i686-mingw"</literal>.
423329 </para>
424330 </listitem>
425331 <listitem>
@@ -434,9 +340,7 @@ xlink:href='http://nixos.org/releases/nix/nix-0.10/'>Nix 0.10</link>
434340 </listitem>
435341 <listitem>
436342 <para>
437− <literal>x86_64-linux</literal>, i.e., Linux on 64-bit AMD/Intel CPUs.
438− Unlike <literal>i686-linux</literal>, this platform doesn’t have a
439− pure <literal>stdenv</literal> yet.
343+ <literal>x86_64-linux</literal>, i.e., Linux on 64-bit AMD/Intel CPUs. Unlike <literal>i686-linux</literal>, this platform doesn’t have a pure <literal>stdenv</literal> yet.
440344 </para>
441345 </listitem>
442346 </itemizedlist>
@@ -472,21 +376,10 @@ xlink:href='http://nixos.org/releases/nix/nix-0.10/'>Nix 0.10</link>
472376 </listitem>
473377 <listitem>
474378 <para>
475− It is now <emphasis>much</emphasis> easier to override the default C
476− compiler and other tools in <literal>stdenv</literal> for specific
477− packages. <filename>all-packages.nix</filename> provides two utility
478− functions for this purpose: <function>overrideGCC</function> and
479− <function>overrideInStdenv</function>. Both take a
480− <literal>stdenv</literal> and return an augmented
481− <literal>stdenv</literal>; the formed changes the C compiler, and the
482− latter adds additional packages to the front of
483− <literal>stdenv</literal>’s initial <envar>PATH</envar>, allowing tools
484− to be overridden.
379+ It is now <emphasis>much</emphasis> easier to override the default C compiler and other tools in <literal>stdenv</literal> for specific packages. <filename>all-packages.nix</filename> provides two utility functions for this purpose: <function>overrideGCC</function> and <function>overrideInStdenv</function>. Both take a <literal>stdenv</literal> and return an augmented <literal>stdenv</literal>; the formed changes the C compiler, and the latter adds additional packages to the front of <literal>stdenv</literal>’s initial <envar>PATH</envar>, allowing tools to be overridden.
485380 </para>
486381 <para>
487− For instance, the package <varname>strategoxt</varname> doesn’t build
488− with the GNU Make in <literal>stdenv</literal> (version 3.81), so we call
489− it with an augmented <literal>stdenv</literal> that uses GNU Make 3.80:
382+ For instance, the package <varname>strategoxt</varname> doesn’t build with the GNU Make in <literal>stdenv</literal> (version 3.81), so we call it with an augmented <literal>stdenv</literal> that uses GNU Make 3.80:
490383<programlisting>
491384strategoxt = (import ../development/compilers/strategoxt) {
492385 inherit fetchurl pkgconfig sdf aterm;
@@ -494,8 +387,7 @@ strategoxt = (import ../development/compilers/strategoxt) {
494387};
495388
496389gnumake380 = <replaceable>...</replaceable>;</programlisting>
497− Likewise, there are many packages that don’t compile with the default
498− GCC (4.1.1), but that’s easily fixed:
390+ Likewise, there are many packages that don’t compile with the default GCC (4.1.1), but that’s easily fixed:
499391<programlisting>
500392exult = import ../games/exult {
501393 inherit fetchurl SDL SDL_mixer zlib libpng unzip;
@@ -505,13 +397,7 @@ exult = import ../games/exult {
505397 </listitem>
506398 <listitem>
507399 <para>
508− It has also become much easier to experiment with changes to the
509− <literal>stdenv</literal> setup script (which notably contains the generic
510− builder). Since edits to <filename>pkgs/stdenv/generic/setup.sh</filename>
511− trigger a rebuild of <emphasis>everything</emphasis>, this was formerly
512− quite painful. But now <literal>stdenv</literal> contains a function to
513− “regenerate” <literal>stdenv</literal> with a different setup script,
514− allowing the use of a different setup script for specific packages:
400+ It has also become much easier to experiment with changes to the <literal>stdenv</literal> setup script (which notably contains the generic builder). Since edits to <filename>pkgs/stdenv/generic/setup.sh</filename> trigger a rebuild of <emphasis>everything</emphasis>, this was formerly quite painful. But now <literal>stdenv</literal> contains a function to “regenerate” <literal>stdenv</literal> with a different setup script, allowing the use of a different setup script for specific packages:
515401<programlisting>
516402pkg = import <replaceable>...</replaceable> {
517403 stdenv = stdenv.regenerate ./my-setup.sh;
@@ -521,10 +407,7 @@ pkg = import <replaceable>...</replaceable> {
521407 </listitem>
522408 <listitem>
523409 <para>
524− Packages can now have a human-readable <emphasis>description</emphasis>
525− field. Package descriptions are shown by <literal>nix-env -qa
526− --description</literal>. In addition, they’re shown on the Nixpkgs
527− release page. A description can be added to a package as follows:
410+ Packages can now have a human-readable <emphasis>description</emphasis> field. Package descriptions are shown by <literal>nix-env -qa --description</literal>. In addition, they’re shown on the Nixpkgs release page. A description can be added to a package as follows:
528411<programlisting>
529412stdenv.mkDerivation {
530413 name = "exult-1.2";
@@ -533,34 +416,26 @@ stdenv.mkDerivation {
533416 description = "A reimplementation of the Ultima VII game engine";
534417 };
535418}</programlisting>
536− The <varname>meta</varname> attribute is not passed to the builder, so
537− changes to the description do not trigger a rebuild. Additional
538− <varname>meta</varname> attributes may be defined in the future (such as
539− the URL of the package’s homepage, the license, etc.).
419+ The <varname>meta</varname> attribute is not passed to the builder, so changes to the description do not trigger a rebuild. Additional <varname>meta</varname> attributes may be defined in the future (such as the URL of the package’s homepage, the license, etc.).
540420 </para>
541421 </listitem>
542422 </itemizedlist>
543423
544424 <para>
545− The following people contributed to this release: Andres Löh, Armijn Hemel,
546− Christof Douma, Eelco Dolstra, Eelco Visser, Mart Kolthof, Martin
547− Bravenboer, Merijn de Jonge, Rob Vermaas and Roy van den Broek.
425+ The following people contributed to this release: Andres Löh, Armijn Hemel, Christof Douma, Eelco Dolstra, Eelco Visser, Mart Kolthof, Martin Bravenboer, Merijn de Jonge, Rob Vermaas and Roy van den Broek.
548426 </para>
549427 </section>
550428 <section xml:id="release-notes-0.9">
551429 <title>Release 0.9 (January 31, 2006)</title>
552430
553431 <para>
554− There have been zillions of changes since the last release of Nixpkgs. Many
555− packages have been added or updated. The following are some of the more
556− notable changes:
432+ There have been zillions of changes since the last release of Nixpkgs. Many packages have been added or updated. The following are some of the more notable changes:
557433 </para>
558434
559435 <itemizedlist>
560436 <listitem>
561437 <para>
562− Distribution files have been moved to
563− <link
438+ Distribution files have been moved to <link
564439 xlink:href="http://nixos.org/" />.
565440 </para>
566441 </listitem>
@@ -576,24 +451,17 @@ stdenv.mkDerivation {
576451 </listitem>
577452 <listitem>
578453 <para>
579− The old, unofficial Xlibs has been replaced by the official modularised
580− X11 distribution from X.org, i.e., X11R7.0. X11R7.0 consists of 287 (!)
581− packages, all of which are in Nixpkgs though not all have been tested. It
582− is now possible to build a working X server (previously we only had X
583− client libraries). We use a fully Nixified X server on NixOS.
454+ The old, unofficial Xlibs has been replaced by the official modularised X11 distribution from X.org, i.e., X11R7.0. X11R7.0 consists of 287 (!) packages, all of which are in Nixpkgs though not all have been tested. It is now possible to build a working X server (previously we only had X client libraries). We use a fully Nixified X server on NixOS.
584455 </para>
585456 </listitem>
586457 <listitem>
587458 <para>
588− The Sun JDK 5 has been purified, i.e., it doesn’t require any non-Nix
589− components such as <filename>/lib/ld-linux.so.2</filename>. This means
590− that Java applications such as Eclipse and Azureus can run on NixOS.
459+ The Sun JDK 5 has been purified, i.e., it doesn’t require any non-Nix components such as <filename>/lib/ld-linux.so.2</filename>. This means that Java applications such as Eclipse and Azureus can run on NixOS.
591460 </para>
592461 </listitem>
593462 <listitem>
594463 <para>
595− Hardware-accelerated OpenGL support, used by games like Quake 3 (which is
596− now built from source).
464+ Hardware-accelerated OpenGL support, used by games like Quake 3 (which is now built from source).
597465 </para>
598466 </listitem>
599467 <listitem>
@@ -608,8 +476,7 @@ stdenv.mkDerivation {
608476 </listitem>
609477 <listitem>
610478 <para>
611− Some support for cross-compilation: cross-compiling builds of GCC and
612− Binutils, and cross-compiled builds of the C library uClibc.
479+ Some support for cross-compilation: cross-compiling builds of GCC and Binutils, and cross-compiled builds of the C library uClibc.
613480 </para>
614481 </listitem>
615482 <listitem>
@@ -618,8 +485,7 @@ stdenv.mkDerivation {
618485 <itemizedlist>
619486 <listitem>
620487 <para>
621− teTeX, including support for building LaTeX documents using Nix (with
622− automatic dependency determination).
488+ teTeX, including support for building LaTeX documents using Nix (with automatic dependency determination).
623489 </para>
624490 </listitem>
625491 <listitem>
@@ -629,14 +495,12 @@ stdenv.mkDerivation {
629495 </listitem>
630496 <listitem>
631497 <para>
632− System-level packages to support NixOS, e.g. Grub, GNU
633− <literal>parted</literal> and so on.
498+ System-level packages to support NixOS, e.g. Grub, GNU <literal>parted</literal> and so on.
634499 </para>
635500 </listitem>
636501 <listitem>
637502 <para>
638− <literal>ecj</literal>, the Eclipse Compiler for Java, so we finally
639− have a freely distributable compiler that supports Java 5.0.
503+ <literal>ecj</literal>, the Eclipse Compiler for Java, so we finally have a freely distributable compiler that supports Java 5.0.
640504 </para>
641505 </listitem>
642506 <listitem>
@@ -661,8 +525,7 @@ stdenv.mkDerivation {
661525 </listitem>
662526 <listitem>
663527 <para>
664− <literal>kdelibs</literal>. This allows us to add KDE-based packages
665− (such as <literal>kcachegrind</literal>).
528+ <literal>kdelibs</literal>. This allows us to add KDE-based packages (such as <literal>kcachegrind</literal>).
666529 </para>
667530 </listitem>
668531 </itemizedlist>
@@ -671,17 +534,14 @@ stdenv.mkDerivation {
671534 </itemizedlist>
672535
673536 <para>
674− The following people contributed to this release: Andres Löh, Armijn Hemel,
675− Bogdan Dumitriu, Christof Douma, Eelco Dolstra, Eelco Visser, Mart Kolthof,
676− Martin Bravenboer, Rob Vermaas and Roy van den Broek.
537+ The following people contributed to this release: Andres Löh, Armijn Hemel, Bogdan Dumitriu, Christof Douma, Eelco Dolstra, Eelco Visser, Mart Kolthof, Martin Bravenboer, Rob Vermaas and Roy van den Broek.
677538 </para>
678539 </section>
679540 <section xml:id="release-notes-0.8">
680541 <title>Release 0.8 (April 11, 2005)</title>
681542
682543 <para>
683− This release is mostly to remain synchronised with the changed hashing
684− scheme in Nix 0.8.
544+ This release is mostly to remain synchronised with the changed hashing scheme in Nix 0.8.
685545 </para>
686546
687547 <para>
@@ -706,16 +566,10 @@ stdenv.mkDerivation {
706566 <itemizedlist>
707567 <listitem>
708568 <para>
709− The bootstrap process for the standard build environment on Linux
710− (stdenv-linux) has been improved. It is no longer dependent in its initial
711− bootstrap stages on the system Glibc, GCC, and other tools. Rather,
712− Nixpkgs contains a statically linked bash and curl, and uses that to
713− download other statically linked tools. These are then used to build a
714− Glibc and dynamically linked versions of all other tools.
569+ The bootstrap process for the standard build environment on Linux (stdenv-linux) has been improved. It is no longer dependent in its initial bootstrap stages on the system Glibc, GCC, and other tools. Rather, Nixpkgs contains a statically linked bash and curl, and uses that to download other statically linked tools. These are then used to build a Glibc and dynamically linked versions of all other tools.
715570 </para>
716571 <para>
717− This change also makes the bootstrap process faster. For instance, GCC is
718− built only once instead of three times.
572+ This change also makes the bootstrap process faster. For instance, GCC is built only once instead of three times.
719573 </para>
720574 <para>
721575 (Contributed by Armijn Hemel.)
@@ -723,17 +577,13 @@ stdenv.mkDerivation {
723577 </listitem>
724578 <listitem>
725579 <para>
726− Tarballs used by Nixpkgs are now obtained from the same server that hosts
727− Nixpkgs (<link
728− xlink:href="http://catamaran.labs.cs.uu.nl/" />). This
729− reduces the risk of packages being unbuildable due to moved or deleted
730− files on various servers.
580+ Tarballs used by Nixpkgs are now obtained from the same server that hosts Nixpkgs (<link
581+ xlink:href="http://catamaran.labs.cs.uu.nl/" />). This reduces the risk of packages being unbuildable due to moved or deleted files on various servers.
731582 </para>
732583 </listitem>
733584 <listitem>
734585 <para>
735− There now is a generic mechanism for building Perl modules. See the
736− various Perl modules defined in pkgs/system/all-packages-generic.nix.
586+ There now is a generic mechanism for building Perl modules. See the various Perl modules defined in pkgs/system/all-packages-generic.nix.
737587 </para>
738588 </listitem>
739589 <listitem>
doc/reviewing-contributions.xml+42−118
@@ -6,68 +6,40 @@
66 <title>Reviewing contributions</title>
77 <warning>
88 <para>
9− The following section is a draft, and the policy for reviewing is still
10− being discussed in issues such as
11− <link
12− xlink:href="https://github.com/NixOS/nixpkgs/issues/11166">#11166
13− </link> and
14− <link
15− xlink:href="https://github.com/NixOS/nixpkgs/issues/20836">#20836
16− </link>.
9+ The following section is a draft, and the policy for reviewing is still being discussed in issues such as <link
10+ xlink:href="https://github.com/NixOS/nixpkgs/issues/11166">#11166 </link> and <link
11+ xlink:href="https://github.com/NixOS/nixpkgs/issues/20836">#20836 </link>.
1712 </para>
1813 </warning>
1914 <para>
20− The Nixpkgs project receives a fairly high number of contributions via GitHub
21− pull requests. Reviewing and approving these is an important task and a way
22− to contribute to the project.
15+ The Nixpkgs project receives a fairly high number of contributions via GitHub pull requests. Reviewing and approving these is an important task and a way to contribute to the project.
2316 </para>
2417 <para>
25− The high change rate of Nixpkgs makes any pull request that remains open for
26− too long subject to conflicts that will require extra work from the submitter
27− or the merger. Reviewing pull requests in a timely manner and being
28− responsive to the comments is the key to avoid this issue. GitHub provides
29− sort filters that can be used to see the
30− <link
31− xlink:href="https://github.com/NixOS/nixpkgs/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-desc">most
32− recently</link> and the
33− <link
34− xlink:href="https://github.com/NixOS/nixpkgs/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-asc">least
35− recently</link> updated pull requests. We highly encourage looking at
36− <link xlink:href="https://github.com/NixOS/nixpkgs/pulls?q=is%3Apr+is%3Aopen+review%3Anone+status%3Asuccess+-label%3A%222.status%3A+work-in-progress%22+no%3Aproject+no%3Aassignee+no%3Amilestone">
37− this list of ready to merge, unreviewed pull requests</link>.
18+ The high change rate of Nixpkgs makes any pull request that remains open for too long subject to conflicts that will require extra work from the submitter or the merger. Reviewing pull requests in a timely manner and being responsive to the comments is the key to avoid this issue. GitHub provides sort filters that can be used to see the <link
19+ xlink:href="https://github.com/NixOS/nixpkgs/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-desc">most recently</link> and the <link
20+ xlink:href="https://github.com/NixOS/nixpkgs/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-asc">least recently</link> updated pull requests. We highly encourage looking at <link xlink:href="https://github.com/NixOS/nixpkgs/pulls?q=is%3Apr+is%3Aopen+review%3Anone+status%3Asuccess+-label%3A%222.status%3A+work-in-progress%22+no%3Aproject+no%3Aassignee+no%3Amilestone"> this list of ready to merge, unreviewed pull requests</link>.
3821 </para>
3922 <para>
40− When reviewing a pull request, please always be nice and polite.
41− Controversial changes can lead to controversial opinions, but it is important
42− to respect every community member and their work.
23+ When reviewing a pull request, please always be nice and polite. Controversial changes can lead to controversial opinions, but it is important to respect every community member and their work.
4324 </para>
4425 <para>
45− GitHub provides reactions as a simple and quick way to provide feedback to
46− pull requests or any comments. The thumb-down reaction should be used with
47− care and if possible accompanied with some explanation so the submitter has
48− directions to improve their contribution.
26+ GitHub provides reactions as a simple and quick way to provide feedback to pull requests or any comments. The thumb-down reaction should be used with care and if possible accompanied with some explanation so the submitter has directions to improve their contribution.
4927 </para>
5028 <para>
51− pull request reviews should include a list of what has been reviewed in a
52− comment, so other reviewers and mergers can know the state of the review.
29+ pull request reviews should include a list of what has been reviewed in a comment, so other reviewers and mergers can know the state of the review.
5330 </para>
5431 <para>
55− All the review template samples provided in this section are generic and
56− meant as examples. Their usage is optional and the reviewer is free to adapt
57− them to their liking.
32+ All the review template samples provided in this section are generic and meant as examples. Their usage is optional and the reviewer is free to adapt them to their liking.
5833 </para>
5934 <section xml:id="reviewing-contributions-package-updates">
6035 <title>Package updates</title>
6136
6237 <para>
63− A package update is the most trivial and common type of pull request. These
64− pull requests mainly consist of updating the version part of the package
65− name and the source hash.
38+ A package update is the most trivial and common type of pull request. These pull requests mainly consist of updating the version part of the package name and the source hash.
6639 </para>
6740
6841 <para>
69− It can happen that non-trivial updates include patches or more complex
70− changes.
42+ It can happen that non-trivial updates include patches or more complex changes.
7143 </para>
7244
7345 <para>
@@ -82,8 +54,7 @@
8254 <itemizedlist>
8355 <listitem>
8456 <para>
85− <literal>8.has: package (update)</literal> and any topic label that fit
86− the updated package.
57+ <literal>8.has: package (update)</literal> and any topic label that fit the updated package.
8758 </para>
8859 </listitem>
8960 </itemizedlist>
@@ -105,9 +76,7 @@
10576 <itemizedlist>
10677 <listitem>
10778 <para>
108− <link xlink:href="https://help.github.com/articles/about-codeowners/">CODEOWNERS</link>
109− will make GitHub notify users based on the submitted changes, but it can
110− happen that it misses some of the package maintainers.
79+ <link xlink:href="https://help.github.com/articles/about-codeowners/">CODEOWNERS</link> will make GitHub notify users based on the submitted changes, but it can happen that it misses some of the package maintainers.
11180 </para>
11281 </listitem>
11382 </itemizedlist>
@@ -119,15 +88,12 @@
11988 <itemizedlist>
12089 <listitem>
12190 <para>
122− License can change with version updates, so it should be checked to
123− match the upstream license.
91+ License can change with version updates, so it should be checked to match the upstream license.
12492 </para>
12593 </listitem>
12694 <listitem>
12795 <para>
128− If the package has no maintainer, a maintainer must be set. This can be
129− the update submitter or a community member that accepts to take
130− maintainership of the package.
96+ If the package has no maintainer, a maintainer must be set. This can be the update submitter or a community member that accepts to take maintainership of the package.
13197 </para>
13298 </listitem>
13399 </itemizedlist>
@@ -144,14 +110,10 @@
144110 <itemizedlist>
145111 <listitem>
146112 <para>
147− pull requests are often targeted to the master or staging branch, and
148− building the pull request locally when it is submitted can trigger many
149− source builds.
113+ pull requests are often targeted to the master or staging branch, and building the pull request locally when it is submitted can trigger many source builds.
150114 </para>
151115 <para>
152− It is possible to rebase the changes on nixos-unstable or
153− nixpkgs-unstable for easier review by running the following commands
154− from a nixpkgs clone.
116+ It is possible to rebase the changes on nixos-unstable or nixpkgs-unstable for easier review by running the following commands from a nixpkgs clone.
155117<screen>
156118<prompt>$ </prompt>git remote add channels https://github.com/NixOS/nixpkgs-channels.git <co
157119 xml:id='reviewing-rebase-1' />
@@ -163,8 +125,7 @@
163125 <calloutlist>
164126 <callout arearefs='reviewing-rebase-1'>
165127 <para>
166− This should be done only once to be able to fetch channel branches
167− from the nixpkgs-channels repository.
128+ This should be done only once to be able to fetch channel branches from the nixpkgs-channels repository.
168129 </para>
169130 </callout>
170131 <callout arearefs='reviewing-rebase-2'>
@@ -174,9 +135,7 @@
174135 </callout>
175136 <callout arearefs='reviewing-rebase-3'>
176137 <para>
177− Fetching the pull request changes, <varname>PRNUMBER</varname> is the
178− number at the end of the pull request title and
179− <varname>BASEBRANCH</varname> the base branch of the pull request.
138+ Fetching the pull request changes, <varname>PRNUMBER</varname> is the number at the end of the pull request title and <varname>BASEBRANCH</varname> the base branch of the pull request.
180139 </para>
181140 </callout>
182141 <callout arearefs='reviewing-rebase-4'>
@@ -189,12 +148,7 @@
189148 </listitem>
190149 <listitem>
191150 <para>
192− The
193− <link xlink:href="https://github.com/Mic92/nix-review">nix-review</link>
194− tool can be used to review a pull request content in a single command.
195− <varname>PRNUMBER</varname> should be replaced by the number at the end
196− of the pull request title. You can also provide the full github pull
197− request url.
151+ The <link xlink:href="https://github.com/Mic92/nix-review">nix-review</link> tool can be used to review a pull request content in a single command. <varname>PRNUMBER</varname> should be replaced by the number at the end of the pull request title. You can also provide the full github pull request url.
198152 </para>
199153<screen>
200154<prompt>$ </prompt>nix-shell -p nix-review --run "nix-review pr PRNUMBER"
@@ -231,8 +185,7 @@
231185 <title>New packages</title>
232186
233187 <para>
234− New packages are a common type of pull requests. These pull requests
235− consists in adding a new nix-expression for a package.
188+ New packages are a common type of pull requests. These pull requests consists in adding a new nix-expression for a package.
236189 </para>
237190
238191 <para>
@@ -247,8 +200,7 @@
247200 <itemizedlist>
248201 <listitem>
249202 <para>
250− <literal>8.has: package (new)</literal> and any topic label that fit the
251− new package.
203+ <literal>8.has: package (new)</literal> and any topic label that fit the new package.
252204 </para>
253205 </listitem>
254206 </itemizedlist>
@@ -280,8 +232,7 @@
280232 </listitem>
281233 <listitem>
282234 <para>
283− A maintainer must be set. This can be the package submitter or a
284− community member that accepts to take maintainership of the package.
235+ A maintainer must be set. This can be the package submitter or a community member that accepts to take maintainership of the package.
285236 </para>
286237 </listitem>
287238 </itemizedlist>
@@ -303,8 +254,7 @@
303254 </listitem>
304255 <listitem>
305256 <para>
306− The most appropriate function should be used (e.g. packages from GitHub
307− should use <literal>fetchFromGitHub</literal>).
257+ The most appropriate function should be used (e.g. packages from GitHub should use <literal>fetchFromGitHub</literal>).
308258 </para>
309259 </listitem>
310260 </itemizedlist>
@@ -351,8 +301,7 @@
351301 <title>Module updates</title>
352302
353303 <para>
354− Module updates are submissions changing modules in some ways. These often
355− contains changes to the options or introduce new options.
304+ Module updates are submissions changing modules in some ways. These often contains changes to the options or introduce new options.
356305 </para>
357306
358307 <para>
@@ -367,8 +316,7 @@
367316 <itemizedlist>
368317 <listitem>
369318 <para>
370− <literal>8.has: module (update)</literal> and any topic label that fit
371− the module.
319+ <literal>8.has: module (update)</literal> and any topic label that fit the module.
372320 </para>
373321 </listitem>
374322 </itemizedlist>
@@ -380,9 +328,7 @@
380328 <itemizedlist>
381329 <listitem>
382330 <para>
383− <link xlink:href="https://help.github.com/articles/about-codeowners/">CODEOWNERS</link>
384− will make GitHub notify users based on the submitted changes, but it can
385− happen that it misses some of the package maintainers.
331+ <link xlink:href="https://help.github.com/articles/about-codeowners/">CODEOWNERS</link> will make GitHub notify users based on the submitted changes, but it can happen that it misses some of the package maintainers.
386332 </para>
387333 </listitem>
388334 </itemizedlist>
@@ -399,9 +345,7 @@
399345 <itemizedlist>
400346 <listitem>
401347 <para>
402− Type should be appropriate (string related types differs in their
403− merging capabilities, <literal>optionSet</literal> and
404− <literal>string</literal> types are deprecated).
348+ Type should be appropriate (string related types differs in their merging capabilities, <literal>optionSet</literal> and <literal>string</literal> types are deprecated).
405349 </para>
406350 </listitem>
407351 <listitem>
@@ -418,23 +362,19 @@
418362 <itemizedlist>
419363 <listitem>
420364 <para>
421− <literal>mkRenamedOptionModule</literal> and
422− <literal>mkAliasOptionModule</literal> functions provide way to make
423− option changes backward compatible.
365+ <literal>mkRenamedOptionModule</literal> and <literal>mkAliasOptionModule</literal> functions provide way to make option changes backward compatible.
424366 </para>
425367 </listitem>
426368 </itemizedlist>
427369 </listitem>
428370 <listitem>
429371 <para>
430− Ensure that removed options are declared with
431− <literal>mkRemovedOptionModule</literal>
372+ Ensure that removed options are declared with <literal>mkRemovedOptionModule</literal>
432373 </para>
433374 </listitem>
434375 <listitem>
435376 <para>
436− Ensure that changes that are not backward compatible are mentioned in
437− release notes.
377+ Ensure that changes that are not backward compatible are mentioned in release notes.
438378 </para>
439379 </listitem>
440380 <listitem>
@@ -480,8 +420,7 @@
480420 <itemizedlist>
481421 <listitem>
482422 <para>
483− <literal>8.has: module (new)</literal> and any topic label that fit the
484− module.
423+ <literal>8.has: module (new)</literal> and any topic label that fit the module.
485424 </para>
486425 </listitem>
487426 </itemizedlist>
@@ -498,9 +437,7 @@
498437 <itemizedlist>
499438 <listitem>
500439 <para>
501− Type should be appropriate (string related types differs in their
502− merging capabilities, <literal>optionSet</literal> and
503− <literal>string</literal> types are deprecated).
440+ Type should be appropriate (string related types differs in their merging capabilities, <literal>optionSet</literal> and <literal>string</literal> types are deprecated).
504441 </para>
505442 </listitem>
506443 <listitem>
@@ -522,8 +459,7 @@
522459 </listitem>
523460 <listitem>
524461 <para>
525− Module documentation should be declared with
526− <literal>meta.doc</literal>.
462+ Module documentation should be declared with <literal>meta.doc</literal>.
527463 </para>
528464 </listitem>
529465 </itemizedlist>
@@ -535,8 +471,7 @@
535471 <itemizedlist>
536472 <listitem>
537473 <para>
538− For example, enabling a module should not open firewall ports by
539− default.
474+ For example, enabling a module should not open firewall ports by default.
540475 </para>
541476 </listitem>
542477 </itemizedlist>
@@ -573,25 +508,18 @@
573508 </para>
574509
575510 <para>
576− If you consider having enough knowledge and experience in a topic and would
577− like to be a long-term reviewer for related submissions, please contact the
578− current reviewers for that topic. They will give you information about the
579− reviewing process. The main reviewers for a topic can be hard to find as
580− there is no list, but checking past pull requests to see who reviewed or
581− git-blaming the code to see who committed to that topic can give some hints.
511+ If you consider having enough knowledge and experience in a topic and would like to be a long-term reviewer for related submissions, please contact the current reviewers for that topic. They will give you information about the reviewing process. The main reviewers for a topic can be hard to find as there is no list, but checking past pull requests to see who reviewed or git-blaming the code to see who committed to that topic can give some hints.
582512 </para>
583513
584514 <para>
585− Container system, boot system and library changes are some examples of the
586− pull requests fitting this category.
515+ Container system, boot system and library changes are some examples of the pull requests fitting this category.
587516 </para>
588517 </section>
589518 <section xml:id="reviewing-contributions--merging-pull-requests">
590519 <title>Merging pull requests</title>
591520
592521 <para>
593− It is possible for community members that have enough knowledge and
594− experience on a special topic to contribute by merging pull requests.
522+ It is possible for community members that have enough knowledge and experience on a special topic to contribute by merging pull requests.
595523 </para>
596524
597525 <para>
@@ -608,12 +536,8 @@ policy.
608536-->
609537
610538 <para>
611− In a case a contributor definitively leaves the Nix community, they should
612− create an issue or post on
613− <link
614− xlink:href="https://discourse.nixos.org">Discourse</link> with
615− references of packages and modules they maintain so the maintainership can
616− be taken over by other contributors.
539+ In a case a contributor definitively leaves the Nix community, they should create an issue or post on <link
540+ xlink:href="https://discourse.nixos.org">Discourse</link> with references of packages and modules they maintain so the maintainership can be taken over by other contributors.
617541 </para>
618542 </section>
619543</chapter>
doc/stdenv.xml+238−1061
@@ -3,22 +3,13 @@
33 xml:id="chap-stdenv">
44 <title>The Standard Environment</title>
55 <para>
6− The standard build environment in the Nix Packages collection provides an
7− environment for building Unix packages that does a lot of common build tasks
8− automatically. In fact, for Unix packages that use the standard
9− <literal>./configure; make; make install</literal> build interface, you
10− don’t need to write a build script at all; the standard environment does
11− everything automatically. If <literal>stdenv</literal> doesn’t do what you
12− need automatically, you can easily customise or override the various build
13− phases.
6+ The standard build environment in the Nix Packages collection provides an environment for building Unix packages that does a lot of common build tasks automatically. In fact, for Unix packages that use the standard <literal>./configure; make; make install</literal> build interface, you don’t need to write a build script at all; the standard environment does everything automatically. If <literal>stdenv</literal> doesn’t do what you need automatically, you can easily customise or override the various build phases.
147 </para>
158 <section xml:id="sec-using-stdenv">
169 <title>Using <literal>stdenv</literal></title>
1710
1811 <para>
19− To build a package with the standard environment, you use the function
20− <varname>stdenv.mkDerivation</varname>, instead of the primitive built-in
21− function <varname>derivation</varname>, e.g.
12+ To build a package with the standard environment, you use the function <varname>stdenv.mkDerivation</varname>, instead of the primitive built-in function <varname>derivation</varname>, e.g.
2213<programlisting>
2314stdenv.mkDerivation {
2415 name = "libfoo-1.2.3";
@@ -27,17 +18,7 @@ stdenv.mkDerivation {
2718 sha256 = "0x2g1jqygyr5wiwg4ma1nd7w4ydpy82z9gkcv8vh2v8dn3y58v5m";
2819 };
2920}</programlisting>
30− (<varname>stdenv</varname> needs to be in scope, so if you write this in a
31− separate Nix expression from <filename>pkgs/all-packages.nix</filename>, you
32− need to pass it as a function argument.) Specifying a
33− <varname>name</varname> and a <varname>src</varname> is the absolute minimum
34− Nix requires. For convenience, you can also use <varname>pname</varname> and
35− <varname>version</varname> attributes and <literal>mkDerivation</literal>
36− will automatically set <varname>name</varname> to
37− <literal>"${pname}-${version}"</literal> by default. Since
38− <link xlink:href="https://github.com/NixOS/rfcs/pull/35">RFC 0035</link>,
39− this is preferred for packages in Nixpkgs, as it allows us to reuse the
40− version easily:
21+ (<varname>stdenv</varname> needs to be in scope, so if you write this in a separate Nix expression from <filename>pkgs/all-packages.nix</filename>, you need to pass it as a function argument.) Specifying a <varname>name</varname> and a <varname>src</varname> is the absolute minimum Nix requires. For convenience, you can also use <varname>pname</varname> and <varname>version</varname> attributes and <literal>mkDerivation</literal> will automatically set <varname>name</varname> to <literal>"${pname}-${version}"</literal> by default. Since <link xlink:href="https://github.com/NixOS/rfcs/pull/35">RFC 0035</link>, this is preferred for packages in Nixpkgs, as it allows us to reuse the version easily:
4122<programlisting>
4223stdenv.mkDerivation rec {
4324 pname = "libfoo";
@@ -50,31 +31,18 @@ stdenv.mkDerivation rec {
5031 </para>
5132
5233 <para>
53− Many packages have dependencies that are not provided in the standard
54− environment. It’s usually sufficient to specify those dependencies in the
55− <varname>buildInputs</varname> attribute:
34+ Many packages have dependencies that are not provided in the standard environment. It’s usually sufficient to specify those dependencies in the <varname>buildInputs</varname> attribute:
5635<programlisting>
5736stdenv.mkDerivation {
5837 name = "libfoo-1.2.3";
5938 ...
6039 buildInputs = [libbar perl ncurses];
6140}</programlisting>
62− This attribute ensures that the <filename>bin</filename> subdirectories of
63− these packages appear in the <envar>PATH</envar> environment variable during
64− the build, that their <filename>include</filename> subdirectories are
65− searched by the C compiler, and so on. (See
66− <xref linkend="ssec-setup-hooks"/> for details.)
41+ This attribute ensures that the <filename>bin</filename> subdirectories of these packages appear in the <envar>PATH</envar> environment variable during the build, that their <filename>include</filename> subdirectories are searched by the C compiler, and so on. (See <xref linkend="ssec-setup-hooks"/> for details.)
6742 </para>
6843
6944 <para>
70− Often it is necessary to override or modify some aspect of the build. To
71− make this easier, the standard environment breaks the package build into a
72− number of <emphasis>phases</emphasis>, all of which can be overridden or
73− modified individually: unpacking the sources, applying patches, configuring,
74− building, and installing. (There are some others; see
75− <xref linkend="sec-stdenv-phases"/>.) For instance, a package that doesn’t
76− supply a makefile but instead has to be compiled “manually” could be
77− handled like this:
45+ Often it is necessary to override or modify some aspect of the build. To make this easier, the standard environment breaks the package build into a number of <emphasis>phases</emphasis>, all of which can be overridden or modified individually: unpacking the sources, applying patches, configuring, building, and installing. (There are some others; see <xref linkend="sec-stdenv-phases"/>.) For instance, a package that doesn’t supply a makefile but instead has to be compiled “manually” could be handled like this:
7846<programlisting>
7947stdenv.mkDerivation {
8048 name = "fnord-4.5";
@@ -87,20 +55,15 @@ stdenv.mkDerivation {
8755 cp foo $out/bin
8856 '';
8957}</programlisting>
90− (Note the use of <literal>''</literal>-style string literals, which are very
91− convenient for large multi-line script fragments because they don’t need
92− escaping of <literal>"</literal> and <literal>\</literal>, and because
93− indentation is intelligently removed.)
58+ (Note the use of <literal>''</literal>-style string literals, which are very convenient for large multi-line script fragments because they don’t need escaping of <literal>"</literal> and <literal>\</literal>, and because indentation is intelligently removed.)
9459 </para>
9560
9661 <para>
97− There are many other attributes to customise the build. These are listed in
98− <xref linkend="ssec-stdenv-attributes"/>.
62+ There are many other attributes to customise the build. These are listed in <xref linkend="ssec-stdenv-attributes"/>.
9963 </para>
10064
10165 <para>
102− While the standard environment provides a generic builder, you can still
103− supply your own build script:
66+ While the standard environment provides a generic builder, you can still supply your own build script:
10467<programlisting>
10568stdenv.mkDerivation {
10669 name = "libfoo-1.2.3";
@@ -111,9 +74,7 @@ stdenv.mkDerivation {
11174<programlisting>
11275source $stdenv/setup
11376</programlisting>
114− to let <literal>stdenv</literal> set up the environment (e.g., process the
115− <varname>buildInputs</varname>). If you want, you can still use
116− <literal>stdenv</literal>’s generic builder:
77+ to let <literal>stdenv</literal> set up the environment (e.g., process the <varname>buildInputs</varname>). If you want, you can still use <literal>stdenv</literal>’s generic builder:
11778<programlisting>
11879source $stdenv/setup
11980
@@ -179,23 +140,17 @@ genericBuild
179140 </listitem>
180141 <listitem>
181142 <para>
182− <command>gzip</command>, <command>bzip2</command> and
183− <command>xz</command>.
143+ <command>gzip</command>, <command>bzip2</command> and <command>xz</command>.
184144 </para>
185145 </listitem>
186146 <listitem>
187147 <para>
188− GNU Make. It has been patched to provide <quote>nested</quote> output
189− that can be fed into the <command>nix-log2xml</command> command and
190− <command>log2html</command> stylesheet to create a structured, readable
191− output of the build steps performed by Make.
148+ GNU Make. It has been patched to provide <quote>nested</quote> output that can be fed into the <command>nix-log2xml</command> command and <command>log2html</command> stylesheet to create a structured, readable output of the build steps performed by Make.
192149 </para>
193150 </listitem>
194151 <listitem>
195152 <para>
196− Bash. This is the shell used for all builders in the Nix Packages
197− collection. Not using <command>/bin/sh</command> removes a large source
198− of portability problems.
153+ Bash. This is the shell used for all builders in the Nix Packages collection. Not using <command>/bin/sh</command> removes a large source of portability problems.
199154 </para>
200155 </listitem>
201156 <listitem>
@@ -207,108 +162,52 @@ genericBuild
207162 </para>
208163
209164 <para>
210− On Linux, <literal>stdenv</literal> also includes the
211− <command>patchelf</command> utility.
165+ On Linux, <literal>stdenv</literal> also includes the <command>patchelf</command> utility.
212166 </para>
213167 </section>
214168 <section xml:id="ssec-stdenv-dependencies">
215169 <title>Specifying dependencies</title>
216170
217171 <para>
218− As described in the Nix manual, almost any <filename>*.drv</filename> store
219− path in a derivation's attribute set will induce a dependency on that
220− derivation. <varname>mkDerivation</varname>, however, takes a few attributes
221− intended to, between them, include all the dependencies of a package. This
222− is done both for structure and consistency, but also so that certain other
223− setup can take place. For example, certain dependencies need their bin
224− directories added to the <envar>PATH</envar>. That is built-in, but other
225− setup is done via a pluggable mechanism that works in conjunction with these
226− dependency attributes. See <xref linkend="ssec-setup-hooks"/> for details.
172+ As described in the Nix manual, almost any <filename>*.drv</filename> store path in a derivation's attribute set will induce a dependency on that derivation. <varname>mkDerivation</varname>, however, takes a few attributes intended to, between them, include all the dependencies of a package. This is done both for structure and consistency, but also so that certain other setup can take place. For example, certain dependencies need their bin directories added to the <envar>PATH</envar>. That is built-in, but other setup is done via a pluggable mechanism that works in conjunction with these dependency attributes. See <xref linkend="ssec-setup-hooks"/> for details.
227173 </para>
228174
229175 <para>
230− Dependencies can be broken down along three axes: their host and target
231− platforms relative to the new derivation's, and whether they are propagated.
232− The platform distinctions are motivated by cross compilation; see
233− <xref linkend="chap-cross"/> for exactly what each platform means.
176+ Dependencies can be broken down along three axes: their host and target platforms relative to the new derivation's, and whether they are propagated. The platform distinctions are motivated by cross compilation; see <xref linkend="chap-cross"/> for exactly what each platform means.
234177 <footnote xml:id="footnote-stdenv-ignored-build-platform">
235178 <para>
236− The build platform is ignored because it is a mere implementation detail
237− of the package satisfying the dependency: As a general programming
238− principle, dependencies are always <emphasis>specified</emphasis> as
239− interfaces, not concrete implementation.
179+ The build platform is ignored because it is a mere implementation detail of the package satisfying the dependency: As a general programming principle, dependencies are always <emphasis>specified</emphasis> as interfaces, not concrete implementation.
240180 </para>
241181 </footnote>
242− But even if one is not cross compiling, the platforms imply whether or not
243− the dependency is needed at run-time or build-time, a concept that makes
244− perfect sense outside of cross compilation. By default, the
245− run-time/build-time distinction is just a hint for mental clarity, but with
246− <varname>strictDeps</varname> set it is mostly enforced even in the native
247− case.
182+ But even if one is not cross compiling, the platforms imply whether or not the dependency is needed at run-time or build-time, a concept that makes perfect sense outside of cross compilation. By default, the run-time/build-time distinction is just a hint for mental clarity, but with <varname>strictDeps</varname> set it is mostly enforced even in the native case.
248183 </para>
249184
250185 <para>
251− The extension of <envar>PATH</envar> with dependencies, alluded to above,
252− proceeds according to the relative platforms alone. The process is carried
253− out only for dependencies whose host platform matches the new derivation's
254− build platform i.e. dependencies which run on the platform where the new
255− derivation will be built.
186+ The extension of <envar>PATH</envar> with dependencies, alluded to above, proceeds according to the relative platforms alone. The process is carried out only for dependencies whose host platform matches the new derivation's build platform i.e. dependencies which run on the platform where the new derivation will be built.
256187 <footnote xml:id="footnote-stdenv-native-dependencies-in-path">
257188 <para>
258− Currently, this means for native builds all dependencies are put on the
259− <envar>PATH</envar>. But in the future that may not be the case for sake
260− of matching cross: the platforms would be assumed to be unique for native
261− and cross builds alike, so only the <varname>depsBuild*</varname> and
262− <varname>nativeBuildInputs</varname> would be added to the
263− <envar>PATH</envar>.
189+ Currently, this means for native builds all dependencies are put on the <envar>PATH</envar>. But in the future that may not be the case for sake of matching cross: the platforms would be assumed to be unique for native and cross builds alike, so only the <varname>depsBuild*</varname> and <varname>nativeBuildInputs</varname> would be added to the <envar>PATH</envar>.
264190 </para>
265191 </footnote>
266− For each dependency <replaceable>dep</replaceable> of those dependencies,
267− <filename><replaceable>dep</replaceable>/bin</filename>, if present, is
268− added to the <envar>PATH</envar> environment variable.
192+ For each dependency <replaceable>dep</replaceable> of those dependencies, <filename><replaceable>dep</replaceable>/bin</filename>, if present, is added to the <envar>PATH</envar> environment variable.
269193 </para>
270194
271195 <para>
272− The dependency is propagated when it forces some of its other-transitive
273− (non-immediate) downstream dependencies to also take it on as an immediate
274− dependency. Nix itself already takes a package's transitive dependencies
275− into account, but this propagation ensures nixpkgs-specific infrastructure
276− like setup hooks (mentioned above) also are run as if the propagated
277− dependency.
196+ The dependency is propagated when it forces some of its other-transitive (non-immediate) downstream dependencies to also take it on as an immediate dependency. Nix itself already takes a package's transitive dependencies into account, but this propagation ensures nixpkgs-specific infrastructure like setup hooks (mentioned above) also are run as if the propagated dependency.
278197 </para>
279198
280199 <para>
281− It is important to note that dependencies are not necessarily propagated as
282− the same sort of dependency that they were before, but rather as the
283− corresponding sort so that the platform rules still line up. The exact rules
284− for dependency propagation can be given by assigning to each dependency two
285− integers based one how its host and target platforms are offset from the
286− depending derivation's platforms. Those offsets are given below in the
287− descriptions of each dependency list attribute. Algorithmically, we traverse
288− propagated inputs, accumulating every propagated dependency's propagated
289− dependencies and adjusting them to account for the "shift in perspective"
290− described by the current dependency's platform offsets. This results in sort
291− a transitive closure of the dependency relation, with the offsets being
292− approximately summed when two dependency links are combined. We also prune
293− transitive dependencies whose combined offsets go out-of-bounds, which can
294− be viewed as a filter over that transitive closure removing dependencies
295− that are blatantly absurd.
200+ It is important to note that dependencies are not necessarily propagated as the same sort of dependency that they were before, but rather as the corresponding sort so that the platform rules still line up. The exact rules for dependency propagation can be given by assigning to each dependency two integers based one how its host and target platforms are offset from the depending derivation's platforms. Those offsets are given below in the descriptions of each dependency list attribute. Algorithmically, we traverse propagated inputs, accumulating every propagated dependency's propagated dependencies and adjusting them to account for the "shift in perspective" described by the current dependency's platform offsets. This results in sort a transitive closure of the dependency relation, with the offsets being approximately summed when two dependency links are combined. We also prune transitive dependencies whose combined offsets go out-of-bounds, which can be viewed as a filter over that transitive closure removing dependencies that are blatantly absurd.
296201 </para>
297202
298203 <para>
299− We can define the process precisely with
300− <link xlink:href="https://en.wikipedia.org/wiki/Natural_deduction">Natural
301− Deduction</link> using the inference rules. This probably seems a bit
302− obtuse, but so is the bash code that actually implements it!
204+ We can define the process precisely with <link xlink:href="https://en.wikipedia.org/wiki/Natural_deduction">Natural Deduction</link> using the inference rules. This probably seems a bit obtuse, but so is the bash code that actually implements it!
303205 <footnote xml:id="footnote-stdenv-find-inputs-location">
304206 <para>
305− The <function>findInputs</function> function, currently residing in
306− <filename>pkgs/stdenv/generic/setup.sh</filename>, implements the
307− propagation logic.
207+ The <function>findInputs</function> function, currently residing in <filename>pkgs/stdenv/generic/setup.sh</filename>, implements the propagation logic.
308208 </para>
309209 </footnote>
310− They're confusing in very different ways so... hopefully if something
311− doesn't make sense in one presentation, it will in the other!
210+ They're confusing in very different ways so... hopefully if something doesn't make sense in one presentation, it will in the other!
312211<programlisting>
313212let mapOffset(h, t, i) = i + (if i &lt;= 0 then h else t - 1)
314213
@@ -335,50 +234,22 @@ propagated-dep(mapOffset(h0, t0, h1),
335234propagated-dep(h, t, A, B)
336235----------------------------- Propagated dependencies count as dependencies
337236dep(h, t, A, B)</programlisting>
338− Some explanation of this monstrosity is in order. In the common case, the
339− target offset of a dependency is the successor to the target offset:
340− <literal>t = h + 1</literal>. That means that:
237+ Some explanation of this monstrosity is in order. In the common case, the target offset of a dependency is the successor to the target offset: <literal>t = h + 1</literal>. That means that:
341238<programlisting>
342239let f(h, t, i) = i + (if i &lt;= 0 then h else t - 1)
343240let f(h, h + 1, i) = i + (if i &lt;= 0 then h else (h + 1) - 1)
344241let f(h, h + 1, i) = i + (if i &lt;= 0 then h else h)
345242let f(h, h + 1, i) = i + h
346243</programlisting>
347− This is where "sum-like" comes in from above: We can just sum all of the
348− host offsets to get the host offset of the transitive dependency. The target
349− offset is the transitive dependency is simply the host offset + 1, just as
350− it was with the dependencies composed to make this transitive one; it can be
351− ignored as it doesn't add any new information.
244+ This is where "sum-like" comes in from above: We can just sum all of the host offsets to get the host offset of the transitive dependency. The target offset is the transitive dependency is simply the host offset + 1, just as it was with the dependencies composed to make this transitive one; it can be ignored as it doesn't add any new information.
352245 </para>
353246
354247 <para>
355− Because of the bounds checks, the uncommon cases are <literal>h =
356− t</literal> and <literal>h + 2 = t</literal>. In the former case, the
357− motivation for <function>mapOffset</function> is that since its host and
358− target platforms are the same, no transitive dependency of it should be able
359− to "discover" an offset greater than its reduced target offsets.
360− <function>mapOffset</function> effectively "squashes" all its transitive
361− dependencies' offsets so that none will ever be greater than the target
362− offset of the original <literal>h = t</literal> package. In the other case,
363− <literal>h + 1</literal> is skipped over between the host and target
364− offsets. Instead of squashing the offsets, we need to "rip" them apart so no
365− transitive dependencies' offset is that one.
248+ Because of the bounds checks, the uncommon cases are <literal>h = t</literal> and <literal>h + 2 = t</literal>. In the former case, the motivation for <function>mapOffset</function> is that since its host and target platforms are the same, no transitive dependency of it should be able to "discover" an offset greater than its reduced target offsets. <function>mapOffset</function> effectively "squashes" all its transitive dependencies' offsets so that none will ever be greater than the target offset of the original <literal>h = t</literal> package. In the other case, <literal>h + 1</literal> is skipped over between the host and target offsets. Instead of squashing the offsets, we need to "rip" them apart so no transitive dependencies' offset is that one.
366249 </para>
367250
368251 <para>
369− Overall, the unifying theme here is that propagation shouldn't be
370− introducing transitive dependencies involving platforms the depending
371− package is unaware of. [One can imagine the dependending package asking for
372− dependencies with the platforms it knows about; other platforms it doesn't
373− know how to ask for. The platform description in that scenario is a kind of
374− unforagable capability.] The offset bounds checking and definition of
375− <function>mapOffset</function> together ensure that this is the case.
376− Discovering a new offset is discovering a new platform, and since those
377− platforms weren't in the derivation "spec" of the needing package, they
378− cannot be relevant. From a capability perspective, we can imagine that the
379− host and target platforms of a package are the capabilities a package
380− requires, and the depending package must provide the capability to the
381− dependency.
252+ Overall, the unifying theme here is that propagation shouldn't be introducing transitive dependencies involving platforms the depending package is unaware of. [One can imagine the dependending package asking for dependencies with the platforms it knows about; other platforms it doesn't know how to ask for. The platform description in that scenario is a kind of unforagable capability.] The offset bounds checking and definition of <function>mapOffset</function> together ensure that this is the case. Discovering a new offset is discovering a new platform, and since those platforms weren't in the derivation "spec" of the needing package, they cannot be relevant. From a capability perspective, we can imagine that the host and target platforms of a package are the capabilities a package requires, and the depending package must provide the capability to the dependency.
382253 </para>
383254
384255 <variablelist>
@@ -389,23 +260,10 @@ let f(h, h + 1, i) = i + h
389260 </term>
390261 <listitem>
391262 <para>
392− A list of dependencies whose host and target platforms are the new
393− derivation's build platform. This means a <literal>-1</literal> host and
394− <literal>-1</literal> target offset from the new derivation's platforms.
395− These are programs and libraries used at build time that produce programs
396− and libraries also used at build time. If the dependency doesn't care
397− about the target platform (i.e. isn't a compiler or similar tool), put it
398− in <varname>nativeBuildInputs</varname> instead. The most common use of
399− this <literal>buildPackages.stdenv.cc</literal>, the default C compiler
400− for this role. That example crops up more than one might think in old
401− commonly used C libraries.
263+ A list of dependencies whose host and target platforms are the new derivation's build platform. This means a <literal>-1</literal> host and <literal>-1</literal> target offset from the new derivation's platforms. These are programs and libraries used at build time that produce programs and libraries also used at build time. If the dependency doesn't care about the target platform (i.e. isn't a compiler or similar tool), put it in <varname>nativeBuildInputs</varname> instead. The most common use of this <literal>buildPackages.stdenv.cc</literal>, the default C compiler for this role. That example crops up more than one might think in old commonly used C libraries.
402264 </para>
403265 <para>
404− Since these packages are able to be run at build-time, they are always
405− added to the <envar>PATH</envar>, as described above. But since these
406− packages are only guaranteed to be able to run then, they shouldn't
407− persist as run-time dependencies. This isn't currently enforced, but
408− could be in the future.
266+ Since these packages are able to be run at build-time, they are always added to the <envar>PATH</envar>, as described above. But since these packages are only guaranteed to be able to run then, they shouldn't persist as run-time dependencies. This isn't currently enforced, but could be in the future.
409267 </para>
410268 </listitem>
411269 </varlistentry>
@@ -415,24 +273,10 @@ let f(h, h + 1, i) = i + h
415273 </term>
416274 <listitem>
417275 <para>
418− A list of dependencies whose host platform is the new derivation's build
419− platform, and target platform is the new derivation's host platform. This
420− means a <literal>-1</literal> host offset and <literal>0</literal> target
421− offset from the new derivation's platforms. These are programs and
422− libraries used at build-time that, if they are a compiler or similar
423− tool, produce code to run at run-time—i.e. tools used to build the new
424− derivation. If the dependency doesn't care about the target platform
425− (i.e. isn't a compiler or similar tool), put it here, rather than in
426− <varname>depsBuildBuild</varname> or <varname>depsBuildTarget</varname>.
427− This could be called <varname>depsBuildHost</varname> but
428− <varname>nativeBuildInputs</varname> is used for historical continuity.
429− </para>
430− <para>
431− Since these packages are able to be run at build-time, they are added to
432− the <envar>PATH</envar>, as described above. But since these packages are
433− only guaranteed to be able to run then, they shouldn't persist as
434− run-time dependencies. This isn't currently enforced, but could be in the
435− future.
276+ A list of dependencies whose host platform is the new derivation's build platform, and target platform is the new derivation's host platform. This means a <literal>-1</literal> host offset and <literal>0</literal> target offset from the new derivation's platforms. These are programs and libraries used at build-time that, if they are a compiler or similar tool, produce code to run at run-time—i.e. tools used to build the new derivation. If the dependency doesn't care about the target platform (i.e. isn't a compiler or similar tool), put it here, rather than in <varname>depsBuildBuild</varname> or <varname>depsBuildTarget</varname>. This could be called <varname>depsBuildHost</varname> but <varname>nativeBuildInputs</varname> is used for historical continuity.
277+ </para>
278+ <para>
279+ Since these packages are able to be run at build-time, they are added to the <envar>PATH</envar>, as described above. But since these packages are only guaranteed to be able to run then, they shouldn't persist as run-time dependencies. This isn't currently enforced, but could be in the future.
436280 </para>
437281 </listitem>
438282 </varlistentry>
@@ -442,39 +286,13 @@ let f(h, h + 1, i) = i + h
442286 </term>
443287 <listitem>
444288 <para>
445− A list of dependencies whose host platform is the new derivation's build
446− platform, and target platform is the new derivation's target platform.
447− This means a <literal>-1</literal> host offset and <literal>1</literal>
448− target offset from the new derivation's platforms. These are programs
449− used at build time that produce code to run with code produced by the
450− depending package. Most commonly, these are tools used to build the
451− runtime or standard library that the currently-being-built compiler will
452− inject into any code it compiles. In many cases, the
453− currently-being-built-compiler is itself employed for that task, but when
454− that compiler won't run (i.e. its build and host platform differ) this is
455− not possible. Other times, the compiler relies on some other tool, like
456− binutils, that is always built separately so that the dependency is
457− unconditional.
458− </para>
459− <para>
460− This is a somewhat confusing concept to wrap one’s head around, and for
461− good reason. As the only dependency type where the platform offsets are
462− not adjacent integers, it requires thinking of a bootstrapping stage
463− <emphasis>two</emphasis> away from the current one. It and its use-case
464− go hand in hand and are both considered poor form: try to not need this
465− sort of dependency, and try to avoid building standard libraries and
466− runtimes in the same derivation as the compiler produces code using them.
467− Instead strive to build those like a normal library, using the
468− newly-built compiler just as a normal library would. In short, do not use
469− this attribute unless you are packaging a compiler and are sure it is
470− needed.
471− </para>
472− <para>
473− Since these packages are able to run at build time, they are added to the
474− <envar>PATH</envar>, as described above. But since these packages are
475− only guaranteed to be able to run then, they shouldn't persist as
476− run-time dependencies. This isn't currently enforced, but could be in the
477− future.
289+ A list of dependencies whose host platform is the new derivation's build platform, and target platform is the new derivation's target platform. This means a <literal>-1</literal> host offset and <literal>1</literal> target offset from the new derivation's platforms. These are programs used at build time that produce code to run with code produced by the depending package. Most commonly, these are tools used to build the runtime or standard library that the currently-being-built compiler will inject into any code it compiles. In many cases, the currently-being-built-compiler is itself employed for that task, but when that compiler won't run (i.e. its build and host platform differ) this is not possible. Other times, the compiler relies on some other tool, like binutils, that is always built separately so that the dependency is unconditional.
290+ </para>
291+ <para>
292+ This is a somewhat confusing concept to wrap one’s head around, and for good reason. As the only dependency type where the platform offsets are not adjacent integers, it requires thinking of a bootstrapping stage <emphasis>two</emphasis> away from the current one. It and its use-case go hand in hand and are both considered poor form: try to not need this sort of dependency, and try to avoid building standard libraries and runtimes in the same derivation as the compiler produces code using them. Instead strive to build those like a normal library, using the newly-built compiler just as a normal library would. In short, do not use this attribute unless you are packaging a compiler and are sure it is needed.
293+ </para>
294+ <para>
295+ Since these packages are able to run at build time, they are added to the <envar>PATH</envar>, as described above. But since these packages are only guaranteed to be able to run then, they shouldn't persist as run-time dependencies. This isn't currently enforced, but could be in the future.
478296 </para>
479297 </listitem>
480298 </varlistentry>
@@ -484,16 +302,7 @@ let f(h, h + 1, i) = i + h
484302 </term>
485303 <listitem>
486304 <para>
487− A list of dependencies whose host and target platforms match the new
488− derivation's host platform. This means a <literal>0</literal> host offset
489− and <literal>0</literal> target offset from the new derivation's host
490− platform. These are packages used at run-time to generate code also used
491− at run-time. In practice, this would usually be tools used by compilers
492− for macros or a metaprogramming system, or libraries used by the macros
493− or metaprogramming code itself. It's always preferable to use a
494− <varname>depsBuildBuild</varname> dependency in the derivation being
495− built over a <varname>depsHostHost</varname> on the tool doing the
496− building for this purpose.
305+ A list of dependencies whose host and target platforms match the new derivation's host platform. This means a <literal>0</literal> host offset and <literal>0</literal> target offset from the new derivation's host platform. These are packages used at run-time to generate code also used at run-time. In practice, this would usually be tools used by compilers for macros or a metaprogramming system, or libraries used by the macros or metaprogramming code itself. It's always preferable to use a <varname>depsBuildBuild</varname> dependency in the derivation being built over a <varname>depsHostHost</varname> on the tool doing the building for this purpose.
497306 </para>
498307 </listitem>
499308 </varlistentry>
@@ -503,21 +312,10 @@ let f(h, h + 1, i) = i + h
503312 </term>
504313 <listitem>
505314 <para>
506− A list of dependencies whose host platform and target platform match the
507− new derivation's. This means a <literal>0</literal> host offset and a
508− <literal>1</literal> target offset from the new derivation's host
509− platform. This would be called <varname>depsHostTarget</varname> but for
510− historical continuity. If the dependency doesn't care about the target
511− platform (i.e. isn't a compiler or similar tool), put it here, rather
512− than in <varname>depsBuildBuild</varname>.
315+ A list of dependencies whose host platform and target platform match the new derivation's. This means a <literal>0</literal> host offset and a <literal>1</literal> target offset from the new derivation's host platform. This would be called <varname>depsHostTarget</varname> but for historical continuity. If the dependency doesn't care about the target platform (i.e. isn't a compiler or similar tool), put it here, rather than in <varname>depsBuildBuild</varname>.
513316 </para>
514317 <para>
515− These are often programs and libraries used by the new derivation at
516− <emphasis>run</emphasis>-time, but that isn't always the case. For
517− example, the machine code in a statically-linked library is only used at
518− run-time, but the derivation containing the library is only needed at
519− build-time. Even in the dynamic case, the library may also be needed at
520− build-time to appease the linker.
318+ These are often programs and libraries used by the new derivation at <emphasis>run</emphasis>-time, but that isn't always the case. For example, the machine code in a statically-linked library is only used at run-time, but the derivation containing the library is only needed at build-time. Even in the dynamic case, the library may also be needed at build-time to appease the linker.
521319 </para>
522320 </listitem>
523321 </varlistentry>
@@ -527,14 +325,7 @@ let f(h, h + 1, i) = i + h
527325 </term>
528326 <listitem>
529327 <para>
530− A list of dependencies whose host platform matches the new derivation's
531− target platform. This means a <literal>1</literal> offset from the new
532− derivation's platforms. These are packages that run on the target
533− platform, e.g. the standard library or run-time deps of standard library
534− that a compiler insists on knowing about. It's poor form in almost all
535− cases for a package to depend on another from a future stage [future
536− stage corresponding to positive offset]. Do not use this attribute unless
537− you are packaging a compiler and are sure it is needed.
328+ A list of dependencies whose host platform matches the new derivation's target platform. This means a <literal>1</literal> offset from the new derivation's platforms. These are packages that run on the target platform, e.g. the standard library or run-time deps of standard library that a compiler insists on knowing about. It's poor form in almost all cases for a package to depend on another from a future stage [future stage corresponding to positive offset]. Do not use this attribute unless you are packaging a compiler and are sure it is needed.
538329 </para>
539330 </listitem>
540331 </varlistentry>
@@ -544,9 +335,7 @@ let f(h, h + 1, i) = i + h
544335 </term>
545336 <listitem>
546337 <para>
547− The propagated equivalent of <varname>depsBuildBuild</varname>. This
548− perhaps never ought to be used, but it is included for consistency [see
549− below for the others].
338+ The propagated equivalent of <varname>depsBuildBuild</varname>. This perhaps never ought to be used, but it is included for consistency [see below for the others].
550339 </para>
551340 </listitem>
552341 </varlistentry>
@@ -556,18 +345,7 @@ let f(h, h + 1, i) = i + h
556345 </term>
557346 <listitem>
558347 <para>
559− The propagated equivalent of <varname>nativeBuildInputs</varname>. This
560− would be called <varname>depsBuildHostPropagated</varname> but for
561− historical continuity. For example, if package <varname>Y</varname> has
562− <literal>propagatedNativeBuildInputs = [X]</literal>, and package
563− <varname>Z</varname> has <literal>buildInputs = [Y]</literal>, then
564− package <varname>Z</varname> will be built as if it included package
565− <varname>X</varname> in its <varname>nativeBuildInputs</varname>. If
566− instead, package <varname>Z</varname> has <literal>nativeBuildInputs =
567− [Y]</literal>, then <varname>Z</varname> will be built as if it included
568− <varname>X</varname> in the <varname>depsBuildBuild</varname> of package
569− <varname>Z</varname>, because of the sum of the two <literal>-1</literal>
570− host offsets.
348+ The propagated equivalent of <varname>nativeBuildInputs</varname>. This would be called <varname>depsBuildHostPropagated</varname> but for historical continuity. For example, if package <varname>Y</varname> has <literal>propagatedNativeBuildInputs = [X]</literal>, and package <varname>Z</varname> has <literal>buildInputs = [Y]</literal>, then package <varname>Z</varname> will be built as if it included package <varname>X</varname> in its <varname>nativeBuildInputs</varname>. If instead, package <varname>Z</varname> has <literal>nativeBuildInputs = [Y]</literal>, then <varname>Z</varname> will be built as if it included <varname>X</varname> in the <varname>depsBuildBuild</varname> of package <varname>Z</varname>, because of the sum of the two <literal>-1</literal> host offsets.
571349 </para>
572350 </listitem>
573351 </varlistentry>
@@ -577,8 +355,7 @@ let f(h, h + 1, i) = i + h
577355 </term>
578356 <listitem>
579357 <para>
580− The propagated equivalent of <varname>depsBuildTarget</varname>. This is
581− prefixed for the same reason of alerting potential users.
358+ The propagated equivalent of <varname>depsBuildTarget</varname>. This is prefixed for the same reason of alerting potential users.
582359 </para>
583360 </listitem>
584361 </varlistentry>
@@ -598,9 +375,7 @@ let f(h, h + 1, i) = i + h
598375 </term>
599376 <listitem>
600377 <para>
601− The propagated equivalent of <varname>buildInputs</varname>. This would
602− be called <varname>depsHostTargetPropagated</varname> but for historical
603− continuity.
378+ The propagated equivalent of <varname>buildInputs</varname>. This would be called <varname>depsHostTargetPropagated</varname> but for historical continuity.
604379 </para>
605380 </listitem>
606381 </varlistentry>
@@ -610,8 +385,7 @@ let f(h, h + 1, i) = i + h
610385 </term>
611386 <listitem>
612387 <para>
613− The propagated equivalent of <varname>depsTargetTarget</varname>. This is
614− prefixed for the same reason of alerting potential users.
388+ The propagated equivalent of <varname>depsTargetTarget</varname>. This is prefixed for the same reason of alerting potential users.
615389 </para>
616390 </listitem>
617391 </varlistentry>
@@ -628,15 +402,7 @@ let f(h, h + 1, i) = i + h
628402 </term>
629403 <listitem>
630404 <para>
631− A natural number indicating how much information to log. If set to 1 or
632− higher, <literal>stdenv</literal> will print moderate debugging
633− information during the build. In particular, the <command>gcc</command>
634− and <command>ld</command> wrapper scripts will print out the complete
635− command line passed to the wrapped tools. If set to 6 or higher, the
636− <literal>stdenv</literal> setup script will be run with <literal>set
637− -x</literal> tracing. If set to 7 or higher, the <command>gcc</command>
638− and <command>ld</command> wrapper scripts will also be run with
639− <literal>set -x</literal> tracing.
405+ A natural number indicating how much information to log. If set to 1 or higher, <literal>stdenv</literal> will print moderate debugging information during the build. In particular, the <command>gcc</command> and <command>ld</command> wrapper scripts will print out the complete command line passed to the wrapped tools. If set to 6 or higher, the <literal>stdenv</literal> setup script will be run with <literal>set -x</literal> tracing. If set to 7 or higher, the <command>gcc</command> and <command>ld</command> wrapper scripts will also be run with <literal>set -x</literal> tracing.
640406 </para>
641407 </listitem>
642408 </varlistentry>
@@ -650,15 +416,10 @@ let f(h, h + 1, i) = i + h
650416 </term>
651417 <listitem>
652418 <para>
653− If set to <literal>true</literal>, <literal>stdenv</literal> will pass
654− specific flags to <literal>make</literal> and other build tools to enable
655− parallel building with up to <literal>build-cores</literal> workers.
419+ If set to <literal>true</literal>, <literal>stdenv</literal> will pass specific flags to <literal>make</literal> and other build tools to enable parallel building with up to <literal>build-cores</literal> workers.
656420 </para>
657421 <para>
658− Unless set to <literal>false</literal>, some build systems with good
659− support for parallel building including <literal>cmake</literal>,
660− <literal>meson</literal>, and <literal>qmake</literal> will set it to
661− <literal>true</literal>.
422+ Unless set to <literal>false</literal>, some build systems with good support for parallel building including <literal>cmake</literal>, <literal>meson</literal>, and <literal>qmake</literal> will set it to <literal>true</literal>.
662423 </para>
663424 </listitem>
664425 </varlistentry>
@@ -672,8 +433,7 @@ let f(h, h + 1, i) = i + h
672433 </term>
673434 <listitem>
674435 <para>
675− This is an attribute set which can be filled with arbitrary values. For
676− example:
436+ This is an attribute set which can be filled with arbitrary values. For example:
677437<programlisting>
678438passthru = {
679439 foo = "bar";
@@ -685,17 +445,7 @@ passthru = {
685445</programlisting>
686446 </para>
687447 <para>
688− Values inside it are not passed to the builder, so you can change them
689− without triggering a rebuild. However, they can be accessed outside of a
690− derivation directly, as if they were set inside a derivation itself, e.g.
691− <literal>hello.baz.value1</literal>. We don't specify any usage or schema
692− of <literal>passthru</literal> - it is meant for values that would be
693− useful outside the derivation in other parts of a Nix expression (e.g. in
694− other derivations). An example would be to convey some specific
695− dependency of your derivation which contains a program with plugins
696− support. Later, others who make derivations with plugins can use
697− passed-through dependency to ensure that their plugin would be
698− binary-compatible with built program.
448+ Values inside it are not passed to the builder, so you can change them without triggering a rebuild. However, they can be accessed outside of a derivation directly, as if they were set inside a derivation itself, e.g. <literal>hello.baz.value1</literal>. We don't specify any usage or schema of <literal>passthru</literal> - it is meant for values that would be useful outside the derivation in other parts of a Nix expression (e.g. in other derivations). An example would be to convey some specific dependency of your derivation which contains a program with plugins support. Later, others who make derivations with plugins can use passed-through dependency to ensure that their plugin would be binary-compatible with built program.
699449 </para>
700450 </listitem>
701451 </varlistentry>
@@ -705,9 +455,7 @@ passthru = {
705455 </term>
706456 <listitem>
707457 <para>
708− A script to be run by <filename>maintainers/scripts/update.nix</filename>
709− when the package is matched. It needs to be an executable file, either on
710− the file system:
458+ A script to be run by <filename>maintainers/scripts/update.nix</filename> when the package is matched. It needs to be an executable file, either on the file system:
711459<programlisting>
712460passthru.updateScript = ./update.sh;
713461</programlisting>
@@ -723,21 +471,16 @@ passthru.updateScript = writeScript "update-zoom-us" ''
723471 update-source-version zoom-us "$version"
724472'';
725473</programlisting>
726− The attribute can also contain a list, a script followed by arguments to
727− be passed to it:
474+ The attribute can also contain a list, a script followed by arguments to be passed to it:
728475<programlisting>
729476passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ];
730477</programlisting>
731478 </para>
732479 <para>
733− The script will be usually run from the root of the Nixpkgs repository
734− but you should not rely on that. Also note that the update scripts will
735− be run in parallel by default; you should avoid running <command>git
736− commit</command> or any other commands that cannot handle that.
480+ The script will be usually run from the root of the Nixpkgs repository but you should not rely on that. Also note that the update scripts will be run in parallel by default; you should avoid running <command>git commit</command> or any other commands that cannot handle that.
737481 </para>
738482 <para>
739− For information about how to run the updates, execute <command>nix-shell
740− maintainers/scripts/update.nix</command>.
483+ For information about how to run the updates, execute <command>nix-shell maintainers/scripts/update.nix</command>.
741484 </para>
742485 </listitem>
743486 </varlistentry>
@@ -747,33 +490,18 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
747490 <title>Phases</title>
748491
749492 <para>
750− The generic builder has a number of <emphasis>phases</emphasis>. Package
751− builds are split into phases to make it easier to override specific parts of
752− the build (e.g., unpacking the sources or installing the binaries).
753− Furthermore, it allows a nicer presentation of build logs in the Nix build
754− farm.
493+ The generic builder has a number of <emphasis>phases</emphasis>. Package builds are split into phases to make it easier to override specific parts of the build (e.g., unpacking the sources or installing the binaries). Furthermore, it allows a nicer presentation of build logs in the Nix build farm.
755494 </para>
756495
757496 <para>
758− Each phase can be overridden in its entirety either by setting the
759− environment variable <varname><replaceable>name</replaceable>Phase</varname>
760− to a string containing some shell commands to be executed, or by redefining
761− the shell function <varname><replaceable>name</replaceable>Phase</varname>.
762− The former is convenient to override a phase from the derivation, while the
763− latter is convenient from a build script. However, typically one only wants
764− to <emphasis>add</emphasis> some commands to a phase, e.g. by defining
765− <literal>postInstall</literal> or <literal>preFixup</literal>, as skipping
766− some of the default actions may have unexpected consequences. The default
767− script for each phase is defined in the file
768− <filename>pkgs/stdenv/generic/setup.sh</filename>.
497+ Each phase can be overridden in its entirety either by setting the environment variable <varname><replaceable>name</replaceable>Phase</varname> to a string containing some shell commands to be executed, or by redefining the shell function <varname><replaceable>name</replaceable>Phase</varname>. The former is convenient to override a phase from the derivation, while the latter is convenient from a build script. However, typically one only wants to <emphasis>add</emphasis> some commands to a phase, e.g. by defining <literal>postInstall</literal> or <literal>preFixup</literal>, as skipping some of the default actions may have unexpected consequences. The default script for each phase is defined in the file <filename>pkgs/stdenv/generic/setup.sh</filename>.
769498 </para>
770499
771500 <section xml:id="ssec-controlling-phases">
772501 <title>Controlling phases</title>
773502
774503 <para>
775− There are a number of variables that control what phases are executed and
776− in what order:
504+ There are a number of variables that control what phases are executed and in what order:
777505 <variablelist>
778506 <title>Variables affecting phase control</title>
779507 <varlistentry>
@@ -782,19 +510,10 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
782510 </term>
783511 <listitem>
784512 <para>
785− Specifies the phases. You can change the order in which phases are
786− executed, or add new phases, by setting this variable. If it’s not
787− set, the default value is used, which is <literal>$prePhases
788− unpackPhase patchPhase $preConfigurePhases configurePhase
789− $preBuildPhases buildPhase checkPhase $preInstallPhases installPhase
790− fixupPhase installCheckPhase $preDistPhases distPhase
791− $postPhases</literal>.
513+ Specifies the phases. You can change the order in which phases are executed, or add new phases, by setting this variable. If it’s not set, the default value is used, which is <literal>$prePhases unpackPhase patchPhase $preConfigurePhases configurePhase $preBuildPhases buildPhase checkPhase $preInstallPhases installPhase fixupPhase installCheckPhase $preDistPhases distPhase $postPhases</literal>.
792514 </para>
793515 <para>
794− Usually, if you just want to add a few phases, it’s more convenient
795− to set one of the variables below (such as
796− <varname>preInstallPhases</varname>), as you then don’t specify all
797− the normal phases.
516+ Usually, if you just want to add a few phases, it’s more convenient to set one of the variables below (such as <varname>preInstallPhases</varname>), as you then don’t specify all the normal phases.
798517 </para>
799518 </listitem>
800519 </varlistentry>
@@ -876,11 +595,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
876595 <title>The unpack phase</title>
877596
878597 <para>
879− The unpack phase is responsible for unpacking the source code of the
880− package. The default implementation of <function>unpackPhase</function>
881− unpacks the source files listed in the <envar>src</envar> environment
882− variable to the current directory. It supports the following files by
883− default:
598+ The unpack phase is responsible for unpacking the source code of the package. The default implementation of <function>unpackPhase</function> unpacks the source files listed in the <envar>src</envar> environment variable to the current directory. It supports the following files by default:
884599 <variablelist>
885600 <varlistentry>
886601 <term>
@@ -888,13 +603,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
888603 </term>
889604 <listitem>
890605 <para>
891− These can optionally be compressed using <command>gzip</command>
892− (<filename>.tar.gz</filename>, <filename>.tgz</filename> or
893− <filename>.tar.Z</filename>), <command>bzip2</command>
894− (<filename>.tar.bz2</filename>, <filename>.tbz2</filename> or
895− <filename>.tbz</filename>) or <command>xz</command>
896− (<filename>.tar.xz</filename>, <filename>.tar.lzma</filename> or
897− <filename>.txz</filename>).
606+ These can optionally be compressed using <command>gzip</command> (<filename>.tar.gz</filename>, <filename>.tgz</filename> or <filename>.tar.Z</filename>), <command>bzip2</command> (<filename>.tar.bz2</filename>, <filename>.tbz2</filename> or <filename>.tbz</filename>) or <command>xz</command> (<filename>.tar.xz</filename>, <filename>.tar.lzma</filename> or <filename>.txz</filename>).
898607 </para>
899608 </listitem>
900609 </varlistentry>
@@ -904,9 +613,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
904613 </term>
905614 <listitem>
906615 <para>
907− Zip files are unpacked using <command>unzip</command>. However,
908− <command>unzip</command> is not in the standard environment, so you
909− should add it to <varname>nativeBuildInputs</varname> yourself.
616+ Zip files are unpacked using <command>unzip</command>. However, <command>unzip</command> is not in the standard environment, so you should add it to <varname>nativeBuildInputs</varname> yourself.
910617 </para>
911618 </listitem>
912619 </varlistentry>
@@ -916,16 +623,12 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
916623 </term>
917624 <listitem>
918625 <para>
919− These are simply copied to the current directory. The hash part of the
920− file name is stripped, e.g.
921− <filename>/nix/store/1wydxgby13cz...-my-sources</filename> would be
922− copied to <filename>my-sources</filename>.
626+ These are simply copied to the current directory. The hash part of the file name is stripped, e.g. <filename>/nix/store/1wydxgby13cz...-my-sources</filename> would be copied to <filename>my-sources</filename>.
923627 </para>
924628 </listitem>
925629 </varlistentry>
926630 </variablelist>
927− Additional file types can be supported by setting the
928− <varname>unpackCmd</varname> variable (see below).
631+ Additional file types can be supported by setting the <varname>unpackCmd</varname> variable (see below).
929632 </para>
930633
931634 <para></para>
@@ -938,8 +641,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
938641 </term>
939642 <listitem>
940643 <para>
941− The list of source files or directories to be unpacked or copied. One of
942− these must be set.
644+ The list of source files or directories to be unpacked or copied. One of these must be set.
943645 </para>
944646 </listitem>
945647 </varlistentry>
@@ -949,10 +651,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
949651 </term>
950652 <listitem>
951653 <para>
952− After running <function>unpackPhase</function>, the generic builder
953− changes the current directory to the directory created by unpacking the
954− sources. If there are multiple source directories, you should set
955− <varname>sourceRoot</varname> to the name of the intended directory.
654+ After running <function>unpackPhase</function>, the generic builder changes the current directory to the directory created by unpacking the sources. If there are multiple source directories, you should set <varname>sourceRoot</varname> to the name of the intended directory.
956655 </para>
957656 </listitem>
958657 </varlistentry>
@@ -962,10 +661,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
962661 </term>
963662 <listitem>
964663 <para>
965− Alternatively to setting <varname>sourceRoot</varname>, you can set
966− <varname>setSourceRoot</varname> to a shell command to be evaluated by
967− the unpack phase after the sources have been unpacked. This command must
968− set <varname>sourceRoot</varname>.
664+ Alternatively to setting <varname>sourceRoot</varname>, you can set <varname>setSourceRoot</varname> to a shell command to be evaluated by the unpack phase after the sources have been unpacked. This command must set <varname>sourceRoot</varname>.
969665 </para>
970666 </listitem>
971667 </varlistentry>
@@ -1005,10 +701,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
1005701 </term>
1006702 <listitem>
1007703 <para>
1008− If set to <literal>1</literal>, the unpacked sources are
1009− <emphasis>not</emphasis> made writable. By default, they are made
1010− writable to prevent problems with read-only sources. For example, copied
1011− store directories would be read-only without this.
704+ If set to <literal>1</literal>, the unpacked sources are <emphasis>not</emphasis> made writable. By default, they are made writable to prevent problems with read-only sources. For example, copied store directories would be read-only without this.
1012705 </para>
1013706 </listitem>
1014707 </varlistentry>
@@ -1018,9 +711,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
1018711 </term>
1019712 <listitem>
1020713 <para>
1021− The unpack phase evaluates the string <literal>$unpackCmd</literal> for
1022− any unrecognised file. The path to the current source file is contained
1023− in the <varname>curSrc</varname> variable.
714+ The unpack phase evaluates the string <literal>$unpackCmd</literal> for any unrecognised file. The path to the current source file is contained in the <varname>curSrc</varname> variable.
1024715 </para>
1025716 </listitem>
1026717 </varlistentry>
@@ -1031,8 +722,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
1031722 <title>The patch phase</title>
1032723
1033724 <para>
1034− The patch phase applies the list of patches defined in the
1035− <varname>patches</varname> variable.
725+ The patch phase applies the list of patches defined in the <varname>patches</varname> variable.
1036726 </para>
1037727
1038728 <variablelist>
@@ -1043,11 +733,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
1043733 </term>
1044734 <listitem>
1045735 <para>
1046− The list of patches. They must be in the format accepted by the
1047− <command>patch</command> command, and may optionally be compressed using
1048− <command>gzip</command> (<filename>.gz</filename>),
1049− <command>bzip2</command> (<filename>.bz2</filename>) or
1050− <command>xz</command> (<filename>.xz</filename>).
736+ The list of patches. They must be in the format accepted by the <command>patch</command> command, and may optionally be compressed using <command>gzip</command> (<filename>.gz</filename>), <command>bzip2</command> (<filename>.bz2</filename>) or <command>xz</command> (<filename>.xz</filename>).
1051737 </para>
1052738 </listitem>
1053739 </varlistentry>
@@ -1057,9 +743,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
1057743 </term>
1058744 <listitem>
1059745 <para>
1060− Flags to be passed to <command>patch</command>. If not set, the argument
1061− <option>-p1</option> is used, which causes the leading directory
1062− component to be stripped from the file names in each patch.
746+ Flags to be passed to <command>patch</command>. If not set, the argument <option>-p1</option> is used, which causes the leading directory component to be stripped from the file names in each patch.
1063747 </para>
1064748 </listitem>
1065749 </varlistentry>
@@ -1090,9 +774,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
1090774 <title>The configure phase</title>
1091775
1092776 <para>
1093− The configure phase prepares the source tree for building. The default
1094− <function>configurePhase</function> runs <filename>./configure</filename>
1095− (typically an Autoconf-generated script) if it exists.
777+ The configure phase prepares the source tree for building. The default <function>configurePhase</function> runs <filename>./configure</filename> (typically an Autoconf-generated script) if it exists.
1096778 </para>
1097779
1098780 <variablelist>
@@ -1103,10 +785,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
1103785 </term>
1104786 <listitem>
1105787 <para>
1106− The name of the configure script. It defaults to
1107− <filename>./configure</filename> if it exists; otherwise, the configure
1108− phase is skipped. This can actually be a command (like <literal>perl
1109− ./Configure.pl</literal>).
788+ The name of the configure script. It defaults to <filename>./configure</filename> if it exists; otherwise, the configure phase is skipped. This can actually be a command (like <literal>perl ./Configure.pl</literal>).
1110789 </para>
1111790 </listitem>
1112791 </varlistentry>
@@ -1116,8 +795,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
1116795 </term>
1117796 <listitem>
1118797 <para>
1119− A list of strings passed as additional arguments to the configure
1120− script.
798+ A list of strings passed as additional arguments to the configure script.
1121799 </para>
1122800 </listitem>
1123801 </varlistentry>
@@ -1137,9 +815,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
1137815 </term>
1138816 <listitem>
1139817 <para>
1140− A shell array containing additional arguments passed to the configure
1141− script. You must use this instead of <varname>configureFlags</varname>
1142− if the arguments contain spaces.
818+ A shell array containing additional arguments passed to the configure script. You must use this instead of <varname>configureFlags</varname> if the arguments contain spaces.
1143819 </para>
1144820 </listitem>
1145821 </varlistentry>
@@ -1149,8 +825,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
1149825 </term>
1150826 <listitem>
1151827 <para>
1152− By default, the flag <literal>--prefix=$prefix</literal> is added to the
1153− configure flags. If this is undesirable, set this variable to true.
828+ By default, the flag <literal>--prefix=$prefix</literal> is added to the configure flags. If this is undesirable, set this variable to true.
1154829 </para>
1155830 </listitem>
1156831 </varlistentry>
@@ -1160,9 +835,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
1160835 </term>
1161836 <listitem>
1162837 <para>
1163− The prefix under which the package must be installed, passed via the
1164− <option>--prefix</option> option to the configure script. It defaults to
1165− <option>$out</option>.
838+ The prefix under which the package must be installed, passed via the <option>--prefix</option> option to the configure script. It defaults to <option>$out</option>.
1166839 </para>
1167840 </listitem>
1168841 </varlistentry>
@@ -1172,8 +845,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
1172845 </term>
1173846 <listitem>
1174847 <para>
1175− The key to use when specifying the prefix. By default, this is set to
1176− <option>--prefix=</option> as that is used by the majority of packages.
848+ The key to use when specifying the prefix. By default, this is set to <option>--prefix=</option> as that is used by the majority of packages.
1177849 </para>
1178850 </listitem>
1179851 </varlistentry>
@@ -1183,9 +855,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
1183855 </term>
1184856 <listitem>
1185857 <para>
1186− By default, the flag <literal>--disable-dependency-tracking</literal> is
1187− added to the configure flags to speed up Automake-based builds. If this
1188− is undesirable, set this variable to true.
858+ By default, the flag <literal>--disable-dependency-tracking</literal> is added to the configure flags to speed up Automake-based builds. If this is undesirable, set this variable to true.
1189859 </para>
1190860 </listitem>
1191861 </varlistentry>
@@ -1195,15 +865,10 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
1195865 </term>
1196866 <listitem>
1197867 <para>
1198− By default, the configure phase applies some special hackery to all
1199− files called <filename>ltmain.sh</filename> before running the configure
1200− script in order to improve the purity of Libtool-based packages
868+ By default, the configure phase applies some special hackery to all files called <filename>ltmain.sh</filename> before running the configure script in order to improve the purity of Libtool-based packages
1201869 <footnote xml:id="footnote-stdenv-sys-lib-search-path">
1202870 <para>
1203− It clears the
1204− <varname>sys_lib_<replaceable>*</replaceable>search_path</varname>
1205− variables in the Libtool script to prevent Libtool from using
1206− libraries in <filename>/usr/lib</filename> and such.
871+ It clears the <varname>sys_lib_<replaceable>*</replaceable>search_path</varname> variables in the Libtool script to prevent Libtool from using libraries in <filename>/usr/lib</filename> and such.
1207872 </para>
1208873 </footnote>
1209874 . If this is undesirable, set this variable to true.
@@ -1216,9 +881,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
1216881 </term>
1217882 <listitem>
1218883 <para>
1219− By default, when the configure script has
1220− <option>--enable-static</option>, the option
1221− <option>--disable-static</option> is added to the configure flags.
884+ By default, when the configure script has <option>--enable-static</option>, the option <option>--disable-static</option> is added to the configure flags.
1222885 </para>
1223886 <para>
1224887 If this is undesirable, set this variable to true.
@@ -1231,16 +894,10 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
1231894 </term>
1232895 <listitem>
1233896 <para>
1234− By default, when cross compiling, the configure script has
1235− <option>--build=...</option> and <option>--host=...</option> passed.
1236− Packages can instead pass <literal>[ "build" "host" "target" ]</literal>
1237− or a subset to control exactly which platform flags are passed.
1238− Compilers and other tools can use this to also pass the target platform.
897+ By default, when cross compiling, the configure script has <option>--build=...</option> and <option>--host=...</option> passed. Packages can instead pass <literal>[ "build" "host" "target" ]</literal> or a subset to control exactly which platform flags are passed. Compilers and other tools can use this to also pass the target platform.
1239898 <footnote xml:id="footnote-stdenv-build-time-guessing-impurity">
1240899 <para>
1241− Eventually these will be passed building natively as well, to improve
1242− determinism: build-time guessing, as is done today, is a risk of
1243− impurity.
900+ Eventually these will be passed building natively as well, to improve determinism: build-time guessing, as is done today, is a risk of impurity.
1244901 </para>
1245902 </footnote>
1246903 </para>
@@ -1273,12 +930,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
1273930 <title>The build phase</title>
1274931
1275932 <para>
1276− The build phase is responsible for actually building the package (e.g.
1277− compiling it). The default <function>buildPhase</function> simply calls
1278− <command>make</command> if a file named <filename>Makefile</filename>,
1279− <filename>makefile</filename> or <filename>GNUmakefile</filename> exists in
1280− the current directory (or the <varname>makefile</varname> is explicitly
1281− set); otherwise it does nothing.
933+ The build phase is responsible for actually building the package (e.g. compiling it). The default <function>buildPhase</function> simply calls <command>make</command> if a file named <filename>Makefile</filename>, <filename>makefile</filename> or <filename>GNUmakefile</filename> exists in the current directory (or the <varname>makefile</varname> is explicitly set); otherwise it does nothing.
1282934 </para>
1283935
1284936 <variablelist>
@@ -1309,17 +961,13 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]
1309961 </term>
1310962 <listitem>
1311963 <para>
1312− A list of strings passed as additional flags to <command>make</command>.
1313− These flags are also used by the default install and check phase. For
1314− setting make flags specific to the build phase, use
1315− <varname>buildFlags</varname> (see below).
964+ A list of strings passed as additional flags to <command>make</command>. These flags are also used by the default install and check phase. For setting make flags specific to the build phase, use <varname>buildFlags</varname> (see below).
1316965<programlisting>
1317966makeFlags = [ "PREFIX=$(out)" ];
1318967</programlisting>
1319968 <note>
1320969 <para>
1321− The flags are quoted in bash, but environment variables can be
1322− specified by using the make syntax.
970+ The flags are quoted in bash, but environment variables can be specified by using the make syntax.
1323971 </para>
1324972 </note>
1325973 </para>
@@ -1331,18 +979,13 @@ makeFlags = [ "PREFIX=$(out)" ];
1331979 </term>
1332980 <listitem>
1333981 <para>
1334− A shell array containing additional arguments passed to
1335− <command>make</command>. You must use this instead of
1336− <varname>makeFlags</varname> if the arguments contain spaces, e.g.
982+ A shell array containing additional arguments passed to <command>make</command>. You must use this instead of <varname>makeFlags</varname> if the arguments contain spaces, e.g.
1337983<programlisting>
1338984preBuild = ''
1339985 makeFlagsArray+=(CFLAGS="-O0 -g" LDFLAGS="-lfoo -lbar")
1340986'';
1341987</programlisting>
1342− Note that shell arrays cannot be passed through environment variables,
1343− so you cannot set <varname>makeFlagsArray</varname> in a derivation
1344− attribute (because those are passed through environment variables): you
1345− have to define them in shell code.
988+ Note that shell arrays cannot be passed through environment variables, so you cannot set <varname>makeFlagsArray</varname> in a derivation attribute (because those are passed through environment variables): you have to define them in shell code.
1346989 </para>
1347990 </listitem>
1348991 </varlistentry>
@@ -1352,9 +995,7 @@ preBuild = ''
1352995 </term>
1353996 <listitem>
1354997 <para>
1355− A list of strings passed as additional flags to <command>make</command>.
1356− Like <varname>makeFlags</varname> and <varname>makeFlagsArray</varname>,
1357− but only used by the build phase.
998+ A list of strings passed as additional flags to <command>make</command>. Like <varname>makeFlags</varname> and <varname>makeFlagsArray</varname>, but only used by the build phase.
1358999 </para>
13591000 </listitem>
13601001 </varlistentry>
@@ -1381,14 +1022,11 @@ preBuild = ''
13811022 </variablelist>
13821023
13831024 <para>
1384− You can set flags for <command>make</command> through the
1385− <varname>makeFlags</varname> variable.
1025+ You can set flags for <command>make</command> through the <varname>makeFlags</varname> variable.
13861026 </para>
13871027
13881028 <para>
1389− Before and after running <command>make</command>, the hooks
1390− <varname>preBuild</varname> and <varname>postBuild</varname> are called,
1391− respectively.
1029+ Before and after running <command>make</command>, the hooks <varname>preBuild</varname> and <varname>postBuild</varname> are called, respectively.
13921030 </para>
13931031 </section>
13941032
@@ -1396,10 +1034,7 @@ preBuild = ''
13961034 <title>The check phase</title>
13971035
13981036 <para>
1399− The check phase checks whether the package was built correctly by running
1400− its test suite. The default <function>checkPhase</function> calls
1401− <command>make check</command>, but only if the <varname>doCheck</varname>
1402− variable is enabled.
1037+ The check phase checks whether the package was built correctly by running its test suite. The default <function>checkPhase</function> calls <command>make check</command>, but only if the <varname>doCheck</varname> variable is enabled.
14031038 </para>
14041039
14051040 <variablelist>
@@ -1410,14 +1045,9 @@ preBuild = ''
14101045 </term>
14111046 <listitem>
14121047 <para>
1413− Controls whether the check phase is executed. By default it is skipped,
1414− but if <varname>doCheck</varname> is set to true, the check phase is
1415− usually executed. Thus you should set
1048+ Controls whether the check phase is executed. By default it is skipped, but if <varname>doCheck</varname> is set to true, the check phase is usually executed. Thus you should set
14161049<programlisting>doCheck = true;</programlisting>
1417− in the derivation to enable checks. The exception is cross compilation.
1418− Cross compiled builds never run tests, no matter how
1419− <varname>doCheck</varname> is set, as the newly-built program won't run
1420− on the platform used to build it.
1050+ in the derivation to enable checks. The exception is cross compilation. Cross compiled builds never run tests, no matter how <varname>doCheck</varname> is set, as the newly-built program won't run on the platform used to build it.
14211051 </para>
14221052 </listitem>
14231053 </varlistentry>
@@ -1437,8 +1067,7 @@ preBuild = ''
14371067 </term>
14381068 <listitem>
14391069 <para>
1440− The make target that runs the tests. Defaults to
1441− <literal>check</literal>.
1070+ The make target that runs the tests. Defaults to <literal>check</literal>.
14421071 </para>
14431072 </listitem>
14441073 </varlistentry>
@@ -1448,9 +1077,7 @@ preBuild = ''
14481077 </term>
14491078 <listitem>
14501079 <para>
1451− A list of strings passed as additional flags to <command>make</command>.
1452− Like <varname>makeFlags</varname> and <varname>makeFlagsArray</varname>,
1453− but only used by the check phase.
1080+ A list of strings passed as additional flags to <command>make</command>. Like <varname>makeFlags</varname> and <varname>makeFlagsArray</varname>, but only used by the check phase.
14541081 </para>
14551082 </listitem>
14561083 </varlistentry>
@@ -1460,9 +1087,7 @@ preBuild = ''
14601087 </term>
14611088 <listitem>
14621089 <para>
1463− A list of dependencies used by the phase. This gets included in
1464− <varname>nativeBuildInputs</varname> when <varname>doCheck</varname> is
1465− set.
1090+ A list of dependencies used by the phase. This gets included in <varname>nativeBuildInputs</varname> when <varname>doCheck</varname> is set.
14661091 </para>
14671092 </listitem>
14681093 </varlistentry>
@@ -1493,10 +1118,7 @@ preBuild = ''
14931118 <title>The install phase</title>
14941119
14951120 <para>
1496− The install phase is responsible for installing the package in the Nix
1497− store under <envar>out</envar>. The default
1498− <function>installPhase</function> creates the directory
1499− <literal>$out</literal> and calls <command>make install</command>.
1121+ The install phase is responsible for installing the package in the Nix store under <envar>out</envar>. The default <function>installPhase</function> creates the directory <literal>$out</literal> and calls <command>make install</command>.
15001122 </para>
15011123
15021124 <variablelist>
@@ -1517,8 +1139,7 @@ preBuild = ''
15171139 </term>
15181140 <listitem>
15191141 <para>
1520− The make targets that perform the installation. Defaults to
1521− <literal>install</literal>. Example:
1142+ The make targets that perform the installation. Defaults to <literal>install</literal>. Example:
15221143<programlisting>
15231144installTargets = "install-bin install-doc";</programlisting>
15241145 </para>
@@ -1530,9 +1151,7 @@ installTargets = "install-bin install-doc";</programlisting>
15301151 </term>
15311152 <listitem>
15321153 <para>
1533− A list of strings passed as additional flags to <command>make</command>.
1534− Like <varname>makeFlags</varname> and <varname>makeFlagsArray</varname>,
1535− but only used by the install phase.
1154+ A list of strings passed as additional flags to <command>make</command>. Like <varname>makeFlags</varname> and <varname>makeFlagsArray</varname>, but only used by the install phase.
15361155 </para>
15371156 </listitem>
15381157 </varlistentry>
@@ -1563,15 +1182,11 @@ installTargets = "install-bin install-doc";</programlisting>
15631182 <title>The fixup phase</title>
15641183
15651184 <para>
1566− The fixup phase performs some (Nix-specific) post-processing actions on the
1567− files installed under <filename>$out</filename> by the install phase. The
1568− default <function>fixupPhase</function> does the following:
1185+ The fixup phase performs some (Nix-specific) post-processing actions on the files installed under <filename>$out</filename> by the install phase. The default <function>fixupPhase</function> does the following:
15691186 <itemizedlist>
15701187 <listitem>
15711188 <para>
1572− It moves the <filename>man/</filename>, <filename>doc/</filename> and
1573− <filename>info/</filename> subdirectories of <envar>$out</envar> to
1574− <filename>share/</filename>.
1189+ It moves the <filename>man/</filename>, <filename>doc/</filename> and <filename>info/</filename> subdirectories of <envar>$out</envar> to <filename>share/</filename>.
15751190 </para>
15761191 </listitem>
15771192 <listitem>
@@ -1581,19 +1196,12 @@ installTargets = "install-bin install-doc";</programlisting>
15811196 </listitem>
15821197 <listitem>
15831198 <para>
1584− On Linux, it applies the <command>patchelf</command> command to ELF
1585− executables and libraries to remove unused directories from the
1586− <literal>RPATH</literal> in order to prevent unnecessary runtime
1587− dependencies.
1199+ On Linux, it applies the <command>patchelf</command> command to ELF executables and libraries to remove unused directories from the <literal>RPATH</literal> in order to prevent unnecessary runtime dependencies.
15881200 </para>
15891201 </listitem>
15901202 <listitem>
15911203 <para>
1592− It rewrites the interpreter paths of shell scripts to paths found in
1593− <envar>PATH</envar>. E.g., <filename>/usr/bin/perl</filename> will be
1594− rewritten to
1595− <filename>/nix/store/<replaceable>some-perl</replaceable>/bin/perl</filename>
1596− found in <envar>PATH</envar>.
1204+ It rewrites the interpreter paths of shell scripts to paths found in <envar>PATH</envar>. E.g., <filename>/usr/bin/perl</filename> will be rewritten to <filename>/nix/store/<replaceable>some-perl</replaceable>/bin/perl</filename> found in <envar>PATH</envar>.
15971205 </para>
15981206 </listitem>
15991207 </itemizedlist>
@@ -1617,8 +1225,7 @@ installTargets = "install-bin install-doc";</programlisting>
16171225 </term>
16181226 <listitem>
16191227 <para>
1620− If set, libraries and executables are not stripped. By default, they
1621− are.
1228+ If set, libraries and executables are not stripped. By default, they are.
16221229 </para>
16231230 </listitem>
16241231 </varlistentry>
@@ -1628,10 +1235,7 @@ installTargets = "install-bin install-doc";</programlisting>
16281235 </term>
16291236 <listitem>
16301237 <para>
1631− Like <varname>dontStrip</varname>, but only affects the
1632− <command>strip</command> command targetting the package's host platform.
1633− Useful when supporting cross compilation, but otherwise feel free to
1634− ignore.
1238+ Like <varname>dontStrip</varname>, but only affects the <command>strip</command> command targetting the package's host platform. Useful when supporting cross compilation, but otherwise feel free to ignore.
16351239 </para>
16361240 </listitem>
16371241 </varlistentry>
@@ -1641,10 +1245,7 @@ installTargets = "install-bin install-doc";</programlisting>
16411245 </term>
16421246 <listitem>
16431247 <para>
1644− Like <varname>dontStrip</varname>, but only affects the
1645− <command>strip</command> command targetting the packages' target
1646− platform. Useful when supporting cross compilation, but otherwise feel
1647− free to ignore.
1248+ Like <varname>dontStrip</varname>, but only affects the <command>strip</command> command targetting the packages' target platform. Useful when supporting cross compilation, but otherwise feel free to ignore.
16481249 </para>
16491250 </listitem>
16501251 </varlistentry>
@@ -1654,8 +1255,7 @@ installTargets = "install-bin install-doc";</programlisting>
16541255 </term>
16551256 <listitem>
16561257 <para>
1657− If set, files in <filename>$out/sbin</filename> are not moved to
1658− <filename>$out/bin</filename>. By default, they are.
1258+ If set, files in <filename>$out/sbin</filename> are not moved to <filename>$out/bin</filename>. By default, they are.
16591259 </para>
16601260 </listitem>
16611261 </varlistentry>
@@ -1665,10 +1265,7 @@ installTargets = "install-bin install-doc";</programlisting>
16651265 </term>
16661266 <listitem>
16671267 <para>
1668− List of directories to search for libraries and executables from which
1669− <emphasis>all</emphasis> symbols should be stripped. By default, it’s
1670− empty. Stripping all symbols is risky, since it may remove not just
1671− debug symbols but also ELF information necessary for normal execution.
1268+ List of directories to search for libraries and executables from which <emphasis>all</emphasis> symbols should be stripped. By default, it’s empty. Stripping all symbols is risky, since it may remove not just debug symbols but also ELF information necessary for normal execution.
16721269 </para>
16731270 </listitem>
16741271 </varlistentry>
@@ -1678,9 +1275,7 @@ installTargets = "install-bin install-doc";</programlisting>
16781275 </term>
16791276 <listitem>
16801277 <para>
1681− Flags passed to the <command>strip</command> command applied to the
1682− files in the directories listed in <varname>stripAllList</varname>.
1683− Defaults to <option>-s</option> (i.e. <option>--strip-all</option>).
1278+ Flags passed to the <command>strip</command> command applied to the files in the directories listed in <varname>stripAllList</varname>. Defaults to <option>-s</option> (i.e. <option>--strip-all</option>).
16841279 </para>
16851280 </listitem>
16861281 </varlistentry>
@@ -1690,9 +1285,7 @@ installTargets = "install-bin install-doc";</programlisting>
16901285 </term>
16911286 <listitem>
16921287 <para>
1693− List of directories to search for libraries and executables from which
1694− only debugging-related symbols should be stripped. It defaults to
1695− <literal>lib bin sbin</literal>.
1288+ List of directories to search for libraries and executables from which only debugging-related symbols should be stripped. It defaults to <literal>lib bin sbin</literal>.
16961289 </para>
16971290 </listitem>
16981291 </varlistentry>
@@ -1702,9 +1295,7 @@ installTargets = "install-bin install-doc";</programlisting>
17021295 </term>
17031296 <listitem>
17041297 <para>
1705− Flags passed to the <command>strip</command> command applied to the
1706− files in the directories listed in <varname>stripDebugList</varname>.
1707− Defaults to <option>-S</option> (i.e. <option>--strip-debug</option>).
1298+ Flags passed to the <command>strip</command> command applied to the files in the directories listed in <varname>stripDebugList</varname>. Defaults to <option>-S</option> (i.e. <option>--strip-debug</option>).
17081299 </para>
17091300 </listitem>
17101301 </varlistentry>
@@ -1714,8 +1305,7 @@ installTargets = "install-bin install-doc";</programlisting>
17141305 </term>
17151306 <listitem>
17161307 <para>
1717− If set, the <command>patchelf</command> command is not used to remove
1718− unnecessary <literal>RPATH</literal> entries. Only applies to Linux.
1308+ If set, the <command>patchelf</command> command is not used to remove unnecessary <literal>RPATH</literal> entries. Only applies to Linux.
17191309 </para>
17201310 </listitem>
17211311 </varlistentry>
@@ -1725,8 +1315,7 @@ installTargets = "install-bin install-doc";</programlisting>
17251315 </term>
17261316 <listitem>
17271317 <para>
1728− If set, scripts starting with <literal>#!</literal> do not have their
1729− interpreter paths rewritten to paths in the Nix store.
1318+ If set, scripts starting with <literal>#!</literal> do not have their interpreter paths rewritten to paths in the Nix store.
17301319 </para>
17311320 </listitem>
17321321 </varlistentry>
@@ -1736,9 +1325,7 @@ installTargets = "install-bin install-doc";</programlisting>
17361325 </term>
17371326 <listitem>
17381327 <para>
1739− If set, libtool <literal>.la</literal> files associated with shared
1740− libraries won't have their <literal>dependency_libs</literal> field
1741− cleared.
1328+ If set, libtool <literal>.la</literal> files associated with shared libraries won't have their <literal>dependency_libs</literal> field cleared.
17421329 </para>
17431330 </listitem>
17441331 </varlistentry>
@@ -1748,9 +1335,7 @@ installTargets = "install-bin install-doc";</programlisting>
17481335 </term>
17491336 <listitem>
17501337 <para>
1751− The list of directories that must be moved from
1752− <filename>$out</filename> to <filename>$out/share</filename>. Defaults
1753− to <literal>man doc info</literal>.
1338+ The list of directories that must be moved from <filename>$out</filename> to <filename>$out/share</filename>. Defaults to <literal>man doc info</literal>.
17541339 </para>
17551340 </listitem>
17561341 </varlistentry>
@@ -1760,11 +1345,7 @@ installTargets = "install-bin install-doc";</programlisting>
17601345 </term>
17611346 <listitem>
17621347 <para>
1763− A package can export a <link linkend="ssec-setup-hooks">setup
1764− hook</link> by setting this variable. The setup hook, if defined, is
1765− copied to <filename>$out/nix-support/setup-hook</filename>. Environment
1766− variables are then substituted in it using
1767− <function
1348+ A package can export a <link linkend="ssec-setup-hooks">setup hook</link> by setting this variable. The setup hook, if defined, is copied to <filename>$out/nix-support/setup-hook</filename>. Environment variables are then substituted in it using <function
17681349 linkend="fun-substituteAll">substituteAll</function>.
17691350 </para>
17701351 </listitem>
@@ -1795,25 +1376,14 @@ installTargets = "install-bin install-doc";</programlisting>
17951376 </term>
17961377 <listitem>
17971378 <para>
1798− If set to <literal>true</literal>, the standard environment will enable
1799− debug information in C/C++ builds. After installation, the debug
1800− information will be separated from the executables and stored in the
1801− output named <literal>debug</literal>. (This output is enabled
1802− automatically; you don’t need to set the <varname>outputs</varname>
1803− attribute explicitly.) To be precise, the debug information is stored in
1804− <filename><replaceable>debug</replaceable>/lib/debug/.build-id/<replaceable>XX</replaceable>/<replaceable>YYYY…</replaceable></filename>,
1805− where <replaceable>XXYYYY…</replaceable> is the <replaceable>build
1806− ID</replaceable> of the binary — a SHA-1 hash of the contents of the
1807− binary. Debuggers like GDB use the build ID to look up the separated
1808− debug information.
1379+ If set to <literal>true</literal>, the standard environment will enable debug information in C/C++ builds. After installation, the debug information will be separated from the executables and stored in the output named <literal>debug</literal>. (This output is enabled automatically; you don’t need to set the <varname>outputs</varname> attribute explicitly.) To be precise, the debug information is stored in <filename><replaceable>debug</replaceable>/lib/debug/.build-id/<replaceable>XX</replaceable>/<replaceable>YYYY…</replaceable></filename>, where <replaceable>XXYYYY…</replaceable> is the <replaceable>build ID</replaceable> of the binary — a SHA-1 hash of the contents of the binary. Debuggers like GDB use the build ID to look up the separated debug information.
18091380 </para>
18101381 <para>
18111382 For example, with GDB, you can add
18121383<programlisting>
18131384set debug-file-directory ~/.nix-profile/lib/debug
18141385</programlisting>
1815− to <filename>~/.gdbinit</filename>. GDB will then be able to find debug
1816− information installed via <literal>nix-env -i</literal>.
1386+ to <filename>~/.gdbinit</filename>. GDB will then be able to find debug information installed via <literal>nix-env -i</literal>.
18171387 </para>
18181388 </listitem>
18191389 </varlistentry>
@@ -1824,10 +1394,7 @@ set debug-file-directory ~/.nix-profile/lib/debug
18241394 <title>The installCheck phase</title>
18251395
18261396 <para>
1827− The installCheck phase checks whether the package was installed correctly
1828− by running its test suite against the installed directories. The default
1829− <function>installCheck</function> calls <command>make
1830− installcheck</command>.
1397+ The installCheck phase checks whether the package was installed correctly by running its test suite against the installed directories. The default <function>installCheck</function> calls <command>make installcheck</command>.
18311398 </para>
18321399
18331400 <variablelist>
@@ -1838,14 +1405,9 @@ set debug-file-directory ~/.nix-profile/lib/debug
18381405 </term>
18391406 <listitem>
18401407 <para>
1841− Controls whether the installCheck phase is executed. By default it is
1842− skipped, but if <varname>doInstallCheck</varname> is set to true, the
1843− installCheck phase is usually executed. Thus you should set
1408+ Controls whether the installCheck phase is executed. By default it is skipped, but if <varname>doInstallCheck</varname> is set to true, the installCheck phase is usually executed. Thus you should set
18441409<programlisting>doInstallCheck = true;</programlisting>
1845− in the derivation to enable install checks. The exception is cross
1846− compilation. Cross compiled builds never run tests, no matter how
1847− <varname>doInstallCheck</varname> is set, as the newly-built program
1848− won't run on the platform used to build it.
1410+ in the derivation to enable install checks. The exception is cross compilation. Cross compiled builds never run tests, no matter how <varname>doInstallCheck</varname> is set, as the newly-built program won't run on the platform used to build it.
18491411 </para>
18501412 </listitem>
18511413 </varlistentry>
@@ -1855,8 +1417,7 @@ set debug-file-directory ~/.nix-profile/lib/debug
18551417 </term>
18561418 <listitem>
18571419 <para>
1858− The make target that runs the install tests. Defaults to
1859− <literal>installcheck</literal>.
1420+ The make target that runs the install tests. Defaults to <literal>installcheck</literal>.
18601421 </para>
18611422 </listitem>
18621423 </varlistentry>
@@ -1866,9 +1427,7 @@ set debug-file-directory ~/.nix-profile/lib/debug
18661427 </term>
18671428 <listitem>
18681429 <para>
1869− A list of strings passed as additional flags to <command>make</command>.
1870− Like <varname>makeFlags</varname> and <varname>makeFlagsArray</varname>,
1871− but only used by the installCheck phase.
1430+ A list of strings passed as additional flags to <command>make</command>. Like <varname>makeFlags</varname> and <varname>makeFlagsArray</varname>, but only used by the installCheck phase.
18721431 </para>
18731432 </listitem>
18741433 </varlistentry>
@@ -1878,9 +1437,7 @@ set debug-file-directory ~/.nix-profile/lib/debug
18781437 </term>
18791438 <listitem>
18801439 <para>
1881− A list of dependencies used by the phase. This gets included in
1882− <varname>nativeBuildInputs</varname> when
1883− <varname>doInstallCheck</varname> is set.
1440+ A list of dependencies used by the phase. This gets included in <varname>nativeBuildInputs</varname> when <varname>doInstallCheck</varname> is set.
18841441 </para>
18851442 </listitem>
18861443 </varlistentry>
@@ -1911,11 +1468,7 @@ set debug-file-directory ~/.nix-profile/lib/debug
19111468 <title>The distribution phase</title>
19121469
19131470 <para>
1914− The distribution phase is intended to produce a source distribution of the
1915− package. The default <function>distPhase</function> first calls
1916− <command>make dist</command>, then it copies the resulting source tarballs
1917− to <filename>$out/tarballs/</filename>. This phase is only executed if the
1918− attribute <varname>doDist</varname> is set.
1471+ The distribution phase is intended to produce a source distribution of the package. The default <function>distPhase</function> first calls <command>make dist</command>, then it copies the resulting source tarballs to <filename>$out/tarballs/</filename>. This phase is only executed if the attribute <varname>doDist</varname> is set.
19191472 </para>
19201473
19211474 <variablelist>
@@ -1926,8 +1479,7 @@ set debug-file-directory ~/.nix-profile/lib/debug
19261479 </term>
19271480 <listitem>
19281481 <para>
1929− The make target that produces the distribution. Defaults to
1930− <literal>dist</literal>.
1482+ The make target that produces the distribution. Defaults to <literal>dist</literal>.
19311483 </para>
19321484 </listitem>
19331485 </varlistentry>
@@ -1947,9 +1499,7 @@ set debug-file-directory ~/.nix-profile/lib/debug
19471499 </term>
19481500 <listitem>
19491501 <para>
1950− The names of the source distribution files to be copied to
1951− <filename>$out/tarballs/</filename>. It can contain shell wildcards. The
1952− default is <filename>*.tar.gz</filename>.
1502+ The names of the source distribution files to be copied to <filename>$out/tarballs/</filename>. It can contain shell wildcards. The default is <filename>*.tar.gz</filename>.
19531503 </para>
19541504 </listitem>
19551505 </varlistentry>
@@ -2000,8 +1550,7 @@ set debug-file-directory ~/.nix-profile/lib/debug
20001550 </term>
20011551 <listitem>
20021552 <para>
2003− Constructs a wrapper for a program with various possible arguments. For
2004− example:
1553+ Constructs a wrapper for a program with various possible arguments. For example:
20051554<programlisting>
20061555# adds `FOOBAR=baz` to `$out/bin/foo`’s environment
20071556makeWrapper $out/bin/foo $wrapperfile --set FOOBAR baz
@@ -2011,12 +1560,10 @@ makeWrapper $out/bin/foo $wrapperfile --set FOOBAR baz
20111560# (via string replacements or in `configurePhase`).
20121561makeWrapper $out/bin/foo $wrapperfile --prefix PATH : ${lib.makeBinPath [ hello git ]}
20131562</programlisting>
2014− There’s many more kinds of arguments, they are documented in
2015− <literal>nixpkgs/pkgs/build-support/setup-hooks/make-wrapper.sh</literal>.
1563+ There’s many more kinds of arguments, they are documented in <literal>nixpkgs/pkgs/build-support/setup-hooks/make-wrapper.sh</literal>.
20161564 </para>
20171565 <para>
2018− <literal>wrapProgram</literal> is a convenience function you probably
2019− want to use most of the time.
1566+ <literal>wrapProgram</literal> is a convenience function you probably want to use most of the time.
20201567 </para>
20211568 </listitem>
20221569 </varlistentry>
@@ -2026,10 +1573,7 @@ makeWrapper $out/bin/foo $wrapperfile --prefix PATH : ${lib.makeBinPath [ hello
20261573 </term>
20271574 <listitem>
20281575 <para>
2029− Performs string substitution on the contents of
2030− <replaceable>infile</replaceable>, writing the result to
2031− <replaceable>outfile</replaceable>. The substitutions in
2032− <replaceable>subs</replaceable> are of the following form:
1576+ Performs string substitution on the contents of <replaceable>infile</replaceable>, writing the result to <replaceable>outfile</replaceable>. The substitutions in <replaceable>subs</replaceable> are of the following form:
20331577 <variablelist>
20341578 <varlistentry>
20351579 <term>
@@ -2037,8 +1581,7 @@ makeWrapper $out/bin/foo $wrapperfile --prefix PATH : ${lib.makeBinPath [ hello
20371581 </term>
20381582 <listitem>
20391583 <para>
2040− Replace every occurrence of the string <replaceable>s1</replaceable>
2041− by <replaceable>s2</replaceable>.
1584+ Replace every occurrence of the string <replaceable>s1</replaceable> by <replaceable>s2</replaceable>.
20421585 </para>
20431586 </listitem>
20441587 </varlistentry>
@@ -2048,13 +1591,7 @@ makeWrapper $out/bin/foo $wrapperfile --prefix PATH : ${lib.makeBinPath [ hello
20481591 </term>
20491592 <listitem>
20501593 <para>
2051− Replace every occurrence of
2052− <literal>@<replaceable>varName</replaceable>@</literal> by the
2053− contents of the environment variable
2054− <replaceable>varName</replaceable>. This is useful for generating
2055− files from templates, using
2056− <literal>@<replaceable>...</replaceable>@</literal> in the template
2057− as placeholders.
1594+ Replace every occurrence of <literal>@<replaceable>varName</replaceable>@</literal> by the contents of the environment variable <replaceable>varName</replaceable>. This is useful for generating files from templates, using <literal>@<replaceable>...</replaceable>@</literal> in the template as placeholders.
20581595 </para>
20591596 </listitem>
20601597 </varlistentry>
@@ -2064,9 +1601,7 @@ makeWrapper $out/bin/foo $wrapperfile --prefix PATH : ${lib.makeBinPath [ hello
20641601 </term>
20651602 <listitem>
20661603 <para>
2067− Replace every occurrence of
2068− <literal>@<replaceable>varName</replaceable>@</literal> by the string
2069− <replaceable>s</replaceable>.
1604+ Replace every occurrence of <literal>@<replaceable>varName</replaceable>@</literal> by the string <replaceable>s</replaceable>.
20701605 </para>
20711606 </listitem>
20721607 </varlistentry>
@@ -2082,14 +1617,8 @@ substitute ./foo.in ./foo.out \
20821617</programlisting>
20831618 </para>
20841619 <para>
2085− <function>substitute</function> is implemented using the
2086− <command
2087− xlink:href="http://replace.richardlloyd.org.uk/">replace</command>
2088− command. Unlike with the <command>sed</command> command, you don’t have
2089− to worry about escaping special characters. It supports performing
2090− substitutions on binary files (such as executables), though there
2091− you’ll probably want to make sure that the replacement string is as
2092− long as the replaced string.
1620+ <function>substitute</function> is implemented using the <command
1621+ xlink:href="http://replace.richardlloyd.org.uk/">replace</command> command. Unlike with the <command>sed</command> command, you don’t have to worry about escaping special characters. It supports performing substitutions on binary files (such as executables), though there you’ll probably want to make sure that the replacement string is as long as the replaced string.
20931622 </para>
20941623 </listitem>
20951624 </varlistentry>
@@ -2099,8 +1628,7 @@ substitute ./foo.in ./foo.out \
20991628 </term>
21001629 <listitem>
21011630 <para>
2102− Like <function>substitute</function>, but performs the substitutions in
2103− place on the file <replaceable>file</replaceable>.
1631+ Like <function>substitute</function>, but performs the substitutions in place on the file <replaceable>file</replaceable>.
21041632 </para>
21051633 </listitem>
21061634 </varlistentry>
@@ -2110,22 +1638,13 @@ substitute ./foo.in ./foo.out \
21101638 </term>
21111639 <listitem>
21121640 <para>
2113− Replaces every occurrence of
2114− <literal>@<replaceable>varName</replaceable>@</literal>, where
2115− <replaceable>varName</replaceable> is any environment variable, in
2116− <replaceable>infile</replaceable>, writing the result to
2117− <replaceable>outfile</replaceable>. For instance, if
2118− <replaceable>infile</replaceable> has the contents
1641+ Replaces every occurrence of <literal>@<replaceable>varName</replaceable>@</literal>, where <replaceable>varName</replaceable> is any environment variable, in <replaceable>infile</replaceable>, writing the result to <replaceable>outfile</replaceable>. For instance, if <replaceable>infile</replaceable> has the contents
21191642<programlisting>
21201643#! @bash@/bin/sh
21211644PATH=@coreutils@/bin
21221645echo @foo@
21231646</programlisting>
2124− and the environment contains
2125− <literal>bash=/nix/store/bmwp0q28cf21...-bash-3.2-p39</literal> and
2126− <literal>coreutils=/nix/store/68afga4khv0w...-coreutils-6.12</literal>,
2127− but does not contain the variable <varname>foo</varname>, then the output
2128− will be
1647+ and the environment contains <literal>bash=/nix/store/bmwp0q28cf21...-bash-3.2-p39</literal> and <literal>coreutils=/nix/store/68afga4khv0w...-coreutils-6.12</literal>, but does not contain the variable <varname>foo</varname>, then the output will be
21291648<programlisting>
21301649#! /nix/store/bmwp0q28cf21...-bash-3.2-p39/bin/sh
21311650PATH=/nix/store/68afga4khv0w...-coreutils-6.12/bin
@@ -2134,13 +1653,7 @@ echo @foo@
21341653 That is, no substitution is performed for undefined variables.
21351654 </para>
21361655 <para>
2137− Environment variables that start with an uppercase letter or an
2138− underscore are filtered out, to prevent global variables (like
2139− <literal>HOME</literal>) or private variables (like
2140− <literal>__ETC_PROFILE_DONE</literal>) from accidentally getting
2141− substituted. The variables also have to be valid bash “names”, as
2142− defined in the bash manpage (alphanumeric or <literal>_</literal>, must
2143− not start with a number).
1656+ Environment variables that start with an uppercase letter or an underscore are filtered out, to prevent global variables (like <literal>HOME</literal>) or private variables (like <literal>__ETC_PROFILE_DONE</literal>) from accidentally getting substituted. The variables also have to be valid bash “names”, as defined in the bash manpage (alphanumeric or <literal>_</literal>, must not start with a number).
21441657 </para>
21451658 </listitem>
21461659 </varlistentry>
@@ -2150,8 +1663,7 @@ echo @foo@
21501663 </term>
21511664 <listitem>
21521665 <para>
2153− Like <function>substituteAll</function>, but performs the substitutions
2154− in place on the file <replaceable>file</replaceable>.
1666+ Like <function>substituteAll</function>, but performs the substitutions in place on the file <replaceable>file</replaceable>.
21551667 </para>
21561668 </listitem>
21571669 </varlistentry>
@@ -2161,14 +1673,12 @@ echo @foo@
21611673 </term>
21621674 <listitem>
21631675 <para>
2164− Strips the directory and hash part of a store path, outputting the name
2165− part to <literal>stdout</literal>. For example:
1676+ Strips the directory and hash part of a store path, outputting the name part to <literal>stdout</literal>. For example:
21661677<programlisting>
21671678# prints coreutils-8.24
21681679stripHash "/nix/store/9s9r019176g7cvn2nvcw41gsp862y6b4-coreutils-8.24"
21691680</programlisting>
2170− If you wish to store the result in another variable, then the following
2171− idiom may be useful:
1681+ If you wish to store the result in another variable, then the following idiom may be useful:
21721682<programlisting>
21731683name="/nix/store/9s9r019176g7cvn2nvcw41gsp862y6b4-coreutils-8.24"
21741684someVar=$(stripHash $name)
@@ -2182,13 +1692,10 @@ someVar=$(stripHash $name)
21821692 </term>
21831693 <listitem>
21841694 <para>
2185− Convenience function for <literal>makeWrapper</literal> that
2186− automatically creates a sane wrapper file It takes all the same arguments
2187− as <literal>makeWrapper</literal>, except for <literal>--argv0</literal>.
1695+ Convenience function for <literal>makeWrapper</literal> that automatically creates a sane wrapper file It takes all the same arguments as <literal>makeWrapper</literal>, except for <literal>--argv0</literal>.
21881696 </para>
21891697 <para>
2190− It cannot be applied multiple times, since it will overwrite the wrapper
2191− file.
1698+ It cannot be applied multiple times, since it will overwrite the wrapper file.
21921699 </para>
21931700 </listitem>
21941701 </varlistentry>
@@ -2198,85 +1705,34 @@ someVar=$(stripHash $name)
21981705 <title>Package setup hooks</title>
21991706
22001707 <para>
2201− Nix itself considers a build-time dependency as merely something that should
2202− previously be built and accessible at build time—packages themselves are
2203− on their own to perform any additional setup. In most cases, that is fine,
2204− and the downstream derivation can deal with its own dependencies. But for a
2205− few common tasks, that would result in almost every package doing the same
2206− sort of setup work—depending not on the package itself, but entirely on
2207− which dependencies were used.
1708+ Nix itself considers a build-time dependency as merely something that should previously be built and accessible at build time—packages themselves are on their own to perform any additional setup. In most cases, that is fine, and the downstream derivation can deal with its own dependencies. But for a few common tasks, that would result in almost every package doing the same sort of setup work—depending not on the package itself, but entirely on which dependencies were used.
22081709 </para>
22091710
22101711 <para>
2211− In order to alleviate this burden, the <firstterm>setup hook</firstterm>
2212− mechanism was written, where any package can include a shell script that [by
2213− convention rather than enforcement by Nix], any downstream
2214− reverse-dependency will source as part of its build process. That allows the
2215− downstream dependency to merely specify its dependencies, and lets those
2216− dependencies effectively initialize themselves. No boilerplate mirroring the
2217− list of dependencies is needed.
1712+ In order to alleviate this burden, the <firstterm>setup hook</firstterm> mechanism was written, where any package can include a shell script that [by convention rather than enforcement by Nix], any downstream reverse-dependency will source as part of its build process. That allows the downstream dependency to merely specify its dependencies, and lets those dependencies effectively initialize themselves. No boilerplate mirroring the list of dependencies is needed.
22181713 </para>
22191714
22201715 <para>
2221− The setup hook mechanism is a bit of a sledgehammer though: a powerful
2222− feature with a broad and indiscriminate area of effect. The combination of
2223− its power and implicit use may be expedient, but isn't without costs. Nix
2224− itself is unchanged, but the spirit of added dependencies being effect-free
2225− is violated even if the letter isn't. For example, if a derivation path is
2226− mentioned more than once, Nix itself doesn't care and simply makes sure the
2227− dependency derivation is already built just the same—depending is just
2228− needing something to exist, and needing is idempotent. However, a dependency
2229− specified twice will have its setup hook run twice, and that could easily
2230− change the build environment (though a well-written setup hook will
2231− therefore strive to be idempotent so this is in fact not observable). More
2232− broadly, setup hooks are anti-modular in that multiple dependencies, whether
2233− the same or different, should not interfere and yet their setup hooks may
2234− well do so.
1716+ The setup hook mechanism is a bit of a sledgehammer though: a powerful feature with a broad and indiscriminate area of effect. The combination of its power and implicit use may be expedient, but isn't without costs. Nix itself is unchanged, but the spirit of added dependencies being effect-free is violated even if the letter isn't. For example, if a derivation path is mentioned more than once, Nix itself doesn't care and simply makes sure the dependency derivation is already built just the same—depending is just needing something to exist, and needing is idempotent. However, a dependency specified twice will have its setup hook run twice, and that could easily change the build environment (though a well-written setup hook will therefore strive to be idempotent so this is in fact not observable). More broadly, setup hooks are anti-modular in that multiple dependencies, whether the same or different, should not interfere and yet their setup hooks may well do so.
22351717 </para>
22361718
22371719 <para>
2238− The most typical use of the setup hook is actually to add other hooks which
2239− are then run (i.e. after all the setup hooks) on each dependency. For
2240− example, the C compiler wrapper's setup hook feeds itself flags for each
2241− dependency that contains relevant libraries and headers. This is done by
2242− defining a bash function, and appending its name to one of
2243− <envar>envBuildBuildHooks</envar>`, <envar>envBuildHostHooks</envar>`,
2244− <envar>envBuildTargetHooks</envar>`, <envar>envHostHostHooks</envar>`,
2245− <envar>envHostTargetHooks</envar>`, or <envar>envTargetTargetHooks</envar>`.
2246− These 6 bash variables correspond to the 6 sorts of dependencies by platform
2247− (there's 12 total but we ignore the propagated/non-propagated axis).
1720+ The most typical use of the setup hook is actually to add other hooks which are then run (i.e. after all the setup hooks) on each dependency. For example, the C compiler wrapper's setup hook feeds itself flags for each dependency that contains relevant libraries and headers. This is done by defining a bash function, and appending its name to one of <envar>envBuildBuildHooks</envar>`, <envar>envBuildHostHooks</envar>`, <envar>envBuildTargetHooks</envar>`, <envar>envHostHostHooks</envar>`, <envar>envHostTargetHooks</envar>`, or <envar>envTargetTargetHooks</envar>`. These 6 bash variables correspond to the 6 sorts of dependencies by platform (there's 12 total but we ignore the propagated/non-propagated axis).
22481721 </para>
22491722
22501723 <para>
2251− Packages adding a hook should not hard code a specific hook, but rather
2252− choose a variable <emphasis>relative</emphasis> to how they are included.
2253− Returning to the C compiler wrapper example, if the wrapper itself is an
2254− <literal>n</literal> dependency, then it only wants to accumulate flags from
2255− <literal>n + 1</literal> dependencies, as only those ones match the
2256− compiler's target platform. The <envar>hostOffset</envar> variable is
2257− defined with the current dependency's host offset
2258− <envar>targetOffset</envar> with its target offset, before its setup hook is
2259− sourced. Additionally, since most environment hooks don't care about the
2260− target platform, that means the setup hook can append to the right bash
2261− array by doing something like
1724+ Packages adding a hook should not hard code a specific hook, but rather choose a variable <emphasis>relative</emphasis> to how they are included. Returning to the C compiler wrapper example, if the wrapper itself is an <literal>n</literal> dependency, then it only wants to accumulate flags from <literal>n + 1</literal> dependencies, as only those ones match the compiler's target platform. The <envar>hostOffset</envar> variable is defined with the current dependency's host offset <envar>targetOffset</envar> with its target offset, before its setup hook is sourced. Additionally, since most environment hooks don't care about the target platform, that means the setup hook can append to the right bash array by doing something like
22621725<programlisting language="bash">
22631726addEnvHooks "$hostOffset" myBashFunction
22641727</programlisting>
22651728 </para>
22661729
22671730 <para>
2268− The <emphasis>existence</emphasis> of setups hooks has long been documented
2269− and packages inside Nixpkgs are free to use this mechanism. Other packages,
2270− however, should not rely on these mechanisms not changing between Nixpkgs
2271− versions. Because of the existing issues with this system, there's little
2272− benefit from mandating it be stable for any period of time.
1731+ The <emphasis>existence</emphasis> of setups hooks has long been documented and packages inside Nixpkgs are free to use this mechanism. Other packages, however, should not rely on these mechanisms not changing between Nixpkgs versions. Because of the existing issues with this system, there's little benefit from mandating it be stable for any period of time.
22731732 </para>
22741733
22751734 <para>
2276− First, let’s cover some setup hooks that are part of Nixpkgs default
2277− stdenv. This means that they are run for every package built using
2278− <function>stdenv.mkDerivation</function>. Some of these are platform
2279− specific, so they may run on Linux but not Darwin or vice-versa.
1735+ First, let’s cover some setup hooks that are part of Nixpkgs default stdenv. This means that they are run for every package built using <function>stdenv.mkDerivation</function>. Some of these are platform specific, so they may run on Linux but not Darwin or vice-versa.
22801736 <variablelist>
22811737 <varlistentry>
22821738 <term>
@@ -2284,10 +1740,7 @@ addEnvHooks "$hostOffset" myBashFunction
22841740 </term>
22851741 <listitem>
22861742 <para>
2287− This setup hook moves any installed documentation to the
2288− <literal>/share</literal> subdirectory directory. This includes the man,
2289− doc and info directories. This is needed for legacy programs that do not
2290− know how to use the <literal>share</literal> subdirectory.
1743+ This setup hook moves any installed documentation to the <literal>/share</literal> subdirectory directory. This includes the man, doc and info directories. This is needed for legacy programs that do not know how to use the <literal>share</literal> subdirectory.
22911744 </para>
22921745 </listitem>
22931746 </varlistentry>
@@ -2297,9 +1750,7 @@ addEnvHooks "$hostOffset" myBashFunction
22971750 </term>
22981751 <listitem>
22991752 <para>
2300− This setup hook compresses any man pages that have been installed. The
2301− compression is done using the gzip program. This helps to reduce the
2302− installed size of packages.
1753+ This setup hook compresses any man pages that have been installed. The compression is done using the gzip program. This helps to reduce the installed size of packages.
23031754 </para>
23041755 </listitem>
23051756 </varlistentry>
@@ -2309,9 +1760,7 @@ addEnvHooks "$hostOffset" myBashFunction
23091760 </term>
23101761 <listitem>
23111762 <para>
2312− This runs the strip command on installed binaries and libraries. This
2313− removes unnecessary information like debug symbols when they are not
2314− needed. This also helps to reduce the installed size of packages.
1763+ This runs the strip command on installed binaries and libraries. This removes unnecessary information like debug symbols when they are not needed. This also helps to reduce the installed size of packages.
23151764 </para>
23161765 </listitem>
23171766 </varlistentry>
@@ -2321,12 +1770,7 @@ addEnvHooks "$hostOffset" myBashFunction
23211770 </term>
23221771 <listitem>
23231772 <para>
2324− This setup hook patches installed scripts to use the full path to the
2325− shebang interpreter. A shebang interpreter is the first commented line
2326− of a script telling the operating system which program will run the
2327− script (e.g <literal>#!/bin/bash</literal>). In Nix, we want an exact
2328− path to that interpreter to be used. This often replaces
2329− <literal>/bin/sh</literal> with a path in the Nix store.
1773+ This setup hook patches installed scripts to use the full path to the shebang interpreter. A shebang interpreter is the first commented line of a script telling the operating system which program will run the script (e.g <literal>#!/bin/bash</literal>). In Nix, we want an exact path to that interpreter to be used. This often replaces <literal>/bin/sh</literal> with a path in the Nix store.
23301774 </para>
23311775 </listitem>
23321776 </varlistentry>
@@ -2336,10 +1780,7 @@ addEnvHooks "$hostOffset" myBashFunction
23361780 </term>
23371781 <listitem>
23381782 <para>
2339− This verifies that no references are left from the install binaries to
2340− the directory used to build those binaries. This ensures that the
2341− binaries do not need things outside the Nix store. This is currently
2342− supported in Linux only.
1783+ This verifies that no references are left from the install binaries to the directory used to build those binaries. This ensures that the binaries do not need things outside the Nix store. This is currently supported in Linux only.
23431784 </para>
23441785 </listitem>
23451786 </varlistentry>
@@ -2349,12 +1790,7 @@ addEnvHooks "$hostOffset" myBashFunction
23491790 </term>
23501791 <listitem>
23511792 <para>
2352− This setup hook adds configure flags that tell packages to install files
2353− into any one of the proper outputs listed in <literal>outputs</literal>.
2354− This behavior can be turned off by setting
2355− <literal>setOutputFlags</literal> to false in the derivation
2356− environment. See <xref linkend="chap-multiple-output"/> for more
2357− information.
1793+ This setup hook adds configure flags that tell packages to install files into any one of the proper outputs listed in <literal>outputs</literal>. This behavior can be turned off by setting <literal>setOutputFlags</literal> to false in the derivation environment. See <xref linkend="chap-multiple-output"/> for more information.
23581794 </para>
23591795 </listitem>
23601796 </varlistentry>
@@ -2364,9 +1800,7 @@ addEnvHooks "$hostOffset" myBashFunction
23641800 </term>
23651801 <listitem>
23661802 <para>
2367− This setup hook moves any binaries installed in the sbin subdirectory
2368− into bin. In addition, a link is provided from sbin to bin for
2369− compatibility.
1803+ This setup hook moves any binaries installed in the sbin subdirectory into bin. In addition, a link is provided from sbin to bin for compatibility.
23701804 </para>
23711805 </listitem>
23721806 </varlistentry>
@@ -2376,9 +1810,7 @@ addEnvHooks "$hostOffset" myBashFunction
23761810 </term>
23771811 <listitem>
23781812 <para>
2379− This setup hook moves any libraries installed in the lib64 subdirectory
2380− into lib. In addition, a link is provided from lib64 to lib for
2381− compatibility.
1813+ This setup hook moves any libraries installed in the lib64 subdirectory into lib. In addition, a link is provided from lib64 to lib for compatibility.
23821814 </para>
23831815 </listitem>
23841816 </varlistentry>
@@ -2388,8 +1820,7 @@ addEnvHooks "$hostOffset" myBashFunction
23881820 </term>
23891821 <listitem>
23901822 <para>
2391− This sets <literal>SOURCE_DATE_EPOCH</literal> to the modification time
2392− of the most recent file.
1823+ This sets <literal>SOURCE_DATE_EPOCH</literal> to the modification time of the most recent file.
23931824 </para>
23941825 </listitem>
23951826 </varlistentry>
@@ -2399,70 +1830,22 @@ addEnvHooks "$hostOffset" myBashFunction
23991830 </term>
24001831 <listitem>
24011832 <para>
2402− The Bintools Wrapper wraps the binary utilities for a bunch of
2403− miscellaneous purposes. These are GNU Binutils when targetting Linux,
2404− and a mix of cctools and GNU binutils for Darwin. [The "Bintools" name
2405− is supposed to be a compromise between "Binutils" and "cctools" not
2406− denoting any specific implementation.] Specifically, the underlying
2407− bintools package, and a C standard library (glibc or Darwin's libSystem,
2408− just for the dynamic loader) are all fed in, and dependency finding,
2409− hardening (see below), and purity checks for each are handled by the
2410− Bintools Wrapper. Packages typically depend on CC Wrapper, which in turn
2411− (at run time) depends on the Bintools Wrapper.
2412− </para>
2413− <para>
2414− The Bintools Wrapper was only just recently split off from CC Wrapper,
2415− so the division of labor is still being worked out. For example, it
2416− shouldn't care about the C standard library, but just take a derivation
2417− with the dynamic loader (which happens to be the glibc on linux).
2418− Dependency finding however is a task both wrappers will continue to need
2419− to share, and probably the most important to understand. It is currently
2420− accomplished by collecting directories of host-platform dependencies
2421− (i.e. <varname>buildInputs</varname> and
2422− <varname>nativeBuildInputs</varname>) in environment variables. The
2423− Bintools Wrapper's setup hook causes any <filename>lib</filename> and
2424− <filename>lib64</filename> subdirectories to be added to
2425− <envar>NIX_LDFLAGS</envar>. Since the CC Wrapper and the Bintools
2426− Wrapper use the same strategy, most of the Bintools Wrapper code is
2427− sparsely commented and refers to the CC Wrapper. But the CC Wrapper's
2428− code, by contrast, has quite lengthy comments. The Bintools Wrapper
2429− merely cites those, rather than repeating them, to avoid falling out of
2430− sync.
2431− </para>
2432− <para>
2433− A final task of the setup hook is defining a number of standard
2434− environment variables to tell build systems which executables fulfill
2435− which purpose. They are defined to just be the base name of the tools,
2436− under the assumption that the Bintools Wrapper's binaries will be on the
2437− path. Firstly, this helps poorly-written packages, e.g. ones that look
2438− for just <command>gcc</command> when <envar>CC</envar> isn't defined yet
2439− <command>clang</command> is to be used. Secondly, this helps packages
2440− not get confused when cross-compiling, in which case multiple Bintools
2441− Wrappers may simultaneously be in use.
1833+ The Bintools Wrapper wraps the binary utilities for a bunch of miscellaneous purposes. These are GNU Binutils when targetting Linux, and a mix of cctools and GNU binutils for Darwin. [The "Bintools" name is supposed to be a compromise between "Binutils" and "cctools" not denoting any specific implementation.] Specifically, the underlying bintools package, and a C standard library (glibc or Darwin's libSystem, just for the dynamic loader) are all fed in, and dependency finding, hardening (see below), and purity checks for each are handled by the Bintools Wrapper. Packages typically depend on CC Wrapper, which in turn (at run time) depends on the Bintools Wrapper.
1834+ </para>
1835+ <para>
1836+ The Bintools Wrapper was only just recently split off from CC Wrapper, so the division of labor is still being worked out. For example, it shouldn't care about the C standard library, but just take a derivation with the dynamic loader (which happens to be the glibc on linux). Dependency finding however is a task both wrappers will continue to need to share, and probably the most important to understand. It is currently accomplished by collecting directories of host-platform dependencies (i.e. <varname>buildInputs</varname> and <varname>nativeBuildInputs</varname>) in environment variables. The Bintools Wrapper's setup hook causes any <filename>lib</filename> and <filename>lib64</filename> subdirectories to be added to <envar>NIX_LDFLAGS</envar>. Since the CC Wrapper and the Bintools Wrapper use the same strategy, most of the Bintools Wrapper code is sparsely commented and refers to the CC Wrapper. But the CC Wrapper's code, by contrast, has quite lengthy comments. The Bintools Wrapper merely cites those, rather than repeating them, to avoid falling out of sync.
1837+ </para>
1838+ <para>
1839+ A final task of the setup hook is defining a number of standard environment variables to tell build systems which executables fulfill which purpose. They are defined to just be the base name of the tools, under the assumption that the Bintools Wrapper's binaries will be on the path. Firstly, this helps poorly-written packages, e.g. ones that look for just <command>gcc</command> when <envar>CC</envar> isn't defined yet <command>clang</command> is to be used. Secondly, this helps packages not get confused when cross-compiling, in which case multiple Bintools Wrappers may simultaneously be in use.
24421840 <footnote xml:id="footnote-stdenv-per-platform-wrapper">
24431841 <para>
2444− Each wrapper targets a single platform, so if binaries for multiple
2445− platforms are needed, the underlying binaries must be wrapped multiple
2446− times. As this is a property of the wrapper itself, the multiple
2447− wrappings are needed whether or not the same underlying binaries can
2448− target multiple platforms.
1842+ Each wrapper targets a single platform, so if binaries for multiple platforms are needed, the underlying binaries must be wrapped multiple times. As this is a property of the wrapper itself, the multiple wrappings are needed whether or not the same underlying binaries can target multiple platforms.
24491843 </para>
24501844 </footnote>
2451− <envar>BUILD_</envar>- and <envar>TARGET_</envar>-prefixed versions of
2452− the normal environment variable are defined for additional Bintools
2453− Wrappers, properly disambiguating them.
1845+ <envar>BUILD_</envar>- and <envar>TARGET_</envar>-prefixed versions of the normal environment variable are defined for additional Bintools Wrappers, properly disambiguating them.
24541846 </para>
24551847 <para>
2456− A problem with this final task is that the Bintools Wrapper is honest
2457− and defines <envar>LD</envar> as <command>ld</command>. Most packages,
2458− however, firstly use the C compiler for linking, secondly use
2459− <envar>LD</envar> anyways, defining it as the C compiler, and thirdly,
2460− only so define <envar>LD</envar> when it is undefined as a fallback.
2461− This triple-threat means Bintools Wrapper will break those packages, as
2462− LD is already defined as the actual linker which the package won't
2463− override yet doesn't want to use. The workaround is to define, just for
2464− the problematic package, <envar>LD</envar> as the C compiler. A good way
2465− to do this would be <command>preConfigure = "LD=$CC"</command>.
1848+ A problem with this final task is that the Bintools Wrapper is honest and defines <envar>LD</envar> as <command>ld</command>. Most packages, however, firstly use the C compiler for linking, secondly use <envar>LD</envar> anyways, defining it as the C compiler, and thirdly, only so define <envar>LD</envar> when it is undefined as a fallback. This triple-threat means Bintools Wrapper will break those packages, as LD is already defined as the actual linker which the package won't override yet doesn't want to use. The workaround is to define, just for the problematic package, <envar>LD</envar> as the C compiler. A good way to do this would be <command>preConfigure = "LD=$CC"</command>.
24661849 </para>
24671850 </listitem>
24681851 </varlistentry>
@@ -2472,31 +1855,13 @@ addEnvHooks "$hostOffset" myBashFunction
24721855 </term>
24731856 <listitem>
24741857 <para>
2475− The CC Wrapper wraps a C toolchain for a bunch of miscellaneous
2476− purposes. Specifically, a C compiler (GCC or Clang), wrapped binary
2477− tools, and a C standard library (glibc or Darwin's libSystem, just for
2478− the dynamic loader) are all fed in, and dependency finding, hardening
2479− (see below), and purity checks for each are handled by the CC Wrapper.
2480− Packages typically depend on the CC Wrapper, which in turn (at run-time)
2481− depends on the Bintools Wrapper.
1858+ The CC Wrapper wraps a C toolchain for a bunch of miscellaneous purposes. Specifically, a C compiler (GCC or Clang), wrapped binary tools, and a C standard library (glibc or Darwin's libSystem, just for the dynamic loader) are all fed in, and dependency finding, hardening (see below), and purity checks for each are handled by the CC Wrapper. Packages typically depend on the CC Wrapper, which in turn (at run-time) depends on the Bintools Wrapper.
24821859 </para>
24831860 <para>
2484− Dependency finding is undoubtedly the main task of the CC Wrapper. This
2485− works just like the Bintools Wrapper, except that any
2486− <filename>include</filename> subdirectory of any relevant dependency is
2487− added to <envar>NIX_CFLAGS_COMPILE</envar>. The setup hook itself
2488− contains some lengthy comments describing the exact convoluted mechanism
2489− by which this is accomplished.
1861+ Dependency finding is undoubtedly the main task of the CC Wrapper. This works just like the Bintools Wrapper, except that any <filename>include</filename> subdirectory of any relevant dependency is added to <envar>NIX_CFLAGS_COMPILE</envar>. The setup hook itself contains some lengthy comments describing the exact convoluted mechanism by which this is accomplished.
24901862 </para>
24911863 <para>
2492− Similarly, the CC Wrapper follows the Bintools Wrapper in defining
2493− standard environment variables with the names of the tools it wraps, for
2494− the same reasons described above. Importantly, while it includes a
2495− <command>cc</command> symlink to the c compiler for portability, the
2496− <envar>CC</envar> will be defined using the compiler's "real name" (i.e.
2497− <command>gcc</command> or <command>clang</command>). This helps lousy
2498− build systems that inspect on the name of the compiler rather than run
2499− it.
1864+ Similarly, the CC Wrapper follows the Bintools Wrapper in defining standard environment variables with the names of the tools it wraps, for the same reasons described above. Importantly, while it includes a <command>cc</command> symlink to the c compiler for portability, the <envar>CC</envar> will be defined using the compiler's "real name" (i.e. <command>gcc</command> or <command>clang</command>). This helps lousy build systems that inspect on the name of the compiler rather than run it.
25001865 </para>
25011866 </listitem>
25021867 </varlistentry>
@@ -2504,9 +1869,7 @@ addEnvHooks "$hostOffset" myBashFunction
25041869 </para>
25051870
25061871 <para>
2507− Here are some more packages that provide a setup hook. Since the list of
2508− hooks is extensible, this is not an exhaustive list the mechanism is only to
2509− be used as a last resort, it might cover most uses.
1872+ Here are some more packages that provide a setup hook. Since the list of hooks is extensible, this is not an exhaustive list the mechanism is only to be used as a last resort, it might cover most uses.
25101873 <variablelist>
25111874 <varlistentry>
25121875 <term>
@@ -2514,11 +1877,7 @@ addEnvHooks "$hostOffset" myBashFunction
25141877 </term>
25151878 <listitem>
25161879 <para>
2517− Adds the <filename>lib/site_perl</filename> subdirectory of each build
2518− input to the <envar>PERL5LIB</envar> environment variable. For instance,
2519− if <varname>buildInputs</varname> contains Perl, then the
2520− <filename>lib/site_perl</filename> subdirectory of each input is added
2521− to the <envar>PERL5LIB</envar> environment variable.
1880+ Adds the <filename>lib/site_perl</filename> subdirectory of each build input to the <envar>PERL5LIB</envar> environment variable. For instance, if <varname>buildInputs</varname> contains Perl, then the <filename>lib/site_perl</filename> subdirectory of each input is added to the <envar>PERL5LIB</envar> environment variable.
25221881 </para>
25231882 </listitem>
25241883 </varlistentry>
@@ -2528,9 +1887,7 @@ addEnvHooks "$hostOffset" myBashFunction
25281887 </term>
25291888 <listitem>
25301889 <para>
2531− Adds the <filename>lib/${python.libPrefix}/site-packages</filename>
2532− subdirectory of each build input to the <envar>PYTHONPATH</envar>
2533− environment variable.
1890+ Adds the <filename>lib/${python.libPrefix}/site-packages</filename> subdirectory of each build input to the <envar>PYTHONPATH</envar> environment variable.
25341891 </para>
25351892 </listitem>
25361893 </varlistentry>
@@ -2540,9 +1897,7 @@ addEnvHooks "$hostOffset" myBashFunction
25401897 </term>
25411898 <listitem>
25421899 <para>
2543− Adds the <filename>lib/pkgconfig</filename> and
2544− <filename>share/pkgconfig</filename> subdirectories of each build input
2545− to the <envar>PKG_CONFIG_PATH</envar> environment variable.
1900+ Adds the <filename>lib/pkgconfig</filename> and <filename>share/pkgconfig</filename> subdirectories of each build input to the <envar>PKG_CONFIG_PATH</envar> environment variable.
25461901 </para>
25471902 </listitem>
25481903 </varlistentry>
@@ -2552,8 +1907,7 @@ addEnvHooks "$hostOffset" myBashFunction
25521907 </term>
25531908 <listitem>
25541909 <para>
2555− Adds the <filename>share/aclocal</filename> subdirectory of each build
2556− input to the <envar>ACLOCAL_PATH</envar> environment variable.
1910+ Adds the <filename>share/aclocal</filename> subdirectory of each build input to the <envar>ACLOCAL_PATH</envar> environment variable.
25571911 </para>
25581912 </listitem>
25591913 </varlistentry>
@@ -2563,12 +1917,7 @@ addEnvHooks "$hostOffset" myBashFunction
25631917 </term>
25641918 <listitem>
25651919 <para>
2566− The <varname>autoreconfHook</varname> derivation adds
2567− <varname>autoreconfPhase</varname>, which runs autoreconf, libtoolize
2568− and automake, essentially preparing the configure script in
2569− autotools-based builds. Most autotools-based packages come with the
2570− configure script pre-generated, but this hook is necessary for a few
2571− packages and when you need to patch the package’s configure scripts.
1920+ The <varname>autoreconfHook</varname> derivation adds <varname>autoreconfPhase</varname>, which runs autoreconf, libtoolize and automake, essentially preparing the configure script in autotools-based builds. Most autotools-based packages come with the configure script pre-generated, but this hook is necessary for a few packages and when you need to patch the package’s configure scripts.
25721921 </para>
25731922 </listitem>
25741923 </varlistentry>
@@ -2578,10 +1927,7 @@ addEnvHooks "$hostOffset" myBashFunction
25781927 </term>
25791928 <listitem>
25801929 <para>
2581− Adds every file named <filename>catalog.xml</filename> found under the
2582− <filename>xml/dtd</filename> and <filename>xml/xsl</filename>
2583− subdirectories of each build input to the
2584− <envar>XML_CATALOG_FILES</envar> environment variable.
1930+ Adds every file named <filename>catalog.xml</filename> found under the <filename>xml/dtd</filename> and <filename>xml/xsl</filename> subdirectories of each build input to the <envar>XML_CATALOG_FILES</envar> environment variable.
25851931 </para>
25861932 </listitem>
25871933 </varlistentry>
@@ -2591,8 +1937,7 @@ addEnvHooks "$hostOffset" myBashFunction
25911937 </term>
25921938 <listitem>
25931939 <para>
2594− Adds the <filename>share/texmf-nix</filename> subdirectory of each build
2595− input to the <envar>TEXINPUTS</envar> environment variable.
1940+ Adds the <filename>share/texmf-nix</filename> subdirectory of each build input to the <envar>TEXINPUTS</envar> environment variable.
25961941 </para>
25971942 </listitem>
25981943 </varlistentry>
@@ -2612,9 +1957,7 @@ addEnvHooks "$hostOffset" myBashFunction
26121957 </term>
26131958 <listitem>
26141959 <para>
2615− Exports <envar>GDK_PIXBUF_MODULE_FILE</envar> environment variable to
2616− the builder. Add librsvg package to <varname>buildInputs</varname> to
2617− get svg support.
1960+ Exports <envar>GDK_PIXBUF_MODULE_FILE</envar> environment variable to the builder. Add librsvg package to <varname>buildInputs</varname> to get svg support.
26181961 </para>
26191962 </listitem>
26201963 </varlistentry>
@@ -2624,8 +1967,7 @@ addEnvHooks "$hostOffset" myBashFunction
26241967 </term>
26251968 <listitem>
26261969 <para>
2627− Creates a temporary package database and registers every Haskell build
2628− input in it (TODO: how?).
1970+ Creates a temporary package database and registers every Haskell build input in it (TODO: how?).
26291971 </para>
26301972 </listitem>
26311973 </varlistentry>
@@ -2635,8 +1977,7 @@ addEnvHooks "$hostOffset" myBashFunction
26351977 </term>
26361978 <listitem>
26371979 <para>
2638− Hooks related to GNOME platform and related libraries like GLib, GTK and
2639− GStreamer are described in <xref linkend="sec-language-gnome" />.
1980+ Hooks related to GNOME platform and related libraries like GLib, GTK and GStreamer are described in <xref linkend="sec-language-gnome" />.
26401981 </para>
26411982 </listitem>
26421983 </varlistentry>
@@ -2646,15 +1987,10 @@ addEnvHooks "$hostOffset" myBashFunction
26461987 </term>
26471988 <listitem>
26481989 <para>
2649− This is a special setup hook which helps in packaging proprietary
2650− software in that it automatically tries to find missing shared library
2651− dependencies of ELF files based on the given
2652− <varname>buildInputs</varname> and <varname>nativeBuildInputs</varname>.
1990+ This is a special setup hook which helps in packaging proprietary software in that it automatically tries to find missing shared library dependencies of ELF files based on the given <varname>buildInputs</varname> and <varname>nativeBuildInputs</varname>.
26531991 </para>
26541992 <para>
2655− You can also specify a <envar>runtimeDependencies</envar> environment
2656− variable which lists dependencies that are unconditionally added to all
2657− executables.
1993+ You can also specify a <envar>runtimeDependencies</envar> environment variable which lists dependencies that are unconditionally added to all executables.
26581994 </para>
26591995 <para>
26601996 This is useful for programs that use <citerefentry>
@@ -2662,16 +1998,10 @@ addEnvHooks "$hostOffset" myBashFunction
26621998 <manvolnum>3</manvolnum> </citerefentry> to load libraries at runtime.
26631999 </para>
26642000 <para>
2665− In certain situations you may want to run the main command
2666− (<command>autoPatchelf</command>) of the setup hook on a file or a set
2667− of directories instead of unconditionally patching all outputs. This can
2668− be done by setting the <envar>dontAutoPatchelf</envar> environment
2669− variable to a non-empty value.
2001+ In certain situations you may want to run the main command (<command>autoPatchelf</command>) of the setup hook on a file or a set of directories instead of unconditionally patching all outputs. This can be done by setting the <envar>dontAutoPatchelf</envar> environment variable to a non-empty value.
26702002 </para>
26712003 <para>
2672− The <command>autoPatchelf</command> command also recognizes a
2673− <parameter class="command">--no-recurse</parameter> command line flag,
2674− which prevents it from recursing into subdirectories.
2004+ The <command>autoPatchelf</command> command also recognizes a <parameter class="command">--no-recurse</parameter> command line flag, which prevents it from recursing into subdirectories.
26752005 </para>
26762006 </listitem>
26772007 </varlistentry>
@@ -2681,36 +2011,16 @@ addEnvHooks "$hostOffset" myBashFunction
26812011 </term>
26822012 <listitem>
26832013 <para>
2684− This hook will make a build pause instead of stopping when a failure
2685− happens. It prevents nix from cleaning up the build environment
2686− immediately and allows the user to attach to a build environment using
2687− the <command>cntr</command> command. Upon build error it will print
2688− instructions on how to use <command>cntr</command>, which can be used to
2689− enter the environment for debugging. Installing cntr and running the
2690− command will provide shell access to the build sandbox of failed build.
2691− At <filename>/var/lib/cntr</filename> the sandboxed filesystem is
2692− mounted. All commands and files of the system are still accessible
2693− within the shell. To execute commands from the sandbox use the cntr exec
2694− subcommand. <command>cntr</command> is only supported on Linux-based
2695− platforms. To use it first add <literal>cntr</literal> to your
2696− <literal>environment.systemPackages</literal> on NixOS or alternatively
2697− to the root user on non-NixOS systems. Then in the package that is
2698− supposed to be inspected, add <literal>breakpointHook</literal> to
2699− <literal>nativeBuildInputs</literal>.
2014+ This hook will make a build pause instead of stopping when a failure happens. It prevents nix from cleaning up the build environment immediately and allows the user to attach to a build environment using the <command>cntr</command> command. Upon build error it will print instructions on how to use <command>cntr</command>, which can be used to enter the environment for debugging. Installing cntr and running the command will provide shell access to the build sandbox of failed build. At <filename>/var/lib/cntr</filename> the sandboxed filesystem is mounted. All commands and files of the system are still accessible within the shell. To execute commands from the sandbox use the cntr exec subcommand. <command>cntr</command> is only supported on Linux-based platforms. To use it first add <literal>cntr</literal> to your <literal>environment.systemPackages</literal> on NixOS or alternatively to the root user on non-NixOS systems. Then in the package that is supposed to be inspected, add <literal>breakpointHook</literal> to <literal>nativeBuildInputs</literal>.
27002015<programlisting>
27012016nativeBuildInputs = [ breakpointHook ];
27022017</programlisting>
2703− When a build failure happens there will be an instruction printed that
2704− shows how to attach with <literal>cntr</literal> to the build sandbox.
2018+ When a build failure happens there will be an instruction printed that shows how to attach with <literal>cntr</literal> to the build sandbox.
27052019 </para>
27062020 <note>
27072021 <title>Caution with remote builds</title>
27082022 <para>
2709− This won't work with remote builds as the build environment is on a
2710− different machine and can't be accessed by <command>cntr</command>.
2711− Remote builds can be turned off by setting <literal>--option builders
2712− ''</literal> for <command>nix-build</command> or <literal>--builders
2713− ''</literal> for <command>nix build</command>.
2023+ This won't work with remote builds as the build environment is on a different machine and can't be accessed by <command>cntr</command>. Remote builds can be turned off by setting <literal>--option builders ''</literal> for <command>nix-build</command> or <literal>--builders ''</literal> for <command>nix build</command>.
27142024 </para>
27152025 </note>
27162026 </listitem>
@@ -2721,28 +2031,13 @@ nativeBuildInputs = [ breakpointHook ];
27212031 </term>
27222032 <listitem>
27232033 <para>
2724− This hook helps with installing manpages and shell completion files. It
2725− exposes 2 shell functions <literal>installManPage</literal> and
2726− <literal>installShellCompletion</literal> that can be used from your
2727− <literal>postInstall</literal> hook.
2034+ This hook helps with installing manpages and shell completion files. It exposes 2 shell functions <literal>installManPage</literal> and <literal>installShellCompletion</literal> that can be used from your <literal>postInstall</literal> hook.
27282035 </para>
27292036 <para>
2730− The <literal>installManPage</literal> function takes one or more paths
2731− to manpages to install. The manpages must have a section suffix, and may
2732− optionally be compressed (with <literal>.gz</literal> suffix). This
2733− function will place them into the correct directory.
2037+ The <literal>installManPage</literal> function takes one or more paths to manpages to install. The manpages must have a section suffix, and may optionally be compressed (with <literal>.gz</literal> suffix). This function will place them into the correct directory.
27342038 </para>
27352039 <para>
2736− The <literal>installShellCompletion</literal> function takes one or more
2737− paths to shell completion files. By default it will autodetect the shell
2738− type from the completion file extension, but you may also specify it by
2739− passing one of <literal>--bash</literal>, <literal>--fish</literal>, or
2740− <literal>--zsh</literal>. These flags apply to all paths listed after
2741− them (up until another shell flag is given). Each path may also have a
2742− custom installation name provided by providing a flag <literal>--name
2743− NAME</literal> before the path. If this flag is not provided, zsh
2744− completions will be renamed automatically such that
2745− <literal>foobar.zsh</literal> becomes <literal>_foobar</literal>.
2040+ The <literal>installShellCompletion</literal> function takes one or more paths to shell completion files. By default it will autodetect the shell type from the completion file extension, but you may also specify it by passing one of <literal>--bash</literal>, <literal>--fish</literal>, or <literal>--zsh</literal>. These flags apply to all paths listed after them (up until another shell flag is given). Each path may also have a custom installation name provided by providing a flag <literal>--name NAME</literal> before the path. If this flag is not provided, zsh completions will be renamed automatically such that <literal>foobar.zsh</literal> becomes <literal>_foobar</literal>.
27462041<programlisting>
27472042nativeBuildInputs = [ installShellFiles ];
27482043postInstall = ''
@@ -2764,13 +2059,7 @@ postInstall = ''
27642059 </term>
27652060 <listitem>
27662061 <para>
2767− A few libraries automatically add to <literal>NIX_LDFLAGS</literal>
2768− their library, making their symbols automatically available to the
2769− linker. This includes libiconv and libintl (gettext). This is done to
2770− provide compatibility between GNU Linux, where libiconv and libintl are
2771− bundled in, and other systems where that might not be the case.
2772− Sometimes, this behavior is not desired. To disable this behavior, set
2773− <literal>dontAddExtraLibs</literal>.
2062+ A few libraries automatically add to <literal>NIX_LDFLAGS</literal> their library, making their symbols automatically available to the linker. This includes libiconv and libintl (gettext). This is done to provide compatibility between GNU Linux, where libiconv and libintl are bundled in, and other systems where that might not be the case. Sometimes, this behavior is not desired. To disable this behavior, set <literal>dontAddExtraLibs</literal>.
27742063 </para>
27752064 </listitem>
27762065 </varlistentry>
@@ -2780,16 +2069,7 @@ postInstall = ''
27802069 </term>
27812070 <listitem>
27822071 <para>
2783− Overrides the default configure phase to run the CMake command. By
2784− default, we use the Make generator of CMake. In addition, dependencies
2785− are added automatically to CMAKE_PREFIX_PATH so that packages are
2786− correctly detected by CMake. Some additional flags are passed in to give
2787− similar behavior to configure-based packages. You can disable this
2788− hook’s behavior by setting configurePhase to a custom value, or by
2789− setting dontUseCmakeConfigure. cmakeFlags controls flags passed only to
2790− CMake. By default, parallel building is enabled as CMake supports
2791− parallel building almost everywhere. When Ninja is also in use, CMake
2792− will detect that and use the ninja generator.
2072+ Overrides the default configure phase to run the CMake command. By default, we use the Make generator of CMake. In addition, dependencies are added automatically to CMAKE_PREFIX_PATH so that packages are correctly detected by CMake. Some additional flags are passed in to give similar behavior to configure-based packages. You can disable this hook’s behavior by setting configurePhase to a custom value, or by setting dontUseCmakeConfigure. cmakeFlags controls flags passed only to CMake. By default, parallel building is enabled as CMake supports parallel building almost everywhere. When Ninja is also in use, CMake will detect that and use the ninja generator.
27932073 </para>
27942074 </listitem>
27952075 </varlistentry>
@@ -2799,11 +2079,7 @@ postInstall = ''
27992079 </term>
28002080 <listitem>
28012081 <para>
2802− Overrides the build and install phases to run the “xcbuild” command.
2803− This hook is needed when a project only comes with build files for the
2804− XCode build system. You can disable this behavior by setting buildPhase
2805− and configurePhase to a custom value. xcbuildFlags controls flags passed
2806− only to xcbuild.
2082+ Overrides the build and install phases to run the “xcbuild” command. This hook is needed when a project only comes with build files for the XCode build system. You can disable this behavior by setting buildPhase and configurePhase to a custom value. xcbuildFlags controls flags passed only to xcbuild.
28072083 </para>
28082084 </listitem>
28092085 </varlistentry>
@@ -2813,10 +2089,7 @@ postInstall = ''
28132089 </term>
28142090 <listitem>
28152091 <para>
2816− Overrides the configure phase to run meson to generate Ninja files. To
2817− run these files, you should accompany Meson with ninja. By default,
2818− <varname>enableParallelBuilding</varname> is enabled as Meson supports
2819− parallel building almost everywhere.
2092+ Overrides the configure phase to run meson to generate Ninja files. To run these files, you should accompany Meson with ninja. By default, <varname>enableParallelBuilding</varname> is enabled as Meson supports parallel building almost everywhere.
28202093 </para>
28212094 <variablelist>
28222095 <title>Variables controlling Meson</title>
@@ -2836,10 +2109,8 @@ postInstall = ''
28362109 </term>
28372110 <listitem>
28382111 <para>
2839− Which
2840− <link
2841− xlink:href="https://mesonbuild.com/Builtin-options.html#core-options"><command>--buildtype</command></link>
2842− to pass to Meson. We default to <literal>plain</literal>.
2112+ Which <link
2113+ xlink:href="https://mesonbuild.com/Builtin-options.html#core-options"><command>--buildtype</command></link> to pass to Meson. We default to <literal>plain</literal>.
28432114 </para>
28442115 </listitem>
28452116 </varlistentry>
@@ -2849,10 +2120,8 @@ postInstall = ''
28492120 </term>
28502121 <listitem>
28512122 <para>
2852− What value to set
2853− <link
2854− xlink:href="https://mesonbuild.com/Builtin-options.html#core-options"><command>-Dauto_features=</command></link>
2855− to. We default to <command>enabled</command>.
2123+ What value to set <link
2124+ xlink:href="https://mesonbuild.com/Builtin-options.html#core-options"><command>-Dauto_features=</command></link> to. We default to <command>enabled</command>.
28562125 </para>
28572126 </listitem>
28582127 </varlistentry>
@@ -2862,11 +2131,8 @@ postInstall = ''
28622131 </term>
28632132 <listitem>
28642133 <para>
2865− What value to set
2866− <link
2867− xlink:href="https://mesonbuild.com/Builtin-options.html#core-options"><command>-Dwrap_mode=</command></link>
2868− to. We default to <command>nodownload</command> as we disallow
2869− network access.
2134+ What value to set <link
2135+ xlink:href="https://mesonbuild.com/Builtin-options.html#core-options"><command>-Dwrap_mode=</command></link> to. We default to <command>nodownload</command> as we disallow network access.
28702136 </para>
28712137 </listitem>
28722138 </varlistentry>
@@ -2889,10 +2155,7 @@ postInstall = ''
28892155 </term>
28902156 <listitem>
28912157 <para>
2892− Overrides the build, install, and check phase to run ninja instead of
2893− make. You can disable this behavior with the dontUseNinjaBuild,
2894− dontUseNinjaInstall, and dontUseNinjaCheck, respectively. Parallel
2895− building is enabled by default in Ninja.
2158+ Overrides the build, install, and check phase to run ninja instead of make. You can disable this behavior with the dontUseNinjaBuild, dontUseNinjaInstall, and dontUseNinjaCheck, respectively. Parallel building is enabled by default in Ninja.
28962159 </para>
28972160 </listitem>
28982161 </varlistentry>
@@ -2902,8 +2165,7 @@ postInstall = ''
29022165 </term>
29032166 <listitem>
29042167 <para>
2905− This setup hook will allow you to unzip .zip files specified in $src.
2906− There are many similar packages like unrar, undmg, etc.
2168+ This setup hook will allow you to unzip .zip files specified in $src. There are many similar packages like unrar, undmg, etc.
29072169 </para>
29082170 </listitem>
29092171 </varlistentry>
@@ -2913,10 +2175,7 @@ postInstall = ''
29132175 </term>
29142176 <listitem>
29152177 <para>
2916− Overrides the configure, build, and install phases. This will run the
2917− "waf" script used by many projects. If wafPath (default ./waf) doesn’t
2918− exist, it will copy the version of waf available in Nixpkgs. wafFlags
2919− can be used to pass flags to the waf script.
2178+ Overrides the configure, build, and install phases. This will run the "waf" script used by many projects. If wafPath (default ./waf) doesn’t exist, it will copy the version of waf available in Nixpkgs. wafFlags can be used to pass flags to the waf script.
29202179 </para>
29212180 </listitem>
29222181 </varlistentry>
@@ -2926,9 +2185,7 @@ postInstall = ''
29262185 </term>
29272186 <listitem>
29282187 <para>
2929− Overrides the build, install, and check phases. This uses the scons
2930− build system as a replacement for make. scons does not provide a
2931− configure phase, so everything is managed at build and install time.
2188+ Overrides the build, install, and check phases. This uses the scons build system as a replacement for make. scons does not provide a configure phase, so everything is managed at build and install time.
29322189 </para>
29332190 </listitem>
29342191 </varlistentry>
@@ -2939,40 +2196,26 @@ postInstall = ''
29392196 <title>Purity in Nixpkgs</title>
29402197
29412198 <para>
2942− [measures taken to prevent dependencies on packages outside the store, and
2943− what you can do to prevent them]
2199+ [measures taken to prevent dependencies on packages outside the store, and what you can do to prevent them]
29442200 </para>
29452201
29462202 <para>
2947− GCC doesn't search in locations such as <filename>/usr/include</filename>.
2948− In fact, attempts to add such directories through the <option>-I</option>
2949− flag are filtered out. Likewise, the linker (from GNU binutils) doesn't
2950− search in standard locations such as <filename>/usr/lib</filename>. Programs
2951− built on Linux are linked against a GNU C Library that likewise doesn't
2952− search in the default system locations.
2203+ GCC doesn't search in locations such as <filename>/usr/include</filename>. In fact, attempts to add such directories through the <option>-I</option> flag are filtered out. Likewise, the linker (from GNU binutils) doesn't search in standard locations such as <filename>/usr/lib</filename>. Programs built on Linux are linked against a GNU C Library that likewise doesn't search in the default system locations.
29532204 </para>
29542205 </section>
29552206 <section xml:id="sec-hardening-in-nixpkgs">
29562207 <title>Hardening in Nixpkgs</title>
29572208
29582209 <para>
2959− There are flags available to harden packages at compile or link-time. These
2960− can be toggled using the <varname>stdenv.mkDerivation</varname> parameters
2961− <varname>hardeningDisable</varname> and <varname>hardeningEnable</varname>.
2210+ There are flags available to harden packages at compile or link-time. These can be toggled using the <varname>stdenv.mkDerivation</varname> parameters <varname>hardeningDisable</varname> and <varname>hardeningEnable</varname>.
29622211 </para>
29632212
29642213 <para>
2965− Both parameters take a list of flags as strings. The special
2966− <varname>"all"</varname> flag can be passed to
2967− <varname>hardeningDisable</varname> to turn off all hardening. These flags
2968− can also be used as environment variables for testing or development
2969− purposes.
2214+ Both parameters take a list of flags as strings. The special <varname>"all"</varname> flag can be passed to <varname>hardeningDisable</varname> to turn off all hardening. These flags can also be used as environment variables for testing or development purposes.
29702215 </para>
29712216
29722217 <para>
2973− The following flags are enabled by default and might require disabling with
2974− <varname>hardeningDisable</varname> if the program to package is
2975− incompatible.
2218+ The following flags are enabled by default and might require disabling with <varname>hardeningDisable</varname> if the program to package is incompatible.
29762219 </para>
29772220
29782221 <variablelist>
@@ -2982,13 +2225,7 @@ postInstall = ''
29822225 </term>
29832226 <listitem>
29842227 <para>
2985− Adds the <option>-Wformat -Wformat-security
2986− -Werror=format-security</option> compiler options. At present, this warns
2987− about calls to <varname>printf</varname> and <varname>scanf</varname>
2988− functions where the format string is not a string literal and there are
2989− no format arguments, as in <literal>printf(foo);</literal>. This may be a
2990− security hole if the format string came from untrusted input and contains
2991− <literal>%n</literal>.
2228+ Adds the <option>-Wformat -Wformat-security -Werror=format-security</option> compiler options. At present, this warns about calls to <varname>printf</varname> and <varname>scanf</varname> functions where the format string is not a string literal and there are no format arguments, as in <literal>printf(foo);</literal>. This may be a security hole if the format string came from untrusted input and contains <literal>%n</literal>.
29922229 </para>
29932230 <para>
29942231 This needs to be turned off or fixed for errors similar to:
@@ -3007,12 +2244,7 @@ cc1plus: some warnings being treated as errors
30072244 </term>
30082245 <listitem>
30092246 <para>
3010− Adds the <option>-fstack-protector-strong --param
3011− ssp-buffer-size=4</option> compiler options. This adds safety checks
3012− against stack overwrites rendering many potential code injection attacks
3013− into aborting situations. In the best case this turns code injection
3014− vulnerabilities into denial of service or into non-issues (depending on
3015− the application).
2247+ Adds the <option>-fstack-protector-strong --param ssp-buffer-size=4</option> compiler options. This adds safety checks against stack overwrites rendering many potential code injection attacks into aborting situations. In the best case this turns code injection vulnerabilities into denial of service or into non-issues (depending on the application).
30162248 </para>
30172249 <para>
30182250 This needs to be turned off or fixed for errors similar to:
@@ -3029,19 +2261,10 @@ bin/blib.a(bios_console.o): In function `bios_handle_cup':
30292261 </term>
30302262 <listitem>
30312263 <para>
3032− Adds the <option>-O2 -D_FORTIFY_SOURCE=2</option> compiler options.
3033− During code generation the compiler knows a great deal of information
3034− about buffer sizes (where possible), and attempts to replace insecure
3035− unlimited length buffer function calls with length-limited ones. This is
3036− especially useful for old, crufty code. Additionally, format strings in
3037− writable memory that contain '%n' are blocked. If an application depends
3038− on such a format string, it will need to be worked around.
2264+ Adds the <option>-O2 -D_FORTIFY_SOURCE=2</option> compiler options. During code generation the compiler knows a great deal of information about buffer sizes (where possible), and attempts to replace insecure unlimited length buffer function calls with length-limited ones. This is especially useful for old, crufty code. Additionally, format strings in writable memory that contain '%n' are blocked. If an application depends on such a format string, it will need to be worked around.
30392265 </para>
30402266 <para>
3041− Additionally, some warnings are enabled which might trigger build
3042− failures if compiler warnings are treated as errors in the package build.
3043− In this case, set <option>NIX_CFLAGS_COMPILE</option> to
3044− <option>-Wno-error=warning-type</option>.
2267+ Additionally, some warnings are enabled which might trigger build failures if compiler warnings are treated as errors in the package build. In this case, set <option>NIX_CFLAGS_COMPILE</option> to <option>-Wno-error=warning-type</option>.
30452268 </para>
30462269 <para>
30472270 This needs to be turned off or fixed for errors similar to:
@@ -3070,15 +2293,10 @@ fcntl2.h:50:4: error: call to '__open_missing_mode' declared with attribute erro
30702293 </term>
30712294 <listitem>
30722295 <para>
3073− Adds the <option>-fPIC</option> compiler options. This options adds
3074− support for position independent code in shared libraries and thus making
3075− ASLR possible.
2296+ Adds the <option>-fPIC</option> compiler options. This options adds support for position independent code in shared libraries and thus making ASLR possible.
30762297 </para>
30772298 <para>
3078− Most notably, the Linux kernel, kernel modules and other code not running
3079− in an operating system environment like boot loaders won't build with PIC
3080− enabled. The compiler will is most cases complain that PIC is not
3081− supported for a specific build.
2299+ Most notably, the Linux kernel, kernel modules and other code not running in an operating system environment like boot loaders won't build with PIC enabled. The compiler will is most cases complain that PIC is not supported for a specific build.
30822300 </para>
30832301 <para>
30842302 This needs to be turned off or fixed for assembler errors similar to:
@@ -3095,13 +2313,7 @@ ccbLfRgg.s:33: Error: missing or invalid displacement expression `private_key_le
30952313 </term>
30962314 <listitem>
30972315 <para>
3098− Signed integer overflow is undefined behaviour according to the C
3099− standard. If it happens, it is an error in the program as it should check
3100− for overflow before it can happen, not afterwards. GCC provides built-in
3101− functions to perform arithmetic with overflow checking, which are correct
3102− and faster than any custom implementation. As a workaround, the option
3103− <option>-fno-strict-overflow</option> makes gcc behave as if signed
3104− integer overflows were defined.
2316+ Signed integer overflow is undefined behaviour according to the C standard. If it happens, it is an error in the program as it should check for overflow before it can happen, not afterwards. GCC provides built-in functions to perform arithmetic with overflow checking, which are correct and faster than any custom implementation. As a workaround, the option <option>-fno-strict-overflow</option> makes gcc behave as if signed integer overflows were defined.
31052317 </para>
31062318 <para>
31072319 This flag should not trigger any build or runtime errors.
@@ -3114,18 +2326,10 @@ ccbLfRgg.s:33: Error: missing or invalid displacement expression `private_key_le
31142326 </term>
31152327 <listitem>
31162328 <para>
3117− Adds the <option>-z relro</option> linker option. During program load,
3118− several ELF memory sections need to be written to by the linker, but can
3119− be turned read-only before turning over control to the program. This
3120− prevents some GOT (and .dtors) overwrite attacks, but at least the part
3121− of the GOT used by the dynamic linker (.got.plt) is still vulnerable.
2329+ Adds the <option>-z relro</option> linker option. During program load, several ELF memory sections need to be written to by the linker, but can be turned read-only before turning over control to the program. This prevents some GOT (and .dtors) overwrite attacks, but at least the part of the GOT used by the dynamic linker (.got.plt) is still vulnerable.
31222330 </para>
31232331 <para>
3124− This flag can break dynamic shared object loading. For instance, the
3125− module systems of Xorg and OpenCV are incompatible with this flag. In
3126− almost all cases the <varname>bindnow</varname> flag must also be
3127− disabled and incompatible programs typically fail with similar errors at
3128− runtime.
2332+ This flag can break dynamic shared object loading. For instance, the module systems of Xorg and OpenCV are incompatible with this flag. In almost all cases the <varname>bindnow</varname> flag must also be disabled and incompatible programs typically fail with similar errors at runtime.
31292333 </para>
31302334 </listitem>
31312335 </varlistentry>
@@ -3135,18 +2339,10 @@ ccbLfRgg.s:33: Error: missing or invalid displacement expression `private_key_le
31352339 </term>
31362340 <listitem>
31372341 <para>
3138− Adds the <option>-z bindnow</option> linker option. During program load,
3139− all dynamic symbols are resolved, allowing for the complete GOT to be
3140− marked read-only (due to <varname>relro</varname>). This prevents GOT
3141− overwrite attacks. For very large applications, this can incur some
3142− performance loss during initial load while symbols are resolved, but this
3143− shouldn't be an issue for daemons.
2342+ Adds the <option>-z bindnow</option> linker option. During program load, all dynamic symbols are resolved, allowing for the complete GOT to be marked read-only (due to <varname>relro</varname>). This prevents GOT overwrite attacks. For very large applications, this can incur some performance loss during initial load while symbols are resolved, but this shouldn't be an issue for daemons.
31442343 </para>
31452344 <para>
3146− This flag can break dynamic shared object loading. For instance, the
3147− module systems of Xorg and PHP are incompatible with this flag. Programs
3148− incompatible with this flag often fail at runtime due to missing symbols,
3149− like:
2345+ This flag can break dynamic shared object loading. For instance, the module systems of Xorg and PHP are incompatible with this flag. Programs incompatible with this flag often fail at runtime due to missing symbols, like:
31502346 </para>
31512347<programlisting>
31522348intel_drv.so: undefined symbol: vgaHWFreeHWRec
@@ -3156,9 +2352,7 @@ intel_drv.so: undefined symbol: vgaHWFreeHWRec
31562352 </variablelist>
31572353
31582354 <para>
3159− The following flags are disabled by default and should be enabled with
3160− <varname>hardeningEnable</varname> for packages that take untrusted input
3161− like network services.
2355+ The following flags are disabled by default and should be enabled with <varname>hardeningEnable</varname> for packages that take untrusted input like network services.
31622356 </para>
31632357
31642358 <variablelist>
@@ -3168,31 +2362,14 @@ intel_drv.so: undefined symbol: vgaHWFreeHWRec
31682362 </term>
31692363 <listitem>
31702364 <para>
3171− Adds the <option>-fPIE</option> compiler and <option>-pie</option> linker
3172− options. Position Independent Executables are needed to take advantage of
3173− Address Space Layout Randomization, supported by modern kernel versions.
3174− While ASLR can already be enforced for data areas in the stack and heap
3175− (brk and mmap), the code areas must be compiled as position-independent.
3176− Shared libraries already do this with the <varname>pic</varname> flag, so
3177− they gain ASLR automatically, but binary .text regions need to be build
3178− with <varname>pie</varname> to gain ASLR. When this happens, ROP attacks
3179− are much harder since there are no static locations to bounce off of
3180− during a memory corruption attack.
2365+ Adds the <option>-fPIE</option> compiler and <option>-pie</option> linker options. Position Independent Executables are needed to take advantage of Address Space Layout Randomization, supported by modern kernel versions. While ASLR can already be enforced for data areas in the stack and heap (brk and mmap), the code areas must be compiled as position-independent. Shared libraries already do this with the <varname>pic</varname> flag, so they gain ASLR automatically, but binary .text regions need to be build with <varname>pie</varname> to gain ASLR. When this happens, ROP attacks are much harder since there are no static locations to bounce off of during a memory corruption attack.
31812366 </para>
31822367 </listitem>
31832368 </varlistentry>
31842369 </variablelist>
31852370
31862371 <para>
3187− For more in-depth information on these hardening flags and hardening in
3188− general, refer to the
3189− <link xlink:href="https://wiki.debian.org/Hardening">Debian Wiki</link>,
3190− <link xlink:href="https://wiki.ubuntu.com/Security/Features">Ubuntu
3191− Wiki</link>,
3192− <link xlink:href="https://wiki.gentoo.org/wiki/Project:Hardened">Gentoo
3193− Wiki</link>, and the
3194− <link xlink:href="https://wiki.archlinux.org/index.php/DeveloperWiki:Security">
3195− Arch Wiki</link>.
2372+ For more in-depth information on these hardening flags and hardening in general, refer to the <link xlink:href="https://wiki.debian.org/Hardening">Debian Wiki</link>, <link xlink:href="https://wiki.ubuntu.com/Security/Features">Ubuntu Wiki</link>, <link xlink:href="https://wiki.gentoo.org/wiki/Project:Hardened">Gentoo Wiki</link>, and the <link xlink:href="https://wiki.archlinux.org/index.php/DeveloperWiki:Security"> Arch Wiki</link>.
31962373 </para>
31972374 </section>
31982375</chapter>
doc/submitting-changes.xml+39−132
@@ -8,8 +8,7 @@
88 <itemizedlist>
99 <listitem>
1010 <para>
11− Read <link xlink:href="https://nixos.org/nixpkgs/manual/">Manual (How to
12− write packages for Nix)</link>.
11+ Read <link xlink:href="https://nixos.org/nixpkgs/manual/">Manual (How to write packages for Nix)</link>.
1312 </para>
1413 </listitem>
1514 <listitem>
@@ -23,15 +22,11 @@
2322 <itemizedlist>
2423 <listitem>
2524 <para>
26− You can make branch from a commit of your local
27− <command>nixos-version</command>. That will help you to avoid
28− additional local compilations. Because you will receive packages from
29− binary cache.
25+ You can make branch from a commit of your local <command>nixos-version</command>. That will help you to avoid additional local compilations. Because you will receive packages from binary cache.
3026 <itemizedlist>
3127 <listitem>
3228 <para>
33− For example: <command>nixos-version</command> returns
34− <command>15.05.git.0998212 (Dingo)</command>. So you can do:
29+ For example: <command>nixos-version</command> returns <command>15.05.git.0998212 (Dingo)</command>. So you can do:
3530 </para>
3631 </listitem>
3732 </itemizedlist>
@@ -55,9 +50,7 @@
5550 <itemizedlist>
5651 <listitem>
5752 <para>
58− If you removed pkgs, made some major NixOS changes etc., write about
59− them in
60− <command>nixos/doc/manual/release-notes/rl-unstable.xml</command>.
53+ If you removed pkgs, made some major NixOS changes etc., write about them in <command>nixos/doc/manual/release-notes/rl-unstable.xml</command>.
6154 </para>
6255 </listitem>
6356 </itemizedlist>
@@ -65,8 +58,7 @@
6558 </listitem>
6659 <listitem>
6760 <para>
68− Check for unnecessary whitespace with <command>git diff --check</command>
69− before committing.
61+ Check for unnecessary whitespace with <command>git diff --check</command> before committing.
7062 </para>
7163 </listitem>
7264 <listitem>
@@ -121,8 +113,7 @@ Additional information.
121113 <itemizedlist>
122114 <listitem>
123115 <para>
124− <command>nix-env -i pkg-name -f &lt;path to your local nixpkgs
125− folder&gt;</command>
116+ <command>nix-env -i pkg-name -f &lt;path to your local nixpkgs folder&gt;</command>
126117 </para>
127118 </listitem>
128119 </itemizedlist>
@@ -134,14 +125,12 @@ Additional information.
134125 <itemizedlist>
135126 <listitem>
136127 <para>
137− Make sure it's in
138− <command>pkgs/top-level/all-packages.nix</command>
128+ Make sure it's in <command>pkgs/top-level/all-packages.nix</command>
139129 </para>
140130 </listitem>
141131 <listitem>
142132 <para>
143− <command>nix-env -i pkg-name -f &lt;path to your local nixpkgs
144− folder&gt;</command>
133+ <command>nix-env -i pkg-name -f &lt;path to your local nixpkgs folder&gt;</command>
145134 </para>
146135 </listitem>
147136 </itemizedlist>
@@ -149,15 +138,11 @@ Additional information.
149138 </listitem>
150139 <listitem>
151140 <para>
152− <emphasis>If you don't want to install pkg in you
153− profile</emphasis>.
141+ <emphasis>If you don't want to install pkg in you profile</emphasis>.
154142 <itemizedlist>
155143 <listitem>
156144 <para>
157− <command>nix-build -A pkg-attribute-name &lt;path to your local
158− nixpkgs folder&gt;/default.nix</command> and check results in the
159− folder <command>result</command>. It will appear in the same
160− directory where you did <command>nix-build</command>.
145+ <command>nix-build -A pkg-attribute-name &lt;path to your local nixpkgs folder&gt;/default.nix</command> and check results in the folder <command>result</command>. It will appear in the same directory where you did <command>nix-build</command>.
161146 </para>
162147 </listitem>
163148 </itemizedlist>
@@ -165,9 +150,7 @@ Additional information.
165150 </listitem>
166151 <listitem>
167152 <para>
168− If you did <command>nix-env -i pkg-name</command> you can do
169− <command>nix-env -e pkg-name</command> to uninstall it from your
170− system.
153+ If you did <command>nix-env -i pkg-name</command> you can do <command>nix-env -e pkg-name</command> to uninstall it from your system.
171154 </para>
172155 </listitem>
173156 </itemizedlist>
@@ -179,10 +162,7 @@ Additional information.
179162 <itemizedlist>
180163 <listitem>
181164 <para>
182− You can add new module to your NixOS configuration file (usually
183− it's <command>/etc/nixos/configuration.nix</command>). And do
184− <command>sudo nixos-rebuild test -I nixpkgs=&lt;path to your local
185− nixpkgs folder&gt; --fast</command>.
165+ You can add new module to your NixOS configuration file (usually it's <command>/etc/nixos/configuration.nix</command>). And do <command>sudo nixos-rebuild test -I nixpkgs=&lt;path to your local nixpkgs folder&gt; --fast</command>.
186166 </para>
187167 </listitem>
188168 </itemizedlist>
@@ -193,9 +173,7 @@ Additional information.
193173 </listitem>
194174 <listitem>
195175 <para>
196− If you have commits <command>pkg-name: oh, forgot to insert
197− whitespace</command>: squash commits in this case. Use <command>git rebase
198− -i</command>.
176+ If you have commits <command>pkg-name: oh, forgot to insert whitespace</command>: squash commits in this case. Use <command>git rebase -i</command>.
199177 </para>
200178 </listitem>
201179 <listitem>
@@ -220,8 +198,7 @@ Additional information.
220198 <itemizedlist>
221199 <listitem>
222200 <para>
223− Write the title in format <command>(pkg-name | nixos/&lt;module>):
224− improvement</command>.
201+ Write the title in format <command>(pkg-name | nixos/&lt;module>): improvement</command>.
225202 <itemizedlist>
226203 <listitem>
227204 <para>
@@ -233,8 +210,7 @@ Additional information.
233210 </listitem>
234211 <listitem>
235212 <para>
236− Write in comment if you have tested your patch. Do not rely much on
237− <command>TravisCI</command>.
213+ Write in comment if you have tested your patch. Do not rely much on <command>TravisCI</command>.
238214 </para>
239215 </listitem>
240216 <listitem>
@@ -244,8 +220,7 @@ Additional information.
244220 </listitem>
245221 <listitem>
246222 <para>
247− Notify maintainers of the package. For example add to the message:
248− <command>cc @jagajaga @domenkozar</command>.
223+ Notify maintainers of the package. For example add to the message: <command>cc @jagajaga @domenkozar</command>.
249224 </para>
250225 </listitem>
251226 </itemizedlist>
@@ -257,64 +232,39 @@ Additional information.
257232 <title>Pull Request Template</title>
258233
259234 <para>
260− The pull request template helps determine what steps have been made for a
261− contribution so far, and will help guide maintainers on the status of a
262− change. The motivation section of the PR should include any extra details
263− the title does not address and link any existing issues related to the pull
264− request.
235+ The pull request template helps determine what steps have been made for a contribution so far, and will help guide maintainers on the status of a change. The motivation section of the PR should include any extra details the title does not address and link any existing issues related to the pull request.
265236 </para>
266237
267238 <para>
268− When a PR is created, it will be pre-populated with some checkboxes detailed
269− below:
239+ When a PR is created, it will be pre-populated with some checkboxes detailed below:
270240 </para>
271241
272242 <section xml:id="submitting-changes-tested-with-sandbox">
273243 <title>Tested using sandboxing</title>
274244
275245 <para>
276− When sandbox builds are enabled, Nix will setup an isolated environment for
277− each build process. It is used to remove further hidden dependencies set by
278− the build environment to improve reproducibility. This includes access to
279− the network during the build outside of <function>fetch*</function>
280− functions and files outside the Nix store. Depending on the operating
281− system access to other resources are blocked as well (ex. inter process
282− communication is isolated on Linux); see
283− <link
284− xlink:href="https://nixos.org/nix/manual/#description-45">build-use-sandbox</link>
285− in Nix manual for details.
246+ When sandbox builds are enabled, Nix will setup an isolated environment for each build process. It is used to remove further hidden dependencies set by the build environment to improve reproducibility. This includes access to the network during the build outside of <function>fetch*</function> functions and files outside the Nix store. Depending on the operating system access to other resources are blocked as well (ex. inter process communication is isolated on Linux); see <link
247+ xlink:href="https://nixos.org/nix/manual/#description-45">build-use-sandbox</link> in Nix manual for details.
286248 </para>
287249
288250 <para>
289− Sandboxing is not enabled by default in Nix due to a small performance hit
290− on each build. In pull requests for
291− <link
292− xlink:href="https://github.com/NixOS/nixpkgs/">nixpkgs</link>
293− people are asked to test builds with sandboxing enabled (see
294− <literal>Tested using sandboxing</literal> in the pull request template)
295− because
296− in<link
297− xlink:href="https://nixos.org/hydra/">https://nixos.org/hydra/</link>
298− sandboxing is also used.
251+ Sandboxing is not enabled by default in Nix due to a small performance hit on each build. In pull requests for <link
252+ xlink:href="https://github.com/NixOS/nixpkgs/">nixpkgs</link> people are asked to test builds with sandboxing enabled (see <literal>Tested using sandboxing</literal> in the pull request template) because in<link
253+ xlink:href="https://nixos.org/hydra/">https://nixos.org/hydra/</link> sandboxing is also used.
299254 </para>
300255
301256 <para>
302− Depending if you use NixOS or other platforms you can use one of the
303− following methods to enable sandboxing
304− <emphasis role="bold">before</emphasis> building the package:
257+ Depending if you use NixOS or other platforms you can use one of the following methods to enable sandboxing <emphasis role="bold">before</emphasis> building the package:
305258 <itemizedlist>
306259 <listitem>
307260 <para>
308− <emphasis role="bold">Globally enable sandboxing on NixOS</emphasis>:
309− add the following to <filename>configuration.nix</filename>
261+ <emphasis role="bold">Globally enable sandboxing on NixOS</emphasis>: add the following to <filename>configuration.nix</filename>
310262<screen>nix.useSandbox = true;</screen>
311263 </para>
312264 </listitem>
313265 <listitem>
314266 <para>
315− <emphasis role="bold">Globally enable sandboxing on non-NixOS
316− platforms</emphasis>: add the following to:
317− <filename>/etc/nix/nix.conf</filename>
267+ <emphasis role="bold">Globally enable sandboxing on non-NixOS platforms</emphasis>: add the following to: <filename>/etc/nix/nix.conf</filename>
318268<screen>build-use-sandbox = true</screen>
319269 </para>
320270 </listitem>
@@ -326,11 +276,7 @@ Additional information.
326276 <title>Built on platform(s)</title>
327277
328278 <para>
329− Many Nix packages are designed to run on multiple platforms. As such, it's
330− important to let the maintainer know which platforms your changes have been
331− tested on. It's not always practical to test a change on all platforms, and
332− is not required for a pull request to be merged. Only check the systems you
333− tested the build on in this section.
279+ Many Nix packages are designed to run on multiple platforms. As such, it's important to let the maintainer know which platforms your changes have been tested on. It's not always practical to test a change on all platforms, and is not required for a pull request to be merged. Only check the systems you tested the build on in this section.
334280 </para>
335281 </section>
336282
@@ -338,15 +284,8 @@ Additional information.
338284 <title>Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)</title>
339285
340286 <para>
341− Packages with automated tests are much more likely to be merged in a timely
342− fashion because it doesn't require as much manual testing by the maintainer
343− to verify the functionality of the package. If there are existing tests for
344− the package, they should be run to verify your changes do not break the
345− tests. Tests only apply to packages with NixOS modules defined and can only
346− be run on Linux. For more details on writing and running tests, see the
347− <link
348− xlink:href="https://nixos.org/nixos/manual/index.html#sec-nixos-tests">section
349− in the NixOS manual</link>.
287+ Packages with automated tests are much more likely to be merged in a timely fashion because it doesn't require as much manual testing by the maintainer to verify the functionality of the package. If there are existing tests for the package, they should be run to verify your changes do not break the tests. Tests only apply to packages with NixOS modules defined and can only be run on Linux. For more details on writing and running tests, see the <link
288+ xlink:href="https://nixos.org/nixos/manual/index.html#sec-nixos-tests">section in the NixOS manual</link>.
350289 </para>
351290 </section>
352291
@@ -354,11 +293,7 @@ Additional information.
354293 <title>Tested compilation of all pkgs that depend on this change using <command>nix-review</command></title>
355294
356295 <para>
357− If you are updating a package's version, you can use nix-review to make
358− sure all packages that depend on the updated package still compile
359− correctly. The <command>nix-review</command> utility can look for and build
360− all dependencies either based on uncommited changes with the
361− <literal>wip</literal> option or specifying a github pull request number.
296+ If you are updating a package's version, you can use nix-review to make sure all packages that depend on the updated package still compile correctly. The <command>nix-review</command> utility can look for and build all dependencies either based on uncommited changes with the <literal>wip</literal> option or specifying a github pull request number.
362297 </para>
363298
364299 <para>
@@ -376,13 +311,7 @@ Additional information.
376311 <title>Tested execution of all binary files (usually in <filename>./result/bin/</filename>)</title>
377312
378313 <para>
379− It's important to test any executables generated by a build when you change
380− or create a package in nixpkgs. This can be done by looking in
381− <filename>./result/bin</filename> and running any files in there, or at a
382− minimum, the main executable for the package. For example, if you make a
383− change to <package>texlive</package>, you probably would only check the
384− binaries associated with the change you made rather than testing all of
385− them.
314+ It's important to test any executables generated by a build when you change or create a package in nixpkgs. This can be done by looking in <filename>./result/bin</filename> and running any files in there, or at a minimum, the main executable for the package. For example, if you make a change to <package>texlive</package>, you probably would only check the binaries associated with the change you made rather than testing all of them.
386315 </para>
387316 </section>
388317
@@ -390,14 +319,8 @@ Additional information.
390319 <title>Meets Nixpkgs contribution standards</title>
391320
392321 <para>
393− The last checkbox is fits
394− <link
395− xlink:href="https://github.com/NixOS/nixpkgs/blob/master/.github/CONTRIBUTING.md">CONTRIBUTING.md</link>.
396− The contributing document has detailed information on standards the Nix
397− community has for commit messages, reviews, licensing of contributions you
398− make to the project, etc... Everyone should read and understand the
399− standards the community has for contributing before submitting a pull
400− request.
322+ The last checkbox is fits <link
323+ xlink:href="https://github.com/NixOS/nixpkgs/blob/master/.github/CONTRIBUTING.md">CONTRIBUTING.md</link>. The contributing document has detailed information on standards the Nix community has for commit messages, reviews, licensing of contributions you make to the project, etc... Everyone should read and understand the standards the community has for contributing before submitting a pull request.
401324 </para>
402325 </section>
403326 </section>
@@ -435,22 +358,17 @@ Additional information.
435358 <itemizedlist>
436359 <listitem>
437360 <para>
438− Commits must be sufficiently tested before being merged, both for the
439− master and staging branches.
361+ Commits must be sufficiently tested before being merged, both for the master and staging branches.
440362 </para>
441363 </listitem>
442364 <listitem>
443365 <para>
444− Hydra builds for master and staging should not be used as testing
445− platform, it's a build farm for changes that have been already tested.
366+ Hydra builds for master and staging should not be used as testing platform, it's a build farm for changes that have been already tested.
446367 </para>
447368 </listitem>
448369 <listitem>
449370 <para>
450− When changing the bootloader installation process, extra care must be
451− taken. Grub installations cannot be rolled back, hence changes may break
452− people's installations forever. For any non-trivial change to the
453− bootloader please file a PR asking for review, especially from @edolstra.
371+ When changing the bootloader installation process, extra care must be taken. Grub installations cannot be rolled back, hence changes may break people's installations forever. For any non-trivial change to the bootloader please file a PR asking for review, especially from @edolstra.
454372 </para>
455373 </listitem>
456374 </itemizedlist>
@@ -473,20 +391,12 @@ Additional information.
473391 <itemizedlist>
474392 <listitem>
475393 <para>
476− It's only for non-breaking mass-rebuild commits. That means it's not to
477− be used for testing, and changes must have been well tested already.
478− <link xlink:href="https://web.archive.org/web/20160528180406/http://comments.gmane.org/gmane.linux.distributions.nixos/13447">Read
479− policy here</link>.
394+ It's only for non-breaking mass-rebuild commits. That means it's not to be used for testing, and changes must have been well tested already. <link xlink:href="https://web.archive.org/web/20160528180406/http://comments.gmane.org/gmane.linux.distributions.nixos/13447">Read policy here</link>.
480395 </para>
481396 </listitem>
482397 <listitem>
483398 <para>
484− If the branch is already in a broken state, please refrain from adding
485− extra new breakages. Stabilize it for a few days, merge into master, then
486− resume development on staging.
487− <link xlink:href="http://hydra.nixos.org/jobset/nixpkgs/staging#tabs-evaluations">Keep
488− an eye on the staging evaluations here</link>. If any fixes for staging
489− happen to be already in master, then master can be merged into staging.
399+ If the branch is already in a broken state, please refrain from adding extra new breakages. Stabilize it for a few days, merge into master, then resume development on staging. <link xlink:href="http://hydra.nixos.org/jobset/nixpkgs/staging#tabs-evaluations">Keep an eye on the staging evaluations here</link>. If any fixes for staging happen to be already in master, then master can be merged into staging.
490400 </para>
491401 </listitem>
492402 </itemizedlist>
@@ -498,10 +408,7 @@ Additional information.
498408 <itemizedlist>
499409 <listitem>
500410 <para>
501− If you're cherry-picking a commit to a stable release branch, always use
502− <command>git cherry-pick -xe</command> and ensure the message contains a
503− clear description about why this needs to be included in the stable
504− branch.
411+ If you're cherry-picking a commit to a stable release branch, always use <command>git cherry-pick -xe</command> and ensure the message contains a clear description about why this needs to be included in the stable branch.
505412 </para>
506413 <para>
507414 An example of a cherry-picked commit would look like this:
nixos/doc/manual/administration/boot-problems.xml+6−26
@@ -6,12 +6,7 @@
66 <title>Boot Problems</title>
77
88 <para>
9− If NixOS fails to boot, there are a number of kernel command line parameters
10− that may help you to identify or fix the issue. You can add these parameters
11− in the GRUB boot menu by pressing “e” to modify the selected boot entry
12− and editing the line starting with <literal>linux</literal>. The following
13− are some useful kernel command line parameters that are recognised by the
14− NixOS boot scripts or by systemd:
9+ If NixOS fails to boot, there are a number of kernel command line parameters that may help you to identify or fix the issue. You can add these parameters in the GRUB boot menu by pressing “e” to modify the selected boot entry and editing the line starting with <literal>linux</literal>. The following are some useful kernel command line parameters that are recognised by the NixOS boot scripts or by systemd:
1510 <variablelist>
1611 <varlistentry>
1712 <term>
@@ -19,9 +14,7 @@
1914 </term>
2015 <listitem>
2116 <para>
22− Start a root shell if something goes wrong in stage 1 of the boot process
23− (the initial ramdisk). This is disabled by default because there is no
24− authentication for the root shell.
17+ Start a root shell if something goes wrong in stage 1 of the boot process (the initial ramdisk). This is disabled by default because there is no authentication for the root shell.
2518 </para>
2619 </listitem>
2720 </varlistentry>
@@ -31,10 +24,7 @@
3124 </term>
3225 <listitem>
3326 <para>
34− Start an interactive shell in stage 1 before anything useful has been
35− done. That is, no modules have been loaded and no file systems have been
36− mounted, except for <filename>/proc</filename> and
37− <filename>/sys</filename>.
27+ Start an interactive shell in stage 1 before anything useful has been done. That is, no modules have been loaded and no file systems have been mounted, except for <filename>/proc</filename> and <filename>/sys</filename>.
3828 </para>
3929 </listitem>
4030 </varlistentry>
@@ -54,11 +44,7 @@
5444 </term>
5545 <listitem>
5646 <para>
57− Boot into rescue mode (a.k.a. single user mode). This will cause systemd
58− to start nothing but the unit <literal>rescue.target</literal>, which
59− runs <command>sulogin</command> to prompt for the root password and start
60− a root login shell. Exiting the shell causes the system to continue with
61− the normal boot process.
47+ Boot into rescue mode (a.k.a. single user mode). This will cause systemd to start nothing but the unit <literal>rescue.target</literal>, which runs <command>sulogin</command> to prompt for the root password and start a root login shell. Exiting the shell causes the system to continue with the normal boot process.
6248 </para>
6349 </listitem>
6450 </varlistentry>
@@ -68,8 +54,7 @@
6854 </term>
6955 <listitem>
7056 <para>
71− Make systemd very verbose and send log messages to the console instead of
72− the journal.
57+ Make systemd very verbose and send log messages to the console instead of the journal.
7358 </para>
7459 </listitem>
7560 </varlistentry>
@@ -80,11 +65,6 @@
8065 </para>
8166
8267 <para>
83− If no login prompts or X11 login screens appear (e.g. due to hanging
84− dependencies), you can press Alt+ArrowUp. If you’re lucky, this will start
85− rescue mode (described above). (Also note that since most units have a
86− 90-second timeout before systemd gives up on them, the
87− <command>agetty</command> login prompts should appear eventually unless
88− something is very wrong.)
68+ If no login prompts or X11 login screens appear (e.g. due to hanging dependencies), you can press Alt+ArrowUp. If you’re lucky, this will start rescue mode (described above). (Also note that since most units have a 90-second timeout before systemd gives up on them, the <command>agetty</command> login prompts should appear eventually unless something is very wrong.)
8969 </para>
9070</section>
nixos/doc/manual/administration/cleaning-store.xml+8−24
@@ -5,31 +5,22 @@
55 xml:id="sec-nix-gc">
66 <title>Cleaning the Nix Store</title>
77 <para>
8− Nix has a purely functional model, meaning that packages are never upgraded
9− in place. Instead new versions of packages end up in a different location in
10− the Nix store (<filename>/nix/store</filename>). You should periodically run
11− Nix’s <emphasis>garbage collector</emphasis> to remove old, unreferenced
12− packages. This is easy:
8+ Nix has a purely functional model, meaning that packages are never upgraded in place. Instead new versions of packages end up in a different location in the Nix store (<filename>/nix/store</filename>). You should periodically run Nix’s <emphasis>garbage collector</emphasis> to remove old, unreferenced packages. This is easy:
139<screen>
1410<prompt>$ </prompt>nix-collect-garbage
1511</screen>
16− Alternatively, you can use a systemd unit that does the same in the
17− background:
12+ Alternatively, you can use a systemd unit that does the same in the background:
1813<screen>
1914<prompt># </prompt>systemctl start nix-gc.service
2015</screen>
21− You can tell NixOS in <filename>configuration.nix</filename> to run this unit
22− automatically at certain points in time, for instance, every night at 03:15:
16+ You can tell NixOS in <filename>configuration.nix</filename> to run this unit automatically at certain points in time, for instance, every night at 03:15:
2317<programlisting>
2418<xref linkend="opt-nix.gc.automatic"/> = true;
2519<xref linkend="opt-nix.gc.dates"/> = "03:15";
2620</programlisting>
2721 </para>
2822 <para>
29− The commands above do not remove garbage collector roots, such as old system
30− configurations. Thus they do not remove the ability to roll back to previous
31− configurations. The following command deletes old roots, removing the ability
32− to roll back to them:
23+ The commands above do not remove garbage collector roots, such as old system configurations. Thus they do not remove the ability to roll back to previous configurations. The following command deletes old roots, removing the ability to roll back to them:
3324<screen>
3425<prompt>$ </prompt>nix-collect-garbage -d
3526</screen>
@@ -37,27 +28,20 @@
3728<screen>
3829<prompt>$ </prompt>nix-env -p /nix/var/nix/profiles/per-user/eelco/profile --delete-generations old
3930</screen>
40− Note that NixOS system configurations are stored in the profile
41− <filename>/nix/var/nix/profiles/system</filename>.
31+ Note that NixOS system configurations are stored in the profile <filename>/nix/var/nix/profiles/system</filename>.
4232 </para>
4333 <para>
44− Another way to reclaim disk space (often as much as 40% of the size of the
45− Nix store) is to run Nix’s store optimiser, which seeks out identical files
46− in the store and replaces them with hard links to a single copy.
34+ Another way to reclaim disk space (often as much as 40% of the size of the Nix store) is to run Nix’s store optimiser, which seeks out identical files in the store and replaces them with hard links to a single copy.
4735<screen>
4836<prompt>$ </prompt>nix-store --optimise
4937</screen>
50− Since this command needs to read the entire Nix store, it can take quite a
51− while to finish.
38+ Since this command needs to read the entire Nix store, it can take quite a while to finish.
5239 </para>
5340 <section xml:id="sect-nixos-gc-boot-entries">
5441 <title>NixOS Boot Entries</title>
5542
5643 <para>
57− If your <filename>/boot</filename> partition runs out of space, after
58− clearing old profiles you must rebuild your system with
59− <literal>nixos-rebuild</literal> to update the <filename>/boot</filename>
60− partition and clear space.
44+ If your <filename>/boot</filename> partition runs out of space, after clearing old profiles you must rebuild your system with <literal>nixos-rebuild</literal> to update the <filename>/boot</filename> partition and clear space.
6145 </para>
6246 </section>
6347</chapter>
nixos/doc/manual/administration/container-networking.xml+5−21
@@ -6,10 +6,7 @@
66 <title>Container Networking</title>
77
88 <para>
9− When you create a container using <literal>nixos-container create</literal>,
10− it gets it own private IPv4 address in the range
11− <literal>10.233.0.0/16</literal>. You can get the container’s IPv4 address
12− as follows:
9+ When you create a container using <literal>nixos-container create</literal>, it gets it own private IPv4 address in the range <literal>10.233.0.0/16</literal>. You can get the container’s IPv4 address as follows:
1310<screen>
1411<prompt># </prompt>nixos-container show-ip foo
151210.233.4.2
@@ -20,34 +17,21 @@
2017 </para>
2118
2219 <para>
23− Networking is implemented using a pair of virtual Ethernet devices. The
24− network interface in the container is called <literal>eth0</literal>, while
25− the matching interface in the host is called
26− <literal>ve-<replaceable>container-name</replaceable></literal> (e.g.,
27− <literal>ve-foo</literal>). The container has its own network namespace and
28− the <literal>CAP_NET_ADMIN</literal> capability, so it can perform arbitrary
29− network configuration such as setting up firewall rules, without affecting or
30− having access to the host’s network.
20+ Networking is implemented using a pair of virtual Ethernet devices. The network interface in the container is called <literal>eth0</literal>, while the matching interface in the host is called <literal>ve-<replaceable>container-name</replaceable></literal> (e.g., <literal>ve-foo</literal>). The container has its own network namespace and the <literal>CAP_NET_ADMIN</literal> capability, so it can perform arbitrary network configuration such as setting up firewall rules, without affecting or having access to the host’s network.
3121 </para>
3222
3323 <para>
34− By default, containers cannot talk to the outside network. If you want that,
35− you should set up Network Address Translation (NAT) rules on the host to
36− rewrite container traffic to use your external IP address. This can be
37− accomplished using the following configuration on the host:
24+ By default, containers cannot talk to the outside network. If you want that, you should set up Network Address Translation (NAT) rules on the host to rewrite container traffic to use your external IP address. This can be accomplished using the following configuration on the host:
3825<programlisting>
3926<xref linkend="opt-networking.nat.enable"/> = true;
4027<xref linkend="opt-networking.nat.internalInterfaces"/> = ["ve-+"];
4128<xref linkend="opt-networking.nat.externalInterface"/> = "eth0";
4229</programlisting>
43− where <literal>eth0</literal> should be replaced with the desired external
44− interface. Note that <literal>ve-+</literal> is a wildcard that matches all
45− container interfaces.
30+ where <literal>eth0</literal> should be replaced with the desired external interface. Note that <literal>ve-+</literal> is a wildcard that matches all container interfaces.
4631 </para>
4732
4833 <para>
49− If you are using Network Manager, you need to explicitly prevent it from
50− managing container interfaces:
34+ If you are using Network Manager, you need to explicitly prevent it from managing container interfaces:
5135<programlisting>
5236networking.networkmanager.unmanaged = [ "interface-name:ve-*" ];
5337</programlisting>
nixos/doc/manual/administration/containers.xml+3−16
@@ -5,28 +5,15 @@
55 xml:id="ch-containers">
66 <title>Container Management</title>
77 <para>
8− NixOS allows you to easily run other NixOS instances as
9− <emphasis>containers</emphasis>. Containers are a light-weight approach to
10− virtualisation that runs software in the container at the same speed as in
11− the host system. NixOS containers share the Nix store of the host, making
12− container creation very efficient.
8+ NixOS allows you to easily run other NixOS instances as <emphasis>containers</emphasis>. Containers are a light-weight approach to virtualisation that runs software in the container at the same speed as in the host system. NixOS containers share the Nix store of the host, making container creation very efficient.
139 </para>
1410 <warning>
1511 <para>
16− Currently, NixOS containers are not perfectly isolated from the host system.
17− This means that a user with root access to the container can do things that
18− affect the host. So you should not give container root access to untrusted
19− users.
12+ Currently, NixOS containers are not perfectly isolated from the host system. This means that a user with root access to the container can do things that affect the host. So you should not give container root access to untrusted users.
2013 </para>
2114 </warning>
2215 <para>
23− NixOS containers can be created in two ways: imperatively, using the command
24− <command>nixos-container</command>, and declaratively, by specifying them in
25− your <filename>configuration.nix</filename>. The declarative approach implies
26− that containers get upgraded along with your host system when you run
27− <command>nixos-rebuild</command>, which is often not what you want. By
28− contrast, in the imperative approach, containers are configured and updated
29− independently from the host system.
16+ NixOS containers can be created in two ways: imperatively, using the command <command>nixos-container</command>, and declaratively, by specifying them in your <filename>configuration.nix</filename>. The declarative approach implies that containers get upgraded along with your host system when you run <command>nixos-rebuild</command>, which is often not what you want. By contrast, in the imperative approach, containers are configured and updated independently from the host system.
3017 </para>
3118 <xi:include href="imperative-containers.xml" />
3219 <xi:include href="declarative-containers.xml" />
nixos/doc/manual/administration/control-groups.xml+6−27
@@ -5,16 +5,10 @@
55 xml:id="sec-cgroups">
66 <title>Control Groups</title>
77 <para>
8− To keep track of the processes in a running system, systemd uses
9− <emphasis>control groups</emphasis> (cgroups). A control group is a set of
10− processes used to allocate resources such as CPU, memory or I/O bandwidth.
11− There can be multiple control group hierarchies, allowing each kind of
12− resource to be managed independently.
8+ To keep track of the processes in a running system, systemd uses <emphasis>control groups</emphasis> (cgroups). A control group is a set of processes used to allocate resources such as CPU, memory or I/O bandwidth. There can be multiple control group hierarchies, allowing each kind of resource to be managed independently.
139 </para>
1410 <para>
15− The command <command>systemd-cgls</command> lists all control groups in the
16− <literal>systemd</literal> hierarchy, which is what systemd uses to keep
17− track of the processes belonging to each service or user session:
11+ The command <command>systemd-cgls</command> lists all control groups in the <literal>systemd</literal> hierarchy, which is what systemd uses to keep track of the processes belonging to each service or user session:
1812<screen>
1913<prompt>$ </prompt>systemd-cgls
2014├─user
@@ -32,34 +26,19 @@
3226 │ └─2376 dhcpcd --config /nix/store/f8dif8dsi2yaa70n03xir8r653776ka6-dhcpcd.conf
3327 └─ <replaceable>...</replaceable>
3428</screen>
35− Similarly, <command>systemd-cgls cpu</command> shows the cgroups in the CPU
36− hierarchy, which allows per-cgroup CPU scheduling priorities. By default,
37− every systemd service gets its own CPU cgroup, while all user sessions are in
38− the top-level CPU cgroup. This ensures, for instance, that a thousand
39− run-away processes in the <literal>httpd.service</literal> cgroup cannot
40− starve the CPU for one process in the <literal>postgresql.service</literal>
41− cgroup. (By contrast, it they were in the same cgroup, then the PostgreSQL
42− process would get 1/1001 of the cgroup’s CPU time.) You can limit a
43− service’s CPU share in <filename>configuration.nix</filename>:
29+ Similarly, <command>systemd-cgls cpu</command> shows the cgroups in the CPU hierarchy, which allows per-cgroup CPU scheduling priorities. By default, every systemd service gets its own CPU cgroup, while all user sessions are in the top-level CPU cgroup. This ensures, for instance, that a thousand run-away processes in the <literal>httpd.service</literal> cgroup cannot starve the CPU for one process in the <literal>postgresql.service</literal> cgroup. (By contrast, it they were in the same cgroup, then the PostgreSQL process would get 1/1001 of the cgroup’s CPU time.) You can limit a service’s CPU share in <filename>configuration.nix</filename>:
4430<programlisting>
4531<link linkend="opt-systemd.services._name_.serviceConfig">systemd.services.httpd.serviceConfig</link>.CPUShares = 512;
4632</programlisting>
47− By default, every cgroup has 1024 CPU shares, so this will halve the CPU
48− allocation of the <literal>httpd.service</literal> cgroup.
33+ By default, every cgroup has 1024 CPU shares, so this will halve the CPU allocation of the <literal>httpd.service</literal> cgroup.
4934 </para>
5035 <para>
51− There also is a <literal>memory</literal> hierarchy that controls memory
52− allocation limits; by default, all processes are in the top-level cgroup, so
53− any service or session can exhaust all available memory. Per-cgroup memory
54− limits can be specified in <filename>configuration.nix</filename>; for
55− instance, to limit <literal>httpd.service</literal> to 512 MiB of RAM
56− (excluding swap):
36+ There also is a <literal>memory</literal> hierarchy that controls memory allocation limits; by default, all processes are in the top-level cgroup, so any service or session can exhaust all available memory. Per-cgroup memory limits can be specified in <filename>configuration.nix</filename>; for instance, to limit <literal>httpd.service</literal> to 512 MiB of RAM (excluding swap):
5737<programlisting>
5838<link linkend="opt-systemd.services._name_.serviceConfig">systemd.services.httpd.serviceConfig</link>.MemoryLimit = "512M";
5939</programlisting>
6040 </para>
6141 <para>
62− The command <command>systemd-cgtop</command> shows a continuously updated
63− list of all cgroups with their CPU and memory usage.
42+ The command <command>systemd-cgtop</command> shows a continuously updated list of all cgroups with their CPU and memory usage.
6443 </para>
6544</chapter>
nixos/doc/manual/administration/declarative-containers.xml+6−25
@@ -6,10 +6,7 @@
66 <title>Declarative Container Specification</title>
77
88 <para>
9− You can also specify containers and their configuration in the host’s
10− <filename>configuration.nix</filename>. For example, the following specifies
11− that there shall be a container named <literal>database</literal> running
12− PostgreSQL:
9+ You can also specify containers and their configuration in the host’s <filename>configuration.nix</filename>. For example, the following specifies that there shall be a container named <literal>database</literal> running PostgreSQL:
1310<programlisting>
1411containers.database =
1512 { config =
@@ -19,18 +16,11 @@ containers.database =
1916 };
2017 };
2118</programlisting>
22− If you run <literal>nixos-rebuild switch</literal>, the container will be
23− built. If the container was already running, it will be updated in place,
24− without rebooting. The container can be configured to start automatically by
25− setting <literal>containers.database.autoStart = true</literal> in its
26− configuration.
19+ If you run <literal>nixos-rebuild switch</literal>, the container will be built. If the container was already running, it will be updated in place, without rebooting. The container can be configured to start automatically by setting <literal>containers.database.autoStart = true</literal> in its configuration.
2720 </para>
2821
2922 <para>
30− By default, declarative containers share the network namespace of the host,
31− meaning that they can listen on (privileged) ports. However, they cannot
32− change the network configuration. You can give a container its own network as
33− follows:
23+ By default, declarative containers share the network namespace of the host, meaning that they can listen on (privileged) ports. However, they cannot change the network configuration. You can give a container its own network as follows:
3424<programlisting>
3525containers.database = {
3626 <link linkend="opt-containers._name_.privateNetwork">privateNetwork</link> = true;
@@ -38,23 +28,14 @@ containers.database = {
3828 <link linkend="opt-containers._name_.localAddress">localAddress</link> = "192.168.100.11";
3929};
4030</programlisting>
41− This gives the container a private virtual Ethernet interface with IP address
42− <literal>192.168.100.11</literal>, which is hooked up to a virtual Ethernet
43− interface on the host with IP address <literal>192.168.100.10</literal>. (See
44− the next section for details on container networking.)
31+ This gives the container a private virtual Ethernet interface with IP address <literal>192.168.100.11</literal>, which is hooked up to a virtual Ethernet interface on the host with IP address <literal>192.168.100.10</literal>. (See the next section for details on container networking.)
4532 </para>
4633
4734 <para>
48− To disable the container, just remove it from
49− <filename>configuration.nix</filename> and run <literal>nixos-rebuild
50− switch</literal>. Note that this will not delete the root directory of the
51− container in <literal>/var/lib/containers</literal>. Containers can be
52− destroyed using the imperative method: <literal>nixos-container destroy
53− foo</literal>.
35+ To disable the container, just remove it from <filename>configuration.nix</filename> and run <literal>nixos-rebuild switch</literal>. Note that this will not delete the root directory of the container in <literal>/var/lib/containers</literal>. Containers can be destroyed using the imperative method: <literal>nixos-container destroy foo</literal>.
5436 </para>
5537
5638 <para>
57− Declarative containers can be started and stopped using the corresponding
58− systemd service, e.g. <literal>systemctl start container@database</literal>.
39+ Declarative containers can be started and stopped using the corresponding systemd service, e.g. <literal>systemctl start container@database</literal>.
5940 </para>
6041</section>
nixos/doc/manual/administration/imperative-containers.xml+12−45
@@ -6,9 +6,7 @@
66 <title>Imperative Container Management</title>
77
88 <para>
9− We’ll cover imperative container management using
10− <command>nixos-container</command> first. Be aware that container management
11− is currently only possible as <literal>root</literal>.
9+ We’ll cover imperative container management using <command>nixos-container</command> first. Be aware that container management is currently only possible as <literal>root</literal>.
1210 </para>
1311
1412 <para>
@@ -16,23 +14,14 @@
1614<screen>
1715# nixos-container create foo
1816</screen>
19− This creates the container’s root directory in
20− <filename>/var/lib/containers/foo</filename> and a small configuration file
21− in <filename>/etc/containers/foo.conf</filename>. It also builds the
22− container’s initial system configuration and stores it in
23− <filename>/nix/var/nix/profiles/per-container/foo/system</filename>. You can
24− modify the initial configuration of the container on the command line. For
25− instance, to create a container that has <command>sshd</command> running,
26− with the given public key for <literal>root</literal>:
17+ This creates the container’s root directory in <filename>/var/lib/containers/foo</filename> and a small configuration file in <filename>/etc/containers/foo.conf</filename>. It also builds the container’s initial system configuration and stores it in <filename>/nix/var/nix/profiles/per-container/foo/system</filename>. You can modify the initial configuration of the container on the command line. For instance, to create a container that has <command>sshd</command> running, with the given public key for <literal>root</literal>:
2718<screen>
2819# nixos-container create foo --config '
2920 <xref linkend="opt-services.openssh.enable"/> = true;
3021 <link linkend="opt-users.users._name__.openssh.authorizedKeys.keys">users.users.root.openssh.authorizedKeys.keys</link> = ["ssh-dss AAAAB3N…"];
3122'
3223</screen>
33− By default the next free address in the <literal>10.233.0.0/16</literal> subnet will be chosen
34− as container IP. This behavior can be altered by setting <literal>--host-address</literal> and
35− <literal>--local-address</literal>:
24+ By default the next free address in the <literal>10.233.0.0/16</literal> subnet will be chosen as container IP. This behavior can be altered by setting <literal>--host-address</literal> and <literal>--local-address</literal>:
3625<screen>
3726# nixos-container create test --config-file test-container.nix \
3827 --local-address 10.235.1.2 --host-address 10.235.1.1
@@ -44,35 +33,25 @@
4433<screen>
4534# nixos-container start foo
4635</screen>
47− This command will return as soon as the container has booted and has reached
48− <literal>multi-user.target</literal>. On the host, the container runs within
49− a systemd unit called
50− <literal>container@<replaceable>container-name</replaceable>.service</literal>.
51− Thus, if something went wrong, you can get status info using
52− <command>systemctl</command>:
36+ This command will return as soon as the container has booted and has reached <literal>multi-user.target</literal>. On the host, the container runs within a systemd unit called <literal>container@<replaceable>container-name</replaceable>.service</literal>. Thus, if something went wrong, you can get status info using <command>systemctl</command>:
5337<screen>
5438# systemctl status container@foo
5539</screen>
5640 </para>
5741
5842 <para>
59− If the container has started successfully, you can log in as root using the
60− <command>root-login</command> operation:
43+ If the container has started successfully, you can log in as root using the <command>root-login</command> operation:
6144<screen>
6245# nixos-container root-login foo
6346[root@foo:~]#
6447</screen>
65− Note that only root on the host can do this (since there is no
66− authentication). You can also get a regular login prompt using the
67− <command>login</command> operation, which is available to all users on the
68− host:
48+ Note that only root on the host can do this (since there is no authentication). You can also get a regular login prompt using the <command>login</command> operation, which is available to all users on the host:
6949<screen>
7050# nixos-container login foo
7151foo login: alice
7252Password: ***
7353</screen>
74− With <command>nixos-container run</command>, you can execute arbitrary
75− commands in the container:
54+ With <command>nixos-container run</command>, you can execute arbitrary commands in the container:
7655<screen>
7756# nixos-container run foo -- uname -a
7857Linux foo 3.4.82 #1-NixOS SMP Thu Mar 20 14:44:05 UTC 2014 x86_64 GNU/Linux
@@ -80,15 +59,11 @@ Linux foo 3.4.82 #1-NixOS SMP Thu Mar 20 14:44:05 UTC 2014 x86_64 GNU/Linux
8059 </para>
8160
8261 <para>
83− There are several ways to change the configuration of the container. First,
84− on the host, you can edit
85− <literal>/var/lib/container/<replaceable>name</replaceable>/etc/nixos/configuration.nix</literal>,
86− and run
62+ There are several ways to change the configuration of the container. First, on the host, you can edit <literal>/var/lib/container/<replaceable>name</replaceable>/etc/nixos/configuration.nix</literal>, and run
8763<screen>
8864# nixos-container update foo
8965</screen>
90− This will build and activate the new configuration. You can also specify a
91− new configuration on the command line:
66+ This will build and activate the new configuration. You can also specify a new configuration on the command line:
9267<screen>
9368# nixos-container update foo --config '
9469 <xref linkend="opt-services.httpd.enable"/> = true;
@@ -99,23 +74,15 @@ Linux foo 3.4.82 #1-NixOS SMP Thu Mar 20 14:44:05 UTC 2014 x86_64 GNU/Linux
9974# curl http://$(nixos-container show-ip foo)/
10075&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">…
10176</screen>
102− However, note that this will overwrite the container’s
103− <filename>/etc/nixos/configuration.nix</filename>.
77+ However, note that this will overwrite the container’s <filename>/etc/nixos/configuration.nix</filename>.
10478 </para>
10579
10680 <para>
107− Alternatively, you can change the configuration from within the container
108− itself by running <command>nixos-rebuild switch</command> inside the
109− container. Note that the container by default does not have a copy of the
110− NixOS channel, so you should run <command>nix-channel --update</command>
111− first.
81+ Alternatively, you can change the configuration from within the container itself by running <command>nixos-rebuild switch</command> inside the container. Note that the container by default does not have a copy of the NixOS channel, so you should run <command>nix-channel --update</command> first.
11282 </para>
11383
11484 <para>
115− Containers can be stopped and started using <literal>nixos-container
116− stop</literal> and <literal>nixos-container start</literal>, respectively, or
117− by using <command>systemctl</command> on the container’s service unit. To
118− destroy a container, including its file system, do
85+ Containers can be stopped and started using <literal>nixos-container stop</literal> and <literal>nixos-container start</literal>, respectively, or by using <command>systemctl</command> on the container’s service unit. To destroy a container, including its file system, do
11986<screen>
12087# nixos-container destroy foo
12188</screen>
nixos/doc/manual/administration/logging.xml+4−15
@@ -5,18 +5,11 @@
55 xml:id="sec-logging">
66 <title>Logging</title>
77 <para>
8− System-wide logging is provided by systemd’s <emphasis>journal</emphasis>,
9− which subsumes traditional logging daemons such as syslogd and klogd. Log
10− entries are kept in binary files in <filename>/var/log/journal/</filename>.
11− The command <literal>journalctl</literal> allows you to see the contents of
12− the journal. For example,
8+ System-wide logging is provided by systemd’s <emphasis>journal</emphasis>, which subsumes traditional logging daemons such as syslogd and klogd. Log entries are kept in binary files in <filename>/var/log/journal/</filename>. The command <literal>journalctl</literal> allows you to see the contents of the journal. For example,
139<screen>
1410<prompt>$ </prompt>journalctl -b
1511</screen>
16− shows all journal entries since the last reboot. (The output of
17− <command>journalctl</command> is piped into <command>less</command> by
18− default.) You can use various options and match operators to restrict output
19− to messages of interest. For instance, to get all messages from PostgreSQL:
12+ shows all journal entries since the last reboot. (The output of <command>journalctl</command> is piped into <command>less</command> by default.) You can use various options and match operators to restrict output to messages of interest. For instance, to get all messages from PostgreSQL:
2013<screen>
2114<prompt>$ </prompt>journalctl -u postgresql.service
2215-- Logs begin at Mon, 2013-01-07 13:28:01 CET, end at Tue, 2013-01-08 01:09:57 CET. --
@@ -26,8 +19,7 @@ Jan 07 15:44:14 hagbard postgres[2681]: [2-1] LOG: database system is shut down
2619Jan 07 15:45:10 hagbard postgres[2532]: [1-1] LOG: database system was shut down at 2013-01-07 15:44:14 CET
2720Jan 07 15:45:13 hagbard postgres[2500]: [1-1] LOG: database system is ready to accept connections
2821</screen>
29− Or to get all messages since the last reboot that have at least a
30− “critical” severity level:
22+ Or to get all messages since the last reboot that have at least a “critical” severity level:
3123<screen>
3224<prompt>$ </prompt>journalctl -b -p crit
3325Dec 17 21:08:06 mandark sudo[3673]: pam_unix(sudo:auth): auth could not identify password for [alice]
@@ -35,9 +27,6 @@ Dec 29 01:30:22 mandark kernel[6131]: [1053513.909444] CPU6: Core temperature ab
3527</screen>
3628 </para>
3729 <para>
38− The system journal is readable by root and by users in the
39− <literal>wheel</literal> and <literal>systemd-journal</literal> groups. All
40− users have a private journal that can be read using
41− <command>journalctl</command>.
30+ The system journal is readable by root and by users in the <literal>wheel</literal> and <literal>systemd-journal</literal> groups. All users have a private journal that can be read using <command>journalctl</command>.
4231 </para>
4332</chapter>
nixos/doc/manual/administration/maintenance-mode.xml+1−3
@@ -9,8 +9,6 @@
99 You can enter rescue mode by running:
1010<screen>
1111# systemctl rescue</screen>
12− This will eventually give you a single-user root shell. Systemd will stop
13− (almost) all system services. To get out of maintenance mode, just exit from
14− the rescue shell.
12+ This will eventually give you a single-user root shell. Systemd will stop (almost) all system services. To get out of maintenance mode, just exit from the rescue shell.
1513 </para>
1614</section>
nixos/doc/manual/administration/network-problems.xml+2−11
@@ -6,20 +6,11 @@
66 <title>Network Problems</title>
77
88 <para>
9− Nix uses a so-called <emphasis>binary cache</emphasis> to optimise building a
10− package from source into downloading it as a pre-built binary. That is,
11− whenever a command like <command>nixos-rebuild</command> needs a path in the
12− Nix store, Nix will try to download that path from the Internet rather than
13− build it from source. The default binary cache is
14− <uri>https://cache.nixos.org/</uri>. If this cache is unreachable, Nix
15− operations may take a long time due to HTTP connection timeouts. You can
16− disable the use of the binary cache by adding <option>--option
17− use-binary-caches false</option>, e.g.
9+ Nix uses a so-called <emphasis>binary cache</emphasis> to optimise building a package from source into downloading it as a pre-built binary. That is, whenever a command like <command>nixos-rebuild</command> needs a path in the Nix store, Nix will try to download that path from the Internet rather than build it from source. The default binary cache is <uri>https://cache.nixos.org/</uri>. If this cache is unreachable, Nix operations may take a long time due to HTTP connection timeouts. You can disable the use of the binary cache by adding <option>--option use-binary-caches false</option>, e.g.
1810<screen>
1911# nixos-rebuild switch --option use-binary-caches false
2012</screen>
21− If you have an alternative binary cache at your disposal, you can use it
22− instead:
13+ If you have an alternative binary cache at your disposal, you can use it instead:
2314<screen>
2415# nixos-rebuild switch --option binary-caches http://my-cache.example.org/
2516</screen>
nixos/doc/manual/administration/rebooting.xml+3−8
@@ -16,20 +16,15 @@
1616<screen>
1717# reboot
1818</screen>
19− which is equivalent to <command>systemctl reboot</command>. Alternatively,
20− you can quickly reboot the system using <literal>kexec</literal>, which
21− bypasses the BIOS by directly loading the new kernel into memory:
19+ which is equivalent to <command>systemctl reboot</command>. Alternatively, you can quickly reboot the system using <literal>kexec</literal>, which bypasses the BIOS by directly loading the new kernel into memory:
2220<screen>
2321# systemctl kexec
2422</screen>
2523 </para>
2624 <para>
27− The machine can be suspended to RAM (if supported) using <command>systemctl
28− suspend</command>, and suspended to disk using <command>systemctl
29− hibernate</command>.
25+ The machine can be suspended to RAM (if supported) using <command>systemctl suspend</command>, and suspended to disk using <command>systemctl hibernate</command>.
3026 </para>
3127 <para>
32− These commands can be run by any user who is logged in locally, i.e. on a
33− virtual console or in X11; otherwise, the user is asked for authentication.
28+ These commands can be run by any user who is logged in locally, i.e. on a virtual console or in X11; otherwise, the user is asked for authentication.
3429 </para>
3530</chapter>
nixos/doc/manual/administration/rollback.xml+3−12
@@ -6,19 +6,11 @@
66 <title>Rolling Back Configuration Changes</title>
77
88 <para>
9− After running <command>nixos-rebuild</command> to switch to a new
10− configuration, you may find that the new configuration doesn’t work very
11− well. In that case, there are several ways to return to a previous
12− configuration.
9+ After running <command>nixos-rebuild</command> to switch to a new configuration, you may find that the new configuration doesn’t work very well. In that case, there are several ways to return to a previous configuration.
1310 </para>
1411
1512 <para>
16− First, the GRUB boot manager allows you to boot into any previous
17− configuration that hasn’t been garbage-collected. These configurations can
18− be found under the GRUB submenu “NixOS - All configurations”. This is
19− especially useful if the new configuration fails to boot. After the system
20− has booted, you can make the selected configuration the default for
21− subsequent boots:
13+ First, the GRUB boot manager allows you to boot into any previous configuration that hasn’t been garbage-collected. These configurations can be found under the GRUB submenu “NixOS - All configurations”. This is especially useful if the new configuration fails to boot. After the system has booted, you can make the selected configuration the default for subsequent boots:
2214<screen>
2315# /run/current-system/bin/switch-to-configuration boot</screen>
2416 </para>
@@ -30,8 +22,7 @@
3022 This is equivalent to running:
3123<screen>
3224# /nix/var/nix/profiles/system-<replaceable>N</replaceable>-link/bin/switch-to-configuration switch</screen>
33− where <replaceable>N</replaceable> is the number of the NixOS system
34− configuration. To get a list of the available configurations, do:
25+ where <replaceable>N</replaceable> is the number of the NixOS system configuration. To get a list of the available configurations, do:
3526<screen>
3627<prompt>$ </prompt>ls -l /nix/var/nix/profiles/system-*-link
3728<replaceable>...</replaceable>
nixos/doc/manual/administration/running.xml+1−2
@@ -6,8 +6,7 @@
66 <title>Administration</title>
77 <partintro xml:id="ch-running-intro">
88 <para>
9− This chapter describes various aspects of managing a running NixOS system,
10− such as how to use the <command>systemd</command> service manager.
9+ This chapter describes various aspects of managing a running NixOS system, such as how to use the <command>systemd</command> service manager.
1110 </para>
1211 </partintro>
1312 <xi:include href="service-mgmt.xml" />
nixos/doc/manual/administration/service-mgmt.xml+5−21
@@ -5,21 +5,10 @@
55 xml:id="sec-systemctl">
66 <title>Service Management</title>
77 <para>
8− In NixOS, all system services are started and monitored using the systemd
9− program. Systemd is the “init” process of the system (i.e. PID 1), the
10− parent of all other processes. It manages a set of so-called “units”,
11− which can be things like system services (programs), but also mount points,
12− swap files, devices, targets (groups of units) and more. Units can have
13− complex dependencies; for instance, one unit can require that another unit
14− must be successfully started before the first unit can be started. When the
15− system boots, it starts a unit named <literal>default.target</literal>; the
16− dependencies of this unit cause all system services to be started, file
17− systems to be mounted, swap files to be activated, and so on.
8+ In NixOS, all system services are started and monitored using the systemd program. Systemd is the “init” process of the system (i.e. PID 1), the parent of all other processes. It manages a set of so-called “units”, which can be things like system services (programs), but also mount points, swap files, devices, targets (groups of units) and more. Units can have complex dependencies; for instance, one unit can require that another unit must be successfully started before the first unit can be started. When the system boots, it starts a unit named <literal>default.target</literal>; the dependencies of this unit cause all system services to be started, file systems to be mounted, swap files to be activated, and so on.
189 </para>
1910 <para>
20− The command <command>systemctl</command> is the main way to interact with
21− <command>systemd</command>. Without any arguments, it shows the status of
22− active units:
11+ The command <command>systemctl</command> is the main way to interact with <command>systemd</command>. Without any arguments, it shows the status of active units:
2312<screen>
2413<prompt>$ </prompt>systemctl
2514-.mount loaded active mounted /
@@ -30,8 +19,7 @@ graphical.target loaded active active Graphical Interface
3019</screen>
3120 </para>
3221 <para>
33− You can ask for detailed status information about a unit, for instance, the
34− PostgreSQL database service:
22+ You can ask for detailed status information about a unit, for instance, the PostgreSQL database service:
3523<screen>
3624<prompt>$ </prompt>systemctl status postgresql.service
3725postgresql.service - PostgreSQL Server
@@ -51,9 +39,7 @@ Jan 07 15:55:57 hagbard postgres[2390]: [1-1] LOG: database system is ready to
5139Jan 07 15:55:57 hagbard postgres[2420]: [1-1] LOG: autovacuum launcher started
5240Jan 07 15:55:57 hagbard systemd[1]: Started PostgreSQL Server.
5341</screen>
54− Note that this shows the status of the unit (active and running), all the
55− processes belonging to the service, as well as the most recent log messages
56− from the service.
42+ Note that this shows the status of the unit (active and running), all the processes belonging to the service, as well as the most recent log messages from the service.
5743 </para>
5844 <para>
5945 Units can be stopped, started or restarted:
@@ -62,9 +48,7 @@ Jan 07 15:55:57 hagbard systemd[1]: Started PostgreSQL Server.
6248# systemctl start postgresql.service
6349# systemctl restart postgresql.service
6450</screen>
65− These operations are synchronous: they wait until the service has finished
66− starting or stopping (or has failed). Starting a unit will cause the
67− dependencies of that unit to be started as well (if necessary).
51+ These operations are synchronous: they wait until the service has finished starting or stopping (or has failed). Starting a unit will cause the dependencies of that unit to be started as well (if necessary).
6852 </para>
6953<!-- - cgroups: each service and user session is a cgroup
7054
nixos/doc/manual/administration/store-corruption.xml+4−13
@@ -6,23 +6,15 @@
66 <title>Nix Store Corruption</title>
77
88 <para>
9− After a system crash, it’s possible for files in the Nix store to become
10− corrupted. (For instance, the Ext4 file system has the tendency to replace
11− un-synced files with zero bytes.) NixOS tries hard to prevent this from
12− happening: it performs a <command>sync</command> before switching to a new
13− configuration, and Nix’s database is fully transactional. If corruption
14− still occurs, you may be able to fix it automatically.
9+ After a system crash, it’s possible for files in the Nix store to become corrupted. (For instance, the Ext4 file system has the tendency to replace un-synced files with zero bytes.) NixOS tries hard to prevent this from happening: it performs a <command>sync</command> before switching to a new configuration, and Nix’s database is fully transactional. If corruption still occurs, you may be able to fix it automatically.
1510 </para>
1611
1712 <para>
18− If the corruption is in a path in the closure of the NixOS system
19− configuration, you can fix it by doing
13+ If the corruption is in a path in the closure of the NixOS system configuration, you can fix it by doing
2014<screen>
2115<prompt># </prompt>nixos-rebuild switch --repair
2216</screen>
23− This will cause Nix to check every path in the closure, and if its
24− cryptographic hash differs from the hash recorded in Nix’s database, the
25− path is rebuilt or redownloaded.
17+ This will cause Nix to check every path in the closure, and if its cryptographic hash differs from the hash recorded in Nix’s database, the path is rebuilt or redownloaded.
2618 </para>
2719
2820 <para>
@@ -30,7 +22,6 @@
3022<screen>
3123<prompt># </prompt>nix-store --verify --check-contents --repair
3224</screen>
33− Any corrupt paths will be redownloaded if they’re available in a binary
34− cache; otherwise, they cannot be repaired.
25+ Any corrupt paths will be redownloaded if they’re available in a binary cache; otherwise, they cannot be repaired.
3526 </para>
3627</section>
nixos/doc/manual/administration/troubleshooting.xml+1−2
@@ -5,8 +5,7 @@
55 xml:id="ch-troubleshooting">
66 <title>Troubleshooting</title>
77 <para>
8− This chapter describes solutions to common problems you might encounter when
9− you manage your NixOS system.
8+ This chapter describes solutions to common problems you might encounter when you manage your NixOS system.
109 </para>
1110 <xi:include href="boot-problems.xml" />
1211 <xi:include href="maintenance-mode.xml" />
nixos/doc/manual/administration/user-sessions.xml+3−12
@@ -5,10 +5,7 @@
55 xml:id="sec-user-sessions">
66 <title>User Sessions</title>
77 <para>
8− Systemd keeps track of all users who are logged into the system (e.g. on a
9− virtual console or remotely via SSH). The command <command>loginctl</command>
10− allows querying and manipulating user sessions. For instance, to list all
11− user sessions:
8+ Systemd keeps track of all users who are logged into the system (e.g. on a virtual console or remotely via SSH). The command <command>loginctl</command> allows querying and manipulating user sessions. For instance, to list all user sessions:
129<screen>
1310<prompt>$ </prompt>loginctl
1411 SESSION UID USER SEAT
@@ -16,10 +13,7 @@
1613 c3 0 root seat0
1714 c4 500 alice
1815</screen>
19− This shows that two users are logged in locally, while another is logged in
20− remotely. (“Seats” are essentially the combinations of displays and input
21− devices attached to the system; usually, there is only one seat.) To get
22− information about a session:
16+ This shows that two users are logged in locally, while another is logged in remotely. (“Seats” are essentially the combinations of displays and input devices attached to the system; usually, there is only one seat.) To get information about a session:
2317<screen>
2418<prompt>$ </prompt>loginctl session-status c3
2519c3 - root (0)
@@ -34,10 +28,7 @@ c3 - root (0)
3428 ├─10339 -bash
3529 └─10355 w3m nixos.org
3630</screen>
37− This shows that the user is logged in on virtual console 3. It also lists the
38− processes belonging to this session. Since systemd keeps track of this, you
39− can terminate a session in a way that ensures that all the session’s
40− processes are gone:
31+ This shows that the user is logged in on virtual console 3. It also lists the processes belonging to this session. Since systemd keeps track of this, you can terminate a session in a way that ensures that all the session’s processes are gone:
4132<screen>
4233# loginctl terminate-session c3
4334</screen>
nixos/doc/manual/configuration/abstractions.xml+12−36
@@ -6,8 +6,7 @@
66 <title>Abstractions</title>
77
88 <para>
9− If you find yourself repeating yourself over and over, it’s time to
10− abstract. Take, for instance, this Apache HTTP Server configuration:
9+ If you find yourself repeating yourself over and over, it’s time to abstract. Take, for instance, this Apache HTTP Server configuration:
1110<programlisting>
1211{
1312 <xref linkend="opt-services.httpd.virtualHosts"/> =
@@ -27,9 +26,7 @@
2726 ];
2827}
2928</programlisting>
30− It defines two virtual hosts with nearly identical configuration; the only
31− difference is that the second one has SSL enabled. To prevent this
32− duplication, we can use a <literal>let</literal>:
29+ It defines two virtual hosts with nearly identical configuration; the only difference is that the second one has SSL enabled. To prevent this duplication, we can use a <literal>let</literal>:
3330<programlisting>
3431let
3532 exampleOrgCommon =
@@ -50,16 +47,11 @@ in
5047 ];
5148}
5249</programlisting>
53− The <literal>let exampleOrgCommon = <replaceable>...</replaceable></literal>
54− defines a variable named <literal>exampleOrgCommon</literal>. The
55− <literal>//</literal> operator merges two attribute sets, so the
56− configuration of the second virtual host is the set
57− <literal>exampleOrgCommon</literal> extended with the SSL options.
50+ The <literal>let exampleOrgCommon = <replaceable>...</replaceable></literal> defines a variable named <literal>exampleOrgCommon</literal>. The <literal>//</literal> operator merges two attribute sets, so the configuration of the second virtual host is the set <literal>exampleOrgCommon</literal> extended with the SSL options.
5851 </para>
5952
6053 <para>
61− You can write a <literal>let</literal> wherever an expression is allowed.
62− Thus, you also could have written:
54+ You can write a <literal>let</literal> wherever an expression is allowed. Thus, you also could have written:
6355<programlisting>
6456{
6557 <xref linkend="opt-services.httpd.virtualHosts"/> =
@@ -69,16 +61,11 @@ in
6961 ];
7062}
7163</programlisting>
72− but not <literal>{ let exampleOrgCommon = <replaceable>...</replaceable>; in
73− <replaceable>...</replaceable>; }</literal> since attributes (as opposed to
74− attribute values) are not expressions.
64+ but not <literal>{ let exampleOrgCommon = <replaceable>...</replaceable>; in <replaceable>...</replaceable>; }</literal> since attributes (as opposed to attribute values) are not expressions.
7565 </para>
7666
7767 <para>
78− <emphasis>Functions</emphasis> provide another method of abstraction. For
79− instance, suppose that we want to generate lots of different virtual hosts,
80− all with identical configuration except for the host name. This can be done
81− as follows:
68+ <emphasis>Functions</emphasis> provide another method of abstraction. For instance, suppose that we want to generate lots of different virtual hosts, all with identical configuration except for the host name. This can be done as follows:
8269<programlisting>
8370{
8471 <xref linkend="opt-services.httpd.virtualHosts"/> =
@@ -96,15 +83,11 @@ in
9683 ];
9784}
9885</programlisting>
99− Here, <varname>makeVirtualHost</varname> is a function that takes a single
100− argument <literal>name</literal> and returns the configuration for a virtual
101− host. That function is then called for several names to produce the list of
102− virtual host configurations.
86+ Here, <varname>makeVirtualHost</varname> is a function that takes a single argument <literal>name</literal> and returns the configuration for a virtual host. That function is then called for several names to produce the list of virtual host configurations.
10387 </para>
10488
10589 <para>
106− We can further improve on this by using the function <varname>map</varname>,
107− which applies another function to every element in a list:
90+ We can further improve on this by using the function <varname>map</varname>, which applies another function to every element in a list:
10891<programlisting>
10992{
11093 <xref linkend="opt-services.httpd.virtualHosts"/> =
@@ -114,15 +97,11 @@ in
11497 [ "example.org" "example.com" "example.gov" "example.nl" ];
11598}
11699</programlisting>
117− (The function <literal>map</literal> is called a <emphasis>higher-order
118− function</emphasis> because it takes another function as an argument.)
100+ (The function <literal>map</literal> is called a <emphasis>higher-order function</emphasis> because it takes another function as an argument.)
119101 </para>
120102
121103 <para>
122− What if you need more than one argument, for instance, if we want to use a
123− different <literal>documentRoot</literal> for each virtual host? Then we can
124− make <varname>makeVirtualHost</varname> a function that takes a
125− <emphasis>set</emphasis> as its argument, like this:
104+ What if you need more than one argument, for instance, if we want to use a different <literal>documentRoot</literal> for each virtual host? Then we can make <varname>makeVirtualHost</varname> a function that takes a <emphasis>set</emphasis> as its argument, like this:
126105<programlisting>
127106{
128107 <xref linkend="opt-services.httpd.virtualHosts"/> =
@@ -140,9 +119,7 @@ in
140119 ];
141120}
142121</programlisting>
143− But in this case (where every root is a subdirectory of
144− <filename>/sites</filename> named after the virtual host), it would have been
145− shorter to define <varname>makeVirtualHost</varname> as
122+ But in this case (where every root is a subdirectory of <filename>/sites</filename> named after the virtual host), it would have been shorter to define <varname>makeVirtualHost</varname> as
146123<programlisting>
147124makeVirtualHost = name:
148125 { hostName = name;
@@ -150,7 +127,6 @@ makeVirtualHost = name:
150127 adminAddr = "alice@example.org";
151128 };
152129</programlisting>
153− Here, the construct <literal>${<replaceable>...</replaceable>}</literal>
154− allows the result of an expression to be spliced into a string.
130+ Here, the construct <literal>${<replaceable>...</replaceable>}</literal> allows the result of an expression to be spliced into a string.
155131 </para>
156132</section>
nixos/doc/manual/configuration/ad-hoc-network-config.xml+1−4
@@ -6,10 +6,7 @@
66 <title>Ad-Hoc Configuration</title>
77
88 <para>
9− You can use <xref linkend="opt-networking.localCommands"/> to specify shell
10− commands to be run at the end of <literal>network-setup.service</literal>.
11− This is useful for doing network configuration not covered by the existing
12− NixOS modules. For instance, to statically configure an IPv6 address:
9+ You can use <xref linkend="opt-networking.localCommands"/> to specify shell commands to be run at the end of <literal>network-setup.service</literal>. This is useful for doing network configuration not covered by the existing NixOS modules. For instance, to statically configure an IPv6 address:
1310<programlisting>
1411<xref linkend="opt-networking.localCommands"/> =
1512 ''
nixos/doc/manual/configuration/ad-hoc-packages.xml+5−21
@@ -6,33 +6,18 @@
66 <title>Ad-Hoc Package Management</title>
77
88 <para>
9− With the command <command>nix-env</command>, you can install and uninstall
10− packages from the command line. For instance, to install Mozilla Thunderbird:
9+ With the command <command>nix-env</command>, you can install and uninstall packages from the command line. For instance, to install Mozilla Thunderbird:
1110<screen>
1211<prompt>$ </prompt>nix-env -iA nixos.thunderbird</screen>
13− If you invoke this as root, the package is installed in the Nix profile
14− <filename>/nix/var/nix/profiles/default</filename> and visible to all users
15− of the system; otherwise, the package ends up in
16− <filename>/nix/var/nix/profiles/per-user/<replaceable>username</replaceable>/profile</filename>
17− and is not visible to other users. The <option>-A</option> flag specifies the
18− package by its attribute name; without it, the package is installed by
19− matching against its package name (e.g. <literal>thunderbird</literal>). The
20− latter is slower because it requires matching against all available Nix
21− packages, and is ambiguous if there are multiple matching packages.
12+ If you invoke this as root, the package is installed in the Nix profile <filename>/nix/var/nix/profiles/default</filename> and visible to all users of the system; otherwise, the package ends up in <filename>/nix/var/nix/profiles/per-user/<replaceable>username</replaceable>/profile</filename> and is not visible to other users. The <option>-A</option> flag specifies the package by its attribute name; without it, the package is installed by matching against its package name (e.g. <literal>thunderbird</literal>). The latter is slower because it requires matching against all available Nix packages, and is ambiguous if there are multiple matching packages.
2213 </para>
2314
2415 <para>
25− Packages come from the NixOS channel. You typically upgrade a package by
26− updating to the latest version of the NixOS channel:
16+ Packages come from the NixOS channel. You typically upgrade a package by updating to the latest version of the NixOS channel:
2717<screen>
2818<prompt>$ </prompt>nix-channel --update nixos
2919</screen>
30− and then running <literal>nix-env -i</literal> again. Other packages in the
31− profile are <emphasis>not</emphasis> affected; this is the crucial difference
32− with the declarative style of package management, where running
33− <command>nixos-rebuild switch</command> causes all packages to be updated to
34− their current versions in the NixOS channel. You can however upgrade all
35− packages for which there is a newer version by doing:
20+ and then running <literal>nix-env -i</literal> again. Other packages in the profile are <emphasis>not</emphasis> affected; this is the crucial difference with the declarative style of package management, where running <command>nixos-rebuild switch</command> causes all packages to be updated to their current versions in the NixOS channel. You can however upgrade all packages for which there is a newer version by doing:
3621<screen>
3722<prompt>$ </prompt>nix-env -u '*'
3823</screen>
@@ -53,8 +38,7 @@
5338 </para>
5439
5540 <para>
56− <command>nix-env</command> has many more flags. For details, see the
57− <citerefentry>
41+ <command>nix-env</command> has many more flags. For details, see the <citerefentry>
5842 <refentrytitle>nix-env</refentrytitle>
5943 <manvolnum>1</manvolnum></citerefentry> manpage or the Nix manual.
6044 </para>
nixos/doc/manual/configuration/adding-custom-packages.xml+6−17
@@ -6,33 +6,23 @@
66 <title>Adding Custom Packages</title>
77
88 <para>
9− It’s possible that a package you need is not available in NixOS. In that
10− case, you can do two things. First, you can clone the Nixpkgs repository, add
11− the package to your clone, and (optionally) submit a patch or pull request to
12− have it accepted into the main Nixpkgs repository. This is described in
13− detail in the <link
14−xlink:href="http://nixos.org/nixpkgs/manual">Nixpkgs
15− manual</link>. In short, you clone Nixpkgs:
9+ It’s possible that a package you need is not available in NixOS. In that case, you can do two things. First, you can clone the Nixpkgs repository, add the package to your clone, and (optionally) submit a patch or pull request to have it accepted into the main Nixpkgs repository. This is described in detail in the <link
10+xlink:href="http://nixos.org/nixpkgs/manual">Nixpkgs manual</link>. In short, you clone Nixpkgs:
1611<screen>
1712<prompt>$ </prompt>git clone https://github.com/NixOS/nixpkgs
1813<prompt>$ </prompt>cd nixpkgs
1914</screen>
20− Then you write and test the package as described in the Nixpkgs manual.
21− Finally, you add it to <literal>environment.systemPackages</literal>, e.g.
15+ Then you write and test the package as described in the Nixpkgs manual. Finally, you add it to <literal>environment.systemPackages</literal>, e.g.
2216<programlisting>
2317<xref linkend="opt-environment.systemPackages"/> = [ pkgs.my-package ];
2418</programlisting>
25− and you run <command>nixos-rebuild</command>, specifying your own Nixpkgs
26− tree:
19+ and you run <command>nixos-rebuild</command>, specifying your own Nixpkgs tree:
2720<screen>
2821# nixos-rebuild switch -I nixpkgs=/path/to/my/nixpkgs</screen>
2922 </para>
3023
3124 <para>
32− The second possibility is to add the package outside of the Nixpkgs tree. For
33− instance, here is how you specify a build of the
34− <link xlink:href="https://www.gnu.org/software/hello/">GNU Hello</link>
35− package directly in <filename>configuration.nix</filename>:
25+ The second possibility is to add the package outside of the Nixpkgs tree. For instance, here is how you specify a build of the <link xlink:href="https://www.gnu.org/software/hello/">GNU Hello</link> package directly in <filename>configuration.nix</filename>:
3626<programlisting>
3727<xref linkend="opt-environment.systemPackages"/> =
3828 let
@@ -46,8 +36,7 @@ xlink:href="http://nixos.org/nixpkgs/manual">Nixpkgs
4636 in
4737 [ my-hello ];
4838</programlisting>
49− Of course, you can also move the definition of <literal>my-hello</literal>
50− into a separate Nix expression, e.g.
39+ Of course, you can also move the definition of <literal>my-hello</literal> into a separate Nix expression, e.g.
5140<programlisting>
5241<xref linkend="opt-environment.systemPackages"/> = [ (import ./my-hello.nix) ];
5342</programlisting>
nixos/doc/manual/configuration/config-file.xml+14−57
@@ -13,15 +13,7 @@
1313{ <replaceable>option definitions</replaceable>
1414}
1515</programlisting>
16− The first line (<literal>{ config, pkgs, ... }:</literal>) denotes that this
17− is actually a function that takes at least the two arguments
18− <varname>config</varname> and <varname>pkgs</varname>. (These are explained
19− later.) The function returns a <emphasis>set</emphasis> of option definitions
20− (<literal>{ <replaceable>...</replaceable> }</literal>). These definitions
21− have the form <literal><replaceable>name</replaceable> =
22− <replaceable>value</replaceable></literal>, where
23− <replaceable>name</replaceable> is the name of an option and
24− <replaceable>value</replaceable> is its value. For example,
16+ The first line (<literal>{ config, pkgs, ... }:</literal>) denotes that this is actually a function that takes at least the two arguments <varname>config</varname> and <varname>pkgs</varname>. (These are explained later.) The function returns a <emphasis>set</emphasis> of option definitions (<literal>{ <replaceable>...</replaceable> }</literal>). These definitions have the form <literal><replaceable>name</replaceable> = <replaceable>value</replaceable></literal>, where <replaceable>name</replaceable> is the name of an option and <replaceable>value</replaceable> is its value. For example,
2517<programlisting>
2618{ config, pkgs, ... }:
2719
@@ -30,19 +22,11 @@
3022 <xref linkend="opt-services.httpd.documentRoot"/> = "/webroot";
3123}
3224</programlisting>
33− defines a configuration with three option definitions that together enable
34− the Apache HTTP Server with <filename>/webroot</filename> as the document
35− root.
25+ defines a configuration with three option definitions that together enable the Apache HTTP Server with <filename>/webroot</filename> as the document root.
3626 </para>
3727
3828 <para>
39− Sets can be nested, and in fact dots in option names are shorthand for
40− defining a set containing another set. For instance,
41− <xref linkend="opt-services.httpd.enable"/> defines a set named
42− <varname>services</varname> that contains a set named
43− <varname>httpd</varname>, which in turn contains an option definition named
44− <varname>enable</varname> with value <literal>true</literal>. This means that
45− the example above can also be written as:
29+ Sets can be nested, and in fact dots in option names are shorthand for defining a set containing another set. For instance, <xref linkend="opt-services.httpd.enable"/> defines a set named <varname>services</varname> that contains a set named <varname>httpd</varname>, which in turn contains an option definition named <varname>enable</varname> with value <literal>true</literal>. This means that the example above can also be written as:
4630<programlisting>
4731{ config, pkgs, ... }:
4832
@@ -55,22 +39,15 @@
5539 };
5640}
5741</programlisting>
58− which may be more convenient if you have lots of option definitions that
59− share the same prefix (such as <literal>services.httpd</literal>).
42+ which may be more convenient if you have lots of option definitions that share the same prefix (such as <literal>services.httpd</literal>).
6043 </para>
6144
6245 <para>
63− NixOS checks your option definitions for correctness. For instance, if you
64− try to define an option that doesn’t exist (that is, doesn’t have a
65− corresponding <emphasis>option declaration</emphasis>),
66− <command>nixos-rebuild</command> will give an error like:
46+ NixOS checks your option definitions for correctness. For instance, if you try to define an option that doesn’t exist (that is, doesn’t have a corresponding <emphasis>option declaration</emphasis>), <command>nixos-rebuild</command> will give an error like:
6747<screen>
6848The option `services.httpd.enable' defined in `/etc/nixos/configuration.nix' does not exist.
6949</screen>
70− Likewise, values in option definitions must have a correct type. For
71− instance, <option>services.httpd.enable</option> must be a Boolean
72− (<literal>true</literal> or <literal>false</literal>). Trying to give it a
73− value of another type, such as a string, will cause an error:
50+ Likewise, values in option definitions must have a correct type. For instance, <option>services.httpd.enable</option> must be a Boolean (<literal>true</literal> or <literal>false</literal>). Trying to give it a value of another type, such as a string, will cause an error:
7451<screen>
7552The option value `services.httpd.enable' in `/etc/nixos/configuration.nix' is not a boolean.
7653</screen>
@@ -89,12 +66,10 @@ The option value `services.httpd.enable' in `/etc/nixos/configuration.nix' is no
8966<programlisting>
9067<xref linkend="opt-networking.hostName"/> = "dexter";
9168</programlisting>
92− Special characters can be escaped by prefixing them with a backslash
93− (e.g. <literal>\"</literal>).
69+ Special characters can be escaped by prefixing them with a backslash (e.g. <literal>\"</literal>).
9470 </para>
9571 <para>
96− Multi-line strings can be enclosed in <emphasis>double single
97− quotes</emphasis>, e.g.
72+ Multi-line strings can be enclosed in <emphasis>double single quotes</emphasis>, e.g.
9873<programlisting>
9974<xref linkend="opt-networking.extraHosts"/> =
10075 ''
@@ -102,13 +77,7 @@ The option value `services.httpd.enable' in `/etc/nixos/configuration.nix' is no
10277 10.0.0.1 server
10378 '';
10479</programlisting>
105− The main difference is that it strips from each line a number of spaces
106− equal to the minimal indentation of the string as a whole (disregarding
107− the indentation of empty lines), and that characters like
108− <literal>"</literal> and <literal>\</literal> are not special (making it
109− more convenient for including things like shell code). See more info
110− about this in the Nix manual
111− <link
80+ The main difference is that it strips from each line a number of spaces equal to the minimal indentation of the string as a whole (disregarding the indentation of empty lines), and that characters like <literal>"</literal> and <literal>\</literal> are not special (making it more convenient for including things like shell code). See more info about this in the Nix manual <link
11281 xlink:href="https://nixos.org/nix/manual/#ssec-values">here</link>.
11382 </para>
11483 </listitem>
@@ -137,12 +106,7 @@ The option value `services.httpd.enable' in `/etc/nixos/configuration.nix' is no
137106<programlisting>
138107<xref linkend="opt-boot.kernel.sysctl"/>."net.ipv4.tcp_keepalive_time" = 60;
139108</programlisting>
140− (Note that here the attribute name
141− <literal>net.ipv4.tcp_keepalive_time</literal> is enclosed in quotes to
142− prevent it from being interpreted as a set named <literal>net</literal>
143− containing a set named <literal>ipv4</literal>, and so on. This is
144− because it’s not a NixOS option but the literal name of a Linux kernel
145− setting.)
109+ (Note that here the attribute name <literal>net.ipv4.tcp_keepalive_time</literal> is enclosed in quotes to prevent it from being interpreted as a set named <literal>net</literal> containing a set named <literal>ipv4</literal>, and so on. This is because it’s not a NixOS option but the literal name of a Linux kernel setting.)
146110 </para>
147111 </listitem>
148112 </varlistentry>
@@ -152,8 +116,7 @@ The option value `services.httpd.enable' in `/etc/nixos/configuration.nix' is no
152116 </term>
153117 <listitem>
154118 <para>
155− Sets were introduced above. They are name/value pairs enclosed in braces,
156− as in the option definition
119+ Sets were introduced above. They are name/value pairs enclosed in braces, as in the option definition
157120<programlisting>
158121<xref linkend="opt-fileSystems"/>."/boot" =
159122 { device = "/dev/sda1";
@@ -170,8 +133,7 @@ The option value `services.httpd.enable' in `/etc/nixos/configuration.nix' is no
170133 </term>
171134 <listitem>
172135 <para>
173− The important thing to note about lists is that list elements are
174− separated by whitespace, like this:
136+ The important thing to note about lists is that list elements are separated by whitespace, like this:
175137<programlisting>
176138<xref linkend="opt-boot.kernelModules"/> = [ "fuse" "kvm-intel" "coretemp" ];
177139</programlisting>
@@ -188,9 +150,7 @@ swapDevices = [ { device = "/dev/disk/by-label/swap"; } ];
188150 </term>
189151 <listitem>
190152 <para>
191− Usually, the packages you need are already part of the Nix Packages
192− collection, which is a set that can be accessed through the function
193− argument <varname>pkgs</varname>. Typical uses:
153+ Usually, the packages you need are already part of the Nix Packages collection, which is a set that can be accessed through the function argument <varname>pkgs</varname>. Typical uses:
194154<programlisting>
195155<xref linkend="opt-environment.systemPackages"/> =
196156 [ pkgs.thunderbird
@@ -199,10 +159,7 @@ swapDevices = [ { device = "/dev/disk/by-label/swap"; } ];
199159
200160<xref linkend="opt-services.postgresql.package"/> = pkgs.postgresql_10;
201161</programlisting>
202− The latter option definition changes the default PostgreSQL package used
203− by NixOS’s PostgreSQL service to 10.x. For more information on
204− packages, including how to add new ones, see
205− <xref linkend="sec-custom-packages"/>.
162+ The latter option definition changes the default PostgreSQL package used by NixOS’s PostgreSQL service to 10.x. For more information on packages, including how to add new ones, see <xref linkend="sec-custom-packages"/>.
206163 </para>
207164 </listitem>
208165 </varlistentry>
nixos/doc/manual/configuration/config-syntax.xml+2−12
@@ -5,18 +5,8 @@
55 xml:id="sec-configuration-syntax">
66 <title>Configuration Syntax</title>
77 <para>
8− The NixOS configuration file
9− <filename>/etc/nixos/configuration.nix</filename> is actually a <emphasis>Nix
10− expression</emphasis>, which is the Nix package manager’s purely functional
11− language for describing how to build packages and configurations. This means
12− you have all the expressive power of that language at your disposal,
13− including the ability to abstract over common patterns, which is very useful
14− when managing complex systems. The syntax and semantics of the Nix language
15− are fully described in the
16− <link
17−xlink:href="http://nixos.org/nix/manual/#chap-writing-nix-expressions">Nix
18− manual</link>, but here we give a short overview of the most important
19− constructs useful in NixOS configuration files.
8+ The NixOS configuration file <filename>/etc/nixos/configuration.nix</filename> is actually a <emphasis>Nix expression</emphasis>, which is the Nix package manager’s purely functional language for describing how to build packages and configurations. This means you have all the expressive power of that language at your disposal, including the ability to abstract over common patterns, which is very useful when managing complex systems. The syntax and semantics of the Nix language are fully described in the <link
9+xlink:href="http://nixos.org/nix/manual/#chap-writing-nix-expressions">Nix manual</link>, but here we give a short overview of the most important constructs useful in NixOS configuration files.
2010 </para>
2111 <xi:include href="config-file.xml" />
2212 <xi:include href="abstractions.xml" />
nixos/doc/manual/configuration/configuration.xml+1−5
@@ -6,11 +6,7 @@
66 <title>Configuration</title>
77 <partintro xml:id="ch-configuration-intro">
88 <para>
9− This chapter describes how to configure various aspects of a NixOS machine
10− through the configuration file
11− <filename>/etc/nixos/configuration.nix</filename>. As described in
12− <xref linkend="sec-changing-config" />, changes to this file only take
13− effect after you run <command>nixos-rebuild</command>.
9+ This chapter describes how to configure various aspects of a NixOS machine through the configuration file <filename>/etc/nixos/configuration.nix</filename>. As described in <xref linkend="sec-changing-config" />, changes to this file only take effect after you run <command>nixos-rebuild</command>.
1410 </para>
1511 </partintro>
1612 <xi:include href="config-syntax.xml" />
nixos/doc/manual/configuration/customizing-packages.xml+8−46
@@ -6,47 +6,25 @@
66 <title>Customising Packages</title>
77
88 <para>
9− Some packages in Nixpkgs have options to enable or disable optional
10− functionality or change other aspects of the package. For instance, the
11− Firefox wrapper package (which provides Firefox with a set of plugins such as
12− the Adobe Flash player) has an option to enable the Google Talk plugin. It
13− can be set in <filename>configuration.nix</filename> as follows: <filename>
14− nixpkgs.config.firefox.enableGoogleTalkPlugin = true; </filename>
9+ Some packages in Nixpkgs have options to enable or disable optional functionality or change other aspects of the package. For instance, the Firefox wrapper package (which provides Firefox with a set of plugins such as the Adobe Flash player) has an option to enable the Google Talk plugin. It can be set in <filename>configuration.nix</filename> as follows: <filename> nixpkgs.config.firefox.enableGoogleTalkPlugin = true; </filename>
1510 </para>
1611
1712 <warning>
1813 <para>
19− Unfortunately, Nixpkgs currently lacks a way to query available
20− configuration options.
14+ Unfortunately, Nixpkgs currently lacks a way to query available configuration options.
2115 </para>
2216 </warning>
2317
2418 <para>
25− Apart from high-level options, it’s possible to tweak a package in almost
26− arbitrary ways, such as changing or disabling dependencies of a package. For
27− instance, the Emacs package in Nixpkgs by default has a dependency on GTK 2.
28− If you want to build it against GTK 3, you can specify that as follows:
19+ Apart from high-level options, it’s possible to tweak a package in almost arbitrary ways, such as changing or disabling dependencies of a package. For instance, the Emacs package in Nixpkgs by default has a dependency on GTK 2. If you want to build it against GTK 3, you can specify that as follows:
2920<programlisting>
3021<xref linkend="opt-environment.systemPackages"/> = [ (pkgs.emacs.override { gtk = pkgs.gtk3; }) ];
3122</programlisting>
32− The function <varname>override</varname> performs the call to the Nix
33− function that produces Emacs, with the original arguments amended by the set
34− of arguments specified by you. So here the function argument
35− <varname>gtk</varname> gets the value <literal>pkgs.gtk3</literal>, causing
36− Emacs to depend on GTK 3. (The parentheses are necessary because in Nix,
37− function application binds more weakly than list construction, so without
38− them, <xref linkend="opt-environment.systemPackages"/> would be a list with
39− two elements.)
23+ The function <varname>override</varname> performs the call to the Nix function that produces Emacs, with the original arguments amended by the set of arguments specified by you. So here the function argument <varname>gtk</varname> gets the value <literal>pkgs.gtk3</literal>, causing Emacs to depend on GTK 3. (The parentheses are necessary because in Nix, function application binds more weakly than list construction, so without them, <xref linkend="opt-environment.systemPackages"/> would be a list with two elements.)
4024 </para>
4125
4226 <para>
43− Even greater customisation is possible using the function
44− <varname>overrideAttrs</varname>. While the <varname>override</varname>
45− mechanism above overrides the arguments of a package function,
46− <varname>overrideAttrs</varname> allows changing the
47− <emphasis>attributes</emphasis> passed to <literal>mkDerivation</literal>.
48− This permits changing any aspect of the package, such as the source code. For
49− instance, if you want to override the source code of Emacs, you can say:
27+ Even greater customisation is possible using the function <varname>overrideAttrs</varname>. While the <varname>override</varname> mechanism above overrides the arguments of a package function, <varname>overrideAttrs</varname> allows changing the <emphasis>attributes</emphasis> passed to <literal>mkDerivation</literal>. This permits changing any aspect of the package, such as the source code. For instance, if you want to override the source code of Emacs, you can say:
5028<programlisting>
5129<xref linkend="opt-environment.systemPackages"/> = [
5230 (pkgs.emacs.overrideAttrs (oldAttrs: {
@@ -55,32 +33,16 @@
5533 }))
5634];
5735</programlisting>
58− Here, <varname>overrideAttrs</varname> takes the Nix derivation specified by
59− <varname>pkgs.emacs</varname> and produces a new derivation in which the
60− original’s <literal>name</literal> and <literal>src</literal> attribute
61− have been replaced by the given values by re-calling
62− <literal>stdenv.mkDerivation</literal>. The original attributes are
63− accessible via the function argument, which is conventionally named
64− <varname>oldAttrs</varname>.
36+ Here, <varname>overrideAttrs</varname> takes the Nix derivation specified by <varname>pkgs.emacs</varname> and produces a new derivation in which the original’s <literal>name</literal> and <literal>src</literal> attribute have been replaced by the given values by re-calling <literal>stdenv.mkDerivation</literal>. The original attributes are accessible via the function argument, which is conventionally named <varname>oldAttrs</varname>.
6537 </para>
6638
6739 <para>
68− The overrides shown above are not global. They do not affect the original
69− package; other packages in Nixpkgs continue to depend on the original rather
70− than the customised package. This means that if another package in your
71− system depends on the original package, you end up with two instances of the
72− package. If you want to have everything depend on your customised instance,
73− you can apply a <emphasis>global</emphasis> override as follows:
40+ The overrides shown above are not global. They do not affect the original package; other packages in Nixpkgs continue to depend on the original rather than the customised package. This means that if another package in your system depends on the original package, you end up with two instances of the package. If you want to have everything depend on your customised instance, you can apply a <emphasis>global</emphasis> override as follows:
7441<screen>
7542nixpkgs.config.packageOverrides = pkgs:
7643 { emacs = pkgs.emacs.override { gtk = pkgs.gtk3; };
7744 };
7845</screen>
79− The effect of this definition is essentially equivalent to modifying the
80− <literal>emacs</literal> attribute in the Nixpkgs source tree. Any package in
81− Nixpkgs that depends on <literal>emacs</literal> will be passed your
82− customised instance. (However, the value <literal>pkgs.emacs</literal> in
83− <varname>nixpkgs.config.packageOverrides</varname> refers to the original
84− rather than overridden instance, to prevent an infinite recursion.)
46+ The effect of this definition is essentially equivalent to modifying the <literal>emacs</literal> attribute in the Nixpkgs source tree. Any package in Nixpkgs that depends on <literal>emacs</literal> will be passed your customised instance. (However, the value <literal>pkgs.emacs</literal> in <varname>nixpkgs.config.packageOverrides</varname> refers to the original rather than overridden instance, to prevent an infinite recursion.)
8547 </para>
8648</section>
nixos/doc/manual/configuration/declarative-packages.xml+6−17
@@ -6,17 +6,11 @@
66 <title>Declarative Package Management</title>
77
88 <para>
9− With declarative package management, you specify which packages you want on
10− your system by setting the option
11− <xref linkend="opt-environment.systemPackages"/>. For instance, adding the
12− following line to <filename>configuration.nix</filename> enables the Mozilla
13− Thunderbird email application:
9+ With declarative package management, you specify which packages you want on your system by setting the option <xref linkend="opt-environment.systemPackages"/>. For instance, adding the following line to <filename>configuration.nix</filename> enables the Mozilla Thunderbird email application:
1410<programlisting>
1511<xref linkend="opt-environment.systemPackages"/> = [ pkgs.thunderbird ];
1612</programlisting>
17− The effect of this specification is that the Thunderbird package from Nixpkgs
18− will be built or downloaded as part of the system when you run
19− <command>nixos-rebuild switch</command>.
13+ The effect of this specification is that the Thunderbird package from Nixpkgs will be built or downloaded as part of the system when you run <command>nixos-rebuild switch</command>.
2014 </para>
2115
2216 <para>
@@ -26,20 +20,15 @@
2620nixos.firefox firefox-23.0 Mozilla Firefox - the browser, reloaded
2721<replaceable>...</replaceable>
2822</screen>
29− The first column in the output is the <emphasis>attribute name</emphasis>,
30− such as <literal>nixos.thunderbird</literal>.
23+ The first column in the output is the <emphasis>attribute name</emphasis>, such as <literal>nixos.thunderbird</literal>.
3124 </para>
32− <para>
33− Note: the <literal>nixos</literal> prefix tells us that we want to get the
34− package from the <literal>nixos</literal> channel and works only in CLI tools.
3525
36− In declarative configuration use <literal>pkgs</literal> prefix (variable).
26+ <para>
27+ Note: the <literal>nixos</literal> prefix tells us that we want to get the package from the <literal>nixos</literal> channel and works only in CLI tools. In declarative configuration use <literal>pkgs</literal> prefix (variable).
3728 </para>
3829
3930 <para>
40− To “uninstall” a package, simply remove it from
41− <xref linkend="opt-environment.systemPackages"/> and run
42− <command>nixos-rebuild switch</command>.
31+ To “uninstall” a package, simply remove it from <xref linkend="opt-environment.systemPackages"/> and run <command>nixos-rebuild switch</command>.
4332 </para>
4433
4534 <xi:include href="customizing-packages.xml" />
nixos/doc/manual/configuration/file-systems.xml+4−24
@@ -5,41 +5,21 @@
55 xml:id="ch-file-systems">
66 <title>File Systems</title>
77 <para>
8− You can define file systems using the <option>fileSystems</option>
9− configuration option. For instance, the following definition causes NixOS to
10− mount the Ext4 file system on device
11− <filename>/dev/disk/by-label/data</filename> onto the mount point
12− <filename>/data</filename>:
8+ You can define file systems using the <option>fileSystems</option> configuration option. For instance, the following definition causes NixOS to mount the Ext4 file system on device <filename>/dev/disk/by-label/data</filename> onto the mount point <filename>/data</filename>:
139<programlisting>
1410<xref linkend="opt-fileSystems"/>."/data" =
1511 { device = "/dev/disk/by-label/data";
1612 fsType = "ext4";
1713 };
1814</programlisting>
19− Mount points are created automatically if they don’t already exist. For
20− <option><link linkend="opt-fileSystems._name__.device">device</link></option>,
21− it’s best to use the topology-independent device aliases in
22− <filename>/dev/disk/by-label</filename> and
23− <filename>/dev/disk/by-uuid</filename>, as these don’t change if the
24− topology changes (e.g. if a disk is moved to another IDE controller).
15+ Mount points are created automatically if they don’t already exist. For <option><link linkend="opt-fileSystems._name__.device">device</link></option>, it’s best to use the topology-independent device aliases in <filename>/dev/disk/by-label</filename> and <filename>/dev/disk/by-uuid</filename>, as these don’t change if the topology changes (e.g. if a disk is moved to another IDE controller).
2516 </para>
2617 <para>
27− You can usually omit the file system type
28− (<option><link linkend="opt-fileSystems._name__.fsType">fsType</link></option>),
29− since <command>mount</command> can usually detect the type and load the
30− necessary kernel module automatically. However, if the file system is needed
31− at early boot (in the initial ramdisk) and is not <literal>ext2</literal>,
32− <literal>ext3</literal> or <literal>ext4</literal>, then it’s best to
33− specify <option>fsType</option> to ensure that the kernel module is
34− available.
18+ You can usually omit the file system type (<option><link linkend="opt-fileSystems._name__.fsType">fsType</link></option>), since <command>mount</command> can usually detect the type and load the necessary kernel module automatically. However, if the file system is needed at early boot (in the initial ramdisk) and is not <literal>ext2</literal>, <literal>ext3</literal> or <literal>ext4</literal>, then it’s best to specify <option>fsType</option> to ensure that the kernel module is available.
3519 </para>
3620 <note>
3721 <para>
38− System startup will fail if any of the filesystems fails to mount, dropping
39− you to the emergency shell. You can make a mount asynchronous and
40− non-critical by adding
41− <literal><link linkend="opt-fileSystems._name__.options">options</link> = [
42− "nofail" ];</literal>.
22+ System startup will fail if any of the filesystems fails to mount, dropping you to the emergency shell. You can make a mount asynchronous and non-critical by adding <literal><link linkend="opt-fileSystems._name__.options">options</link> = [ "nofail" ];</literal>.
4323 </para>
4424 </note>
4525 <xi:include href="luks-file-systems.xml" />
nixos/doc/manual/configuration/firewall.xml+4−11
@@ -6,21 +6,15 @@
66 <title>Firewall</title>
77
88 <para>
9− NixOS has a simple stateful firewall that blocks incoming connections and
10− other unexpected packets. The firewall applies to both IPv4 and IPv6 traffic.
11− It is enabled by default. It can be disabled as follows:
9+ NixOS has a simple stateful firewall that blocks incoming connections and other unexpected packets. The firewall applies to both IPv4 and IPv6 traffic. It is enabled by default. It can be disabled as follows:
1210<programlisting>
1311<xref linkend="opt-networking.firewall.enable"/> = false;
1412</programlisting>
15− If the firewall is enabled, you can open specific TCP ports to the outside
16− world:
13+ If the firewall is enabled, you can open specific TCP ports to the outside world:
1714<programlisting>
1815<xref linkend="opt-networking.firewall.allowedTCPPorts"/> = [ 80 443 ];
1916</programlisting>
20− Note that TCP port 22 (ssh) is opened automatically if the SSH daemon is
21− enabled (<option><xref linkend="opt-services.openssh.enable"/> =
22− true</option>). UDP ports can be opened through
23− <xref linkend="opt-networking.firewall.allowedUDPPorts"/>.
17+ Note that TCP port 22 (ssh) is opened automatically if the SSH daemon is enabled (<option><xref linkend="opt-services.openssh.enable"/> = true</option>). UDP ports can be opened through <xref linkend="opt-networking.firewall.allowedUDPPorts"/>.
2418 </para>
2519
2620 <para>
@@ -31,7 +25,6 @@
3125 { from = 8000; to = 8010; }
3226];
3327</programlisting>
34− Similarly, UDP port ranges can be opened through
35− <xref linkend="opt-networking.firewall.allowedUDPPortRanges"/>.
28+ Similarly, UDP port ranges can be opened through <xref linkend="opt-networking.firewall.allowedUDPPortRanges"/>.
3629 </para>
3730</section>
nixos/doc/manual/configuration/ipv4-config.xml+4−11
@@ -6,17 +6,14 @@
66 <title>IPv4 Configuration</title>
77
88 <para>
9− By default, NixOS uses DHCP (specifically, <command>dhcpcd</command>) to
10− automatically configure network interfaces. However, you can configure an
11− interface manually as follows:
9+ By default, NixOS uses DHCP (specifically, <command>dhcpcd</command>) to automatically configure network interfaces. However, you can configure an interface manually as follows:
1210<programlisting>
1311<link linkend="opt-networking.interfaces._name__.ipv4.addresses">networking.interfaces.eth0.ipv4.addresses</link> = [ {
1412 address = "192.168.1.2";
1513 prefixLength = 24;
1614} ];
1715</programlisting>
18− Typically you’ll also want to set a default gateway and set of name
19− servers:
16+ Typically you’ll also want to set a default gateway and set of name servers:
2017<programlisting>
2118<xref linkend="opt-networking.defaultGateway"/> = "192.168.1.1";
2219<xref linkend="opt-networking.nameservers"/> = [ "8.8.8.8" ];
@@ -25,10 +22,7 @@
2522
2623 <note>
2724 <para>
28− Statically configured interfaces are set up by the systemd service
29− <replaceable>interface-name</replaceable><literal>-cfg.service</literal>.
30− The default gateway and name server configuration is performed by
31− <literal>network-setup.service</literal>.
25+ Statically configured interfaces are set up by the systemd service <replaceable>interface-name</replaceable><literal>-cfg.service</literal>. The default gateway and name server configuration is performed by <literal>network-setup.service</literal>.
3226 </para>
3327 </note>
3428
@@ -37,7 +31,6 @@
3731<programlisting>
3832<xref linkend="opt-networking.hostName"/> = "cartman";
3933</programlisting>
40− The default host name is <literal>nixos</literal>. Set it to the empty string
41− (<literal>""</literal>) to allow the DHCP server to provide the host name.
34+ The default host name is <literal>nixos</literal>. Set it to the empty string (<literal>""</literal>) to allow the DHCP server to provide the host name.
4235 </para>
4336</section>
nixos/doc/manual/configuration/ipv6-config.xml+4−9
@@ -6,25 +6,21 @@
66 <title>IPv6 Configuration</title>
77
88 <para>
9− IPv6 is enabled by default. Stateless address autoconfiguration is used to
10− automatically assign IPv6 addresses to all interfaces. You can disable IPv6
11− support globally by setting:
9+ IPv6 is enabled by default. Stateless address autoconfiguration is used to automatically assign IPv6 addresses to all interfaces. You can disable IPv6 support globally by setting:
1210<programlisting>
1311<xref linkend="opt-networking.enableIPv6"/> = false;
1412</programlisting>
1513 </para>
1614
1715 <para>
18− You can disable IPv6 on a single interface using a normal sysctl (in this
19− example, we use interface <varname>eth0</varname>):
16+ You can disable IPv6 on a single interface using a normal sysctl (in this example, we use interface <varname>eth0</varname>):
2017<programlisting>
2118<xref linkend="opt-boot.kernel.sysctl"/>."net.ipv6.conf.eth0.disable_ipv6" = true;
2219</programlisting>
2320 </para>
2421
2522 <para>
26− As with IPv4 networking interfaces are automatically configured via DHCPv6.
27− You can configure an interface manually:
23+ As with IPv4 networking interfaces are automatically configured via DHCPv6. You can configure an interface manually:
2824<programlisting>
2925<link linkend="opt-networking.interfaces._name__.ipv6.addresses">networking.interfaces.eth0.ipv6.addresses</link> = [ {
3026 address = "fe00:aa:bb:cc::2";
@@ -44,7 +40,6 @@
4440 </para>
4541
4642 <para>
47− See <xref linkend='sec-ipv4' /> for similar examples and additional
48− information.
43+ See <xref linkend='sec-ipv4' /> for similar examples and additional information.
4944 </para>
5045</section>
nixos/doc/manual/configuration/kubernetes.xml+12−62
@@ -5,12 +5,10 @@
55 xml:id="sec-kubernetes">
66 <title>Kubernetes</title>
77 <para>
8− The NixOS Kubernetes module is a collective term for a handful of individual
9− submodules implementing the Kubernetes cluster components.
8+ The NixOS Kubernetes module is a collective term for a handful of individual submodules implementing the Kubernetes cluster components.
109 </para>
1110 <para>
12− There are generally two ways of enabling Kubernetes on NixOS. One way is to
13− enable and configure cluster components appropriately by hand:
11+ There are generally two ways of enabling Kubernetes on NixOS. One way is to enable and configure cluster components appropriately by hand:
1412<programlisting>
1513services.kubernetes = {
1614 apiserver.enable = true;
@@ -21,9 +19,7 @@ services.kubernetes = {
2119 flannel.enable = true;
2220};
2321</programlisting>
24− Another way is to assign cluster roles ("master" and/or "node") to the host.
25− This enables apiserver, controllerManager, scheduler, addonManager,
26− kube-proxy and etcd:
22+ Another way is to assign cluster roles ("master" and/or "node") to the host. This enables apiserver, controllerManager, scheduler, addonManager, kube-proxy and etcd:
2723<programlisting>
2824<xref linkend="opt-services.kubernetes.roles"/> = [ "master" ];
2925</programlisting>
@@ -31,66 +27,29 @@ services.kubernetes = {
3127<programlisting>
3228<xref linkend="opt-services.kubernetes.roles"/> = [ "node" ];
3329</programlisting>
34− Assigning both the master and node roles is usable if you want a single node
35− Kubernetes cluster for dev or testing purposes:
30+ Assigning both the master and node roles is usable if you want a single node Kubernetes cluster for dev or testing purposes:
3631<programlisting>
3732<xref linkend="opt-services.kubernetes.roles"/> = [ "master" "node" ];
3833</programlisting>
39− Note: Assigning either role will also default both
40− <xref linkend="opt-services.kubernetes.flannel.enable"/> and
41− <xref linkend="opt-services.kubernetes.easyCerts"/> to true. This sets up
42− flannel as CNI and activates automatic PKI bootstrapping.
34+ Note: Assigning either role will also default both <xref linkend="opt-services.kubernetes.flannel.enable"/> and <xref linkend="opt-services.kubernetes.easyCerts"/> to true. This sets up flannel as CNI and activates automatic PKI bootstrapping.
4335 </para>
4436 <para>
45− As of kubernetes 1.10.X it has been deprecated to open non-tls-enabled ports
46− on kubernetes components. Thus, from NixOS 19.03 all plain HTTP ports have
47− been disabled by default. While opening insecure ports is still possible, it
48− is recommended not to bind these to other interfaces than loopback. To
49− re-enable the insecure port on the apiserver, see options:
50− <xref linkend="opt-services.kubernetes.apiserver.insecurePort"/> and
51− <xref linkend="opt-services.kubernetes.apiserver.insecureBindAddress"/>
37+ As of kubernetes 1.10.X it has been deprecated to open non-tls-enabled ports on kubernetes components. Thus, from NixOS 19.03 all plain HTTP ports have been disabled by default. While opening insecure ports is still possible, it is recommended not to bind these to other interfaces than loopback. To re-enable the insecure port on the apiserver, see options: <xref linkend="opt-services.kubernetes.apiserver.insecurePort"/> and <xref linkend="opt-services.kubernetes.apiserver.insecureBindAddress"/>
5238 </para>
5339 <note>
5440 <para>
55− As of NixOS 19.03, it is mandatory to configure:
56− <xref linkend="opt-services.kubernetes.masterAddress"/>. The masterAddress
57− must be resolveable and routeable by all cluster nodes. In single node
58− clusters, this can be set to <literal>localhost</literal>.
41+ As of NixOS 19.03, it is mandatory to configure: <xref linkend="opt-services.kubernetes.masterAddress"/>. The masterAddress must be resolveable and routeable by all cluster nodes. In single node clusters, this can be set to <literal>localhost</literal>.
5942 </para>
6043 </note>
6144 <para>
62− Role-based access control (RBAC) authorization mode is enabled by default.
63− This means that anonymous requests to the apiserver secure port will
64− expectedly cause a permission denied error. All cluster components must
65− therefore be configured with x509 certificates for two-way tls communication.
66− The x509 certificate subject section determines the roles and permissions
67− granted by the apiserver to perform clusterwide or namespaced operations. See
68− also:
69− <link
70− xlink:href="https://kubernetes.io/docs/reference/access-authn-authz/rbac/">
71− Using RBAC Authorization</link>.
45+ Role-based access control (RBAC) authorization mode is enabled by default. This means that anonymous requests to the apiserver secure port will expectedly cause a permission denied error. All cluster components must therefore be configured with x509 certificates for two-way tls communication. The x509 certificate subject section determines the roles and permissions granted by the apiserver to perform clusterwide or namespaced operations. See also: <link
46+ xlink:href="https://kubernetes.io/docs/reference/access-authn-authz/rbac/"> Using RBAC Authorization</link>.
7247 </para>
7348 <para>
74− The NixOS kubernetes module provides an option for automatic certificate
75− bootstrapping and configuration,
76− <xref linkend="opt-services.kubernetes.easyCerts"/>. The PKI bootstrapping
77− process involves setting up a certificate authority (CA) daemon (cfssl) on
78− the kubernetes master node. cfssl generates a CA-cert for the cluster, and
79− uses the CA-cert for signing subordinate certs issued to each of the cluster
80− components. Subsequently, the certmgr daemon monitors active certificates and
81− renews them when needed. For single node Kubernetes clusters, setting
82− <xref linkend="opt-services.kubernetes.easyCerts"/> = true is sufficient and
83− no further action is required. For joining extra node machines to an existing
84− cluster on the other hand, establishing initial trust is mandatory.
49+ The NixOS kubernetes module provides an option for automatic certificate bootstrapping and configuration, <xref linkend="opt-services.kubernetes.easyCerts"/>. The PKI bootstrapping process involves setting up a certificate authority (CA) daemon (cfssl) on the kubernetes master node. cfssl generates a CA-cert for the cluster, and uses the CA-cert for signing subordinate certs issued to each of the cluster components. Subsequently, the certmgr daemon monitors active certificates and renews them when needed. For single node Kubernetes clusters, setting <xref linkend="opt-services.kubernetes.easyCerts"/> = true is sufficient and no further action is required. For joining extra node machines to an existing cluster on the other hand, establishing initial trust is mandatory.
8550 </para>
8651 <para>
87− To add new nodes to the cluster: On any (non-master) cluster node where
88− <xref linkend="opt-services.kubernetes.easyCerts"/> is enabled, the helper
89− script <literal>nixos-kubernetes-node-join</literal> is available on PATH.
90− Given a token on stdin, it will copy the token to the kubernetes secrets
91− directory and restart the certmgr service. As requested certificates are
92− issued, the script will restart kubernetes cluster components as needed for
93− them to pick up new keypairs.
52+ To add new nodes to the cluster: On any (non-master) cluster node where <xref linkend="opt-services.kubernetes.easyCerts"/> is enabled, the helper script <literal>nixos-kubernetes-node-join</literal> is available on PATH. Given a token on stdin, it will copy the token to the kubernetes secrets directory and restart the certmgr service. As requested certificates are issued, the script will restart kubernetes cluster components as needed for them to pick up new keypairs.
9453 </para>
9554 <note>
9655 <para>
@@ -98,15 +57,6 @@ services.kubernetes = {
9857 </para>
9958 </note>
10059 <para>
101− In order to interact with an RBAC-enabled cluster as an administrator, one
102− needs to have cluster-admin privileges. By default, when easyCerts is
103− enabled, a cluster-admin kubeconfig file is generated and linked into
104− <literal>/etc/kubernetes/cluster-admin.kubeconfig</literal> as determined by
105− <xref linkend="opt-services.kubernetes.pki.etcClusterAdminKubeconfig"/>.
106− <literal>export KUBECONFIG=/etc/kubernetes/cluster-admin.kubeconfig</literal>
107− will make kubectl use this kubeconfig to access and authenticate the cluster.
108− The cluster-admin kubeconfig references an auto-generated keypair owned by
109− root. Thus, only root on the kubernetes master may obtain cluster-admin
110− rights by means of this file.
60+ In order to interact with an RBAC-enabled cluster as an administrator, one needs to have cluster-admin privileges. By default, when easyCerts is enabled, a cluster-admin kubeconfig file is generated and linked into <literal>/etc/kubernetes/cluster-admin.kubeconfig</literal> as determined by <xref linkend="opt-services.kubernetes.pki.etcClusterAdminKubeconfig"/>. <literal>export KUBECONFIG=/etc/kubernetes/cluster-admin.kubeconfig</literal> will make kubectl use this kubeconfig to access and authenticate the cluster. The cluster-admin kubeconfig references an auto-generated keypair owned by root. Thus, only root on the kubernetes master may obtain cluster-admin rights by means of this file.
11161 </para>
11262</chapter>
nixos/doc/manual/configuration/linux-kernel.xml+15−44
@@ -5,27 +5,19 @@
55 xml:id="sec-kernel-config">
66 <title>Linux Kernel</title>
77 <para>
8− You can override the Linux kernel and associated packages using the option
9− <option>boot.kernelPackages</option>. For instance, this selects the Linux
10− 3.10 kernel:
8+ You can override the Linux kernel and associated packages using the option <option>boot.kernelPackages</option>. For instance, this selects the Linux 3.10 kernel:
119<programlisting>
1210<xref linkend="opt-boot.kernelPackages"/> = pkgs.linuxPackages_3_10;
1311</programlisting>
14− Note that this not only replaces the kernel, but also packages that are
15− specific to the kernel version, such as the NVIDIA video drivers. This
16− ensures that driver packages are consistent with the kernel.
12+ Note that this not only replaces the kernel, but also packages that are specific to the kernel version, such as the NVIDIA video drivers. This ensures that driver packages are consistent with the kernel.
1713 </para>
1814 <para>
19− The default Linux kernel configuration should be fine for most users. You can
20− see the configuration of your current kernel with the following command:
15+ The default Linux kernel configuration should be fine for most users. You can see the configuration of your current kernel with the following command:
2116<programlisting>
2217zcat /proc/config.gz
2318</programlisting>
24− If you want to change the kernel configuration, you can use the
25− <option>packageOverrides</option> feature (see
26− <xref
27−linkend="sec-customising-packages" />). For instance, to enable support
28− for the kernel debugger KGDB:
19+ If you want to change the kernel configuration, you can use the <option>packageOverrides</option> feature (see <xref
20+linkend="sec-customising-packages" />). For instance, to enable support for the kernel debugger KGDB:
2921<programlisting>
3022nixpkgs.config.packageOverrides = pkgs:
3123 { linux_3_4 = pkgs.linux_3_4.override {
@@ -36,44 +28,31 @@ nixpkgs.config.packageOverrides = pkgs:
3628 };
3729 };
3830</programlisting>
39− <varname>extraConfig</varname> takes a list of Linux kernel configuration
40− options, one per line. The name of the option should not include the prefix
41− <literal>CONFIG_</literal>. The option value is typically
42− <literal>y</literal>, <literal>n</literal> or <literal>m</literal> (to build
43− something as a kernel module).
31+ <varname>extraConfig</varname> takes a list of Linux kernel configuration options, one per line. The name of the option should not include the prefix <literal>CONFIG_</literal>. The option value is typically <literal>y</literal>, <literal>n</literal> or <literal>m</literal> (to build something as a kernel module).
4432 </para>
4533 <para>
46− Kernel modules for hardware devices are generally loaded automatically by
47− <command>udev</command>. You can force a module to be loaded via
48− <xref linkend="opt-boot.kernelModules"/>, e.g.
34+ Kernel modules for hardware devices are generally loaded automatically by <command>udev</command>. You can force a module to be loaded via <xref linkend="opt-boot.kernelModules"/>, e.g.
4935<programlisting>
5036<xref linkend="opt-boot.kernelModules"/> = [ "fuse" "kvm-intel" "coretemp" ];
5137</programlisting>
52− If the module is required early during the boot (e.g. to mount the root file
53− system), you can use <xref linkend="opt-boot.initrd.kernelModules"/>:
38+ If the module is required early during the boot (e.g. to mount the root file system), you can use <xref linkend="opt-boot.initrd.kernelModules"/>:
5439<programlisting>
5540<xref linkend="opt-boot.initrd.kernelModules"/> = [ "cifs" ];
5641</programlisting>
57− This causes the specified modules and their dependencies to be added to the
58− initial ramdisk.
42+ This causes the specified modules and their dependencies to be added to the initial ramdisk.
5943 </para>
6044 <para>
61− Kernel runtime parameters can be set through
62− <xref linkend="opt-boot.kernel.sysctl"/>, e.g.
45+ Kernel runtime parameters can be set through <xref linkend="opt-boot.kernel.sysctl"/>, e.g.
6346<programlisting>
6447<xref linkend="opt-boot.kernel.sysctl"/>."net.ipv4.tcp_keepalive_time" = 120;
6548</programlisting>
66− sets the kernel’s TCP keepalive time to 120 seconds. To see the available
67− parameters, run <command>sysctl -a</command>.
49+ sets the kernel’s TCP keepalive time to 120 seconds. To see the available parameters, run <command>sysctl -a</command>.
6850 </para>
6951 <section xml:id="sec-linux-config-customizing">
7052 <title>Customize your kernel</title>
7153
7254 <para>
73− The first step before compiling the kernel is to generate an appropriate
74− <literal>.config</literal> configuration. Either you pass your own config
75− via the <literal>configfile</literal> setting of
76− <literal>linuxManualConfig</literal>:
55+ The first step before compiling the kernel is to generate an appropriate <literal>.config</literal> configuration. Either you pass your own config via the <literal>configfile</literal> setting of <literal>linuxManualConfig</literal>:
7756<screen><![CDATA[
7857 custom-kernel = super.linuxManualConfig {
7958 inherit (super) stdenv hostPlatform;
@@ -84,17 +63,11 @@ nixpkgs.config.packageOverrides = pkgs:
8463 allowImportFromDerivation = true;
8564 };
8665 ]]></screen>
87− You can edit the config with this snippet (by default <command>make
88− menuconfig</command> won't work out of the box on nixos):
66+ You can edit the config with this snippet (by default <command>make menuconfig</command> won't work out of the box on nixos):
8967<screen><![CDATA[
9068 nix-shell -E 'with import <nixpkgs> {}; kernelToOverride.overrideAttrs (o: {nativeBuildInputs=o.nativeBuildInputs ++ [ pkgconfig ncurses ];})'
9169 ]]></screen>
92− or you can let nixpkgs generate the configuration. Nixpkgs generates it via
93− answering the interactive kernel utility <command>make config</command>. The
94− answers depend on parameters passed to
95− <filename>pkgs/os-specific/linux/kernel/generic.nix</filename> (which you
96− can influence by overriding <literal>extraConfig, autoModules,
97− modDirVersion, preferBuiltin, extraConfig</literal>).
70+ or you can let nixpkgs generate the configuration. Nixpkgs generates it via answering the interactive kernel utility <command>make config</command>. The answers depend on parameters passed to <filename>pkgs/os-specific/linux/kernel/generic.nix</filename> (which you can influence by overriding <literal>extraConfig, autoModules, modDirVersion, preferBuiltin, extraConfig</literal>).
9871<screen><![CDATA[
9972
10073 mptcp93.override ({
@@ -121,9 +94,7 @@ nixpkgs.config.packageOverrides = pkgs:
12194 <title>Developing kernel modules</title>
12295
12396 <para>
124− When developing kernel modules it's often convenient to run edit-compile-run
125− loop as quickly as possible. See below snippet as an example of developing
126− <literal>mellanox</literal> drivers.
97+ When developing kernel modules it's often convenient to run edit-compile-run loop as quickly as possible. See below snippet as an example of developing <literal>mellanox</literal> drivers.
12798 </para>
12899
129100<screen><![CDATA[
nixos/doc/manual/configuration/luks-file-systems.xml+3−9
@@ -6,10 +6,7 @@
66 <title>LUKS-Encrypted File Systems</title>
77
88 <para>
9− NixOS supports file systems that are encrypted using
10− <emphasis>LUKS</emphasis> (Linux Unified Key Setup). For example, here is how
11− you create an encrypted Ext4 file system on the device
12− <filename>/dev/disk/by-uuid/3f6b0024-3a44-4fde-a43a-767b872abe5d</filename>:
9+ NixOS supports file systems that are encrypted using <emphasis>LUKS</emphasis> (Linux Unified Key Setup). For example, here is how you create an encrypted Ext4 file system on the device <filename>/dev/disk/by-uuid/3f6b0024-3a44-4fde-a43a-767b872abe5d</filename>:
1310<screen>
1411# cryptsetup luksFormat /dev/disk/by-uuid/3f6b0024-3a44-4fde-a43a-767b872abe5d
1512
@@ -26,15 +23,12 @@ Enter passphrase for /dev/disk/by-uuid/3f6b0024-3a44-4fde-a43a-767b872abe5d: ***
2623
2724# mkfs.ext4 /dev/mapper/crypted
2825</screen>
29− To ensure that this file system is automatically mounted at boot time as
30− <filename>/</filename>, add the following to
31− <filename>configuration.nix</filename>:
26+ To ensure that this file system is automatically mounted at boot time as <filename>/</filename>, add the following to <filename>configuration.nix</filename>:
3227<programlisting>
3328<link linkend="opt-boot.initrd.luks.devices._name__.device">boot.initrd.luks.devices.crypted.device</link> = "/dev/disk/by-uuid/3f6b0024-3a44-4fde-a43a-767b872abe5d";
3429<xref linkend="opt-fileSystems"/>."/".device = "/dev/mapper/crypted";
3530</programlisting>
36− Should grub be used as bootloader, and <filename>/boot</filename> is located
37− on an encrypted partition, it is necessary to add the following grub option:
31+ Should grub be used as bootloader, and <filename>/boot</filename> is located on an encrypted partition, it is necessary to add the following grub option:
3832<programlisting><xref linkend="opt-boot.loader.grub.enableCryptodisk"/> = true;</programlisting>
3933 </para>
4034</section>
nixos/doc/manual/configuration/matrix.xml+8−65
@@ -5,33 +5,16 @@
55 xml:id="module-services-matrix">
66 <title>Matrix</title>
77 <para>
8− <link xlink:href="https://matrix.org/">Matrix</link> is an open standard for
9− interoperable, decentralised, real-time communication over IP. It can be used
10− to power Instant Messaging, VoIP/WebRTC signalling, Internet of Things
11− communication - or anywhere you need a standard HTTP API for publishing and
12− subscribing to data whilst tracking the conversation history.
8+ <link xlink:href="https://matrix.org/">Matrix</link> is an open standard for interoperable, decentralised, real-time communication over IP. It can be used to power Instant Messaging, VoIP/WebRTC signalling, Internet of Things communication - or anywhere you need a standard HTTP API for publishing and subscribing to data whilst tracking the conversation history.
139 </para>
1410 <para>
15− This chapter will show you how to set up your own, self-hosted Matrix
16− homeserver using the Synapse reference homeserver, and how to serve your own
17− copy of the Riot web client. See the
18− <link xlink:href="https://matrix.org/docs/projects/try-matrix-now.html">Try
19− Matrix Now!</link> overview page for links to Riot Apps for Android and iOS,
20− desktop clients, as well as bridges to other networks and other projects
21− around Matrix.
11+ This chapter will show you how to set up your own, self-hosted Matrix homeserver using the Synapse reference homeserver, and how to serve your own copy of the Riot web client. See the <link xlink:href="https://matrix.org/docs/projects/try-matrix-now.html">Try Matrix Now!</link> overview page for links to Riot Apps for Android and iOS, desktop clients, as well as bridges to other networks and other projects around Matrix.
2212 </para>
2313 <section xml:id="module-services-matrix-synapse">
2414 <title>Synapse Homeserver</title>
2515
2616 <para>
27− <link xlink:href="https://github.com/matrix-org/synapse">Synapse</link> is
28− the reference homeserver implementation of Matrix from the core development
29− team at matrix.org. The following configuration example will set up a
30− synapse server for the <literal>example.org</literal> domain, served from
31− the host <literal>myhostname.example.org</literal>. For more information,
32− please refer to the
33− <link xlink:href="https://github.com/matrix-org/synapse#synapse-installation">
34− installation instructions of Synapse </link>.
17+ <link xlink:href="https://github.com/matrix-org/synapse">Synapse</link> is the reference homeserver implementation of Matrix from the core development team at matrix.org. The following configuration example will set up a synapse server for the <literal>example.org</literal> domain, served from the host <literal>myhostname.example.org</literal>. For more information, please refer to the <link xlink:href="https://github.com/matrix-org/synapse#synapse-installation"> installation instructions of Synapse </link>.
3518<programlisting>
3619let
3720 fqdn =
@@ -121,26 +104,11 @@ in {
121104 </para>
122105
123106 <para>
124− If the <code>A</code> and <code>AAAA</code> DNS records on
125− <literal>example.org</literal> do not point on the same host as the records
126− for <code>myhostname.example.org</code>, you can easily move the
127− <code>/.well-known</code> virtualHost section of the code to the host that
128− is serving <literal>example.org</literal>, while the rest stays on
129− <literal>myhostname.example.org</literal> with no other changes required.
130− This pattern also allows to seamlessly move the homeserver from
131− <literal>myhostname.example.org</literal> to
132− <literal>myotherhost.example.org</literal> by only changing the
133− <code>/.well-known</code> redirection target.
107+ If the <code>A</code> and <code>AAAA</code> DNS records on <literal>example.org</literal> do not point on the same host as the records for <code>myhostname.example.org</code>, you can easily move the <code>/.well-known</code> virtualHost section of the code to the host that is serving <literal>example.org</literal>, while the rest stays on <literal>myhostname.example.org</literal> with no other changes required. This pattern also allows to seamlessly move the homeserver from <literal>myhostname.example.org</literal> to <literal>myotherhost.example.org</literal> by only changing the <code>/.well-known</code> redirection target.
134108 </para>
135109
136110 <para>
137− If you want to run a server with public registration by anybody, you can
138− then enable <option>services.matrix-synapse.enable_registration =
139− true;</option>. Otherwise, or you can generate a registration secret with
140− <command>pwgen -s 64 1</command> and set it with
141− <option>services.matrix-synapse.registration_shared_secret</option>. To
142− create a new user or admin, run the following after you have set the secret
143− and have rebuilt NixOS:
111+ If you want to run a server with public registration by anybody, you can then enable <option>services.matrix-synapse.enable_registration = true;</option>. Otherwise, or you can generate a registration secret with <command>pwgen -s 64 1</command> and set it with <option>services.matrix-synapse.registration_shared_secret</option>. To create a new user or admin, run the following after you have set the secret and have rebuilt NixOS:
144112<screen>
145113<prompt>$ </prompt>nix run nixpkgs.matrix-synapse
146114<prompt>$ </prompt>register_new_matrix_user -k <replaceable>your-registration-shared-secret</replaceable> http://localhost:8008
@@ -150,32 +118,14 @@ in {
150118<prompt>Make admin [no]:</prompt>
151119Success!
152120</screen>
153− In the example, this would create a user with the Matrix Identifier
154− <literal>@your-username:example.org</literal>. Note that the registration
155− secret ends up in the nix store and therefore is world-readable by any user
156− on your machine, so it makes sense to only temporarily activate the
157− <option>registration_shared_secret</option> option until a better solution
158− for NixOS is in place.
121+ In the example, this would create a user with the Matrix Identifier <literal>@your-username:example.org</literal>. Note that the registration secret ends up in the nix store and therefore is world-readable by any user on your machine, so it makes sense to only temporarily activate the <option>registration_shared_secret</option> option until a better solution for NixOS is in place.
159122 </para>
160123 </section>
161124 <section xml:id="module-services-matrix-riot-web">
162125 <title>Riot Web Client</title>
163126
164127 <para>
165− <link xlink:href="https://github.com/vector-im/riot-web/">Riot Web</link> is
166− the reference web client for Matrix and developed by the core team at
167− matrix.org. The following snippet can be optionally added to the code before
168− to complete the synapse installation with a web client served at
169− <code>https://riot.myhostname.example.org</code> and
170− <code>https://riot.example.org</code>. Alternatively, you can use the hosted
171− copy at <link xlink:href="https://riot.im/app">https://riot.im/app</link>,
172− or use other web clients or native client applications. Due to the
173− <literal>/.well-known</literal> urls set up done above, many clients should
174− fill in the required connection details automatically when you enter your
175− Matrix Identifier. See
176− <link xlink:href="https://matrix.org/docs/projects/try-matrix-now.html">Try
177− Matrix Now!</link> for a list of existing clients and their supported
178− featureset.
128+ <link xlink:href="https://github.com/vector-im/riot-web/">Riot Web</link> is the reference web client for Matrix and developed by the core team at matrix.org. The following snippet can be optionally added to the code before to complete the synapse installation with a web client served at <code>https://riot.myhostname.example.org</code> and <code>https://riot.example.org</code>. Alternatively, you can use the hosted copy at <link xlink:href="https://riot.im/app">https://riot.im/app</link>, or use other web clients or native client applications. Due to the <literal>/.well-known</literal> urls set up done above, many clients should fill in the required connection details automatically when you enter your Matrix Identifier. See <link xlink:href="https://matrix.org/docs/projects/try-matrix-now.html">Try Matrix Now!</link> for a list of existing clients and their supported featureset.
179129<programlisting>
180130services.nginx.virtualHosts."riot.${fqdn}" = {
181131 enableACME = true;
@@ -190,14 +140,7 @@ services.nginx.virtualHosts."riot.${fqdn}" = {
190140 </para>
191141
192142 <para>
193− Note that the Riot developers do not recommend running Riot and your Matrix
194− homeserver on the same fully-qualified domain name for security reasons. In
195− the example, this means that you should not reuse the
196− <literal>myhostname.example.org</literal> virtualHost to also serve Riot,
197− but instead serve it on a different subdomain, like
198− <literal>riot.example.org</literal> in the example. See the
199− <link xlink:href="https://github.com/vector-im/riot-web#important-security-note">Riot
200− Important Security Notes</link> for more information on this subject.
143+ Note that the Riot developers do not recommend running Riot and your Matrix homeserver on the same fully-qualified domain name for security reasons. In the example, this means that you should not reuse the <literal>myhostname.example.org</literal> virtualHost to also serve Riot, but instead serve it on a different subdomain, like <literal>riot.example.org</literal> in the example. See the <link xlink:href="https://github.com/vector-im/riot-web#important-security-note">Riot Important Security Notes</link> for more information on this subject.
201144 </para>
202145 </section>
203146</chapter>
nixos/doc/manual/configuration/modularity.xml+13−50
@@ -6,18 +6,11 @@
66 <title>Modularity</title>
77
88 <para>
9− The NixOS configuration mechanism is modular. If your
10− <filename>configuration.nix</filename> becomes too big, you can split it into
11− multiple files. Likewise, if you have multiple NixOS configurations (e.g. for
12− different computers) with some commonality, you can move the common
13− configuration into a shared file.
9+ The NixOS configuration mechanism is modular. If your <filename>configuration.nix</filename> becomes too big, you can split it into multiple files. Likewise, if you have multiple NixOS configurations (e.g. for different computers) with some commonality, you can move the common configuration into a shared file.
1410 </para>
1511
1612 <para>
17− Modules have exactly the same syntax as
18− <filename>configuration.nix</filename>. In fact,
19− <filename>configuration.nix</filename> is itself a module. You can use other
20− modules by including them from <filename>configuration.nix</filename>, e.g.:
13+ Modules have exactly the same syntax as <filename>configuration.nix</filename>. In fact, <filename>configuration.nix</filename> is itself a module. You can use other modules by including them from <filename>configuration.nix</filename>, e.g.:
2114<programlisting>
2215{ config, pkgs, ... }:
2316
@@ -27,9 +20,7 @@
2720 <replaceable>...</replaceable>
2821}
2922</programlisting>
30− Here, we include two modules from the same directory,
31− <filename>vpn.nix</filename> and <filename>kde.nix</filename>. The latter
32− might look like this:
23+ Here, we include two modules from the same directory, <filename>vpn.nix</filename> and <filename>kde.nix</filename>. The latter might look like this:
3324<programlisting>
3425{ config, pkgs, ... }:
3526
@@ -38,55 +29,32 @@
3829 <xref linkend="opt-services.xserver.desktopManager.plasma5.enable"/> = true;
3930}
4031</programlisting>
41− Note that both <filename>configuration.nix</filename> and
42− <filename>kde.nix</filename> define the option
43− <xref linkend="opt-environment.systemPackages"/>. When multiple modules
44− define an option, NixOS will try to <emphasis>merge</emphasis> the
45− definitions. In the case of <xref linkend="opt-environment.systemPackages"/>,
46− that’s easy: the lists of packages can simply be concatenated. The value in
47− <filename>configuration.nix</filename> is merged last, so for list-type
48− options, it will appear at the end of the merged list. If you want it to
49− appear first, you can use <varname>mkBefore</varname>:
32+ Note that both <filename>configuration.nix</filename> and <filename>kde.nix</filename> define the option <xref linkend="opt-environment.systemPackages"/>. When multiple modules define an option, NixOS will try to <emphasis>merge</emphasis> the definitions. In the case of <xref linkend="opt-environment.systemPackages"/>, that’s easy: the lists of packages can simply be concatenated. The value in <filename>configuration.nix</filename> is merged last, so for list-type options, it will appear at the end of the merged list. If you want it to appear first, you can use <varname>mkBefore</varname>:
5033<programlisting>
5134<xref linkend="opt-boot.kernelModules"/> = mkBefore [ "kvm-intel" ];
5235</programlisting>
53− This causes the <literal>kvm-intel</literal> kernel module to be loaded
54− before any other kernel modules.
36+ This causes the <literal>kvm-intel</literal> kernel module to be loaded before any other kernel modules.
5537 </para>
5638
5739 <para>
58− For other types of options, a merge may not be possible. For instance, if two
59− modules define <xref linkend="opt-services.httpd.adminAddr"/>,
60− <command>nixos-rebuild</command> will give an error:
40+ For other types of options, a merge may not be possible. For instance, if two modules define <xref linkend="opt-services.httpd.adminAddr"/>, <command>nixos-rebuild</command> will give an error:
6141<screen>
6242The unique option `services.httpd.adminAddr' is defined multiple times, in `/etc/nixos/httpd.nix' and `/etc/nixos/configuration.nix'.
6343</screen>
64− When that happens, it’s possible to force one definition take precedence
65− over the others:
44+ When that happens, it’s possible to force one definition take precedence over the others:
6645<programlisting>
6746<xref linkend="opt-services.httpd.adminAddr"/> = pkgs.lib.mkForce "bob@example.org";
6847</programlisting>
6948 </para>
7049
7150 <para>
72− When using multiple modules, you may need to access configuration values
73− defined in other modules. This is what the <varname>config</varname> function
74− argument is for: it contains the complete, merged system configuration. That
75− is, <varname>config</varname> is the result of combining the configurations
76− returned by every module
51+ When using multiple modules, you may need to access configuration values defined in other modules. This is what the <varname>config</varname> function argument is for: it contains the complete, merged system configuration. That is, <varname>config</varname> is the result of combining the configurations returned by every module
7752 <footnote xml:id="footnote-nix-is-lazy">
7853 <para>
79− If you’re wondering how it’s possible that the (indirect)
80− <emphasis>result</emphasis> of a function is passed as an
81− <emphasis>input</emphasis> to that same function: that’s because Nix is a
82− “lazy” language — it only computes values when they are needed. This
83− works as long as no individual configuration value depends on itself.
54+ If you’re wondering how it’s possible that the (indirect) <emphasis>result</emphasis> of a function is passed as an <emphasis>input</emphasis> to that same function: that’s because Nix is a “lazy” language — it only computes values when they are needed. This works as long as no individual configuration value depends on itself.
8455 </para>
8556 </footnote>
86− . For example, here is a module that adds some packages to
87− <xref linkend="opt-environment.systemPackages"/> only if
88− <xref linkend="opt-services.xserver.enable"/> is set to
89− <literal>true</literal> somewhere else:
57+ . For example, here is a module that adds some packages to <xref linkend="opt-environment.systemPackages"/> only if <xref linkend="opt-services.xserver.enable"/> is set to <literal>true</literal> somewhere else:
9058<programlisting>
9159{ config, pkgs, ... }:
9260
@@ -102,9 +70,7 @@ The unique option `services.httpd.adminAddr' is defined multiple times, in `/etc
10270 </para>
10371
10472 <para>
105− With multiple modules, it may not be obvious what the final value of a
106− configuration option is. The command <option>nixos-option</option> allows you
107− to find out:
73+ With multiple modules, it may not be obvious what the final value of a configuration option is. The command <option>nixos-option</option> allows you to find out:
10874<screen>
10975<prompt>$ </prompt>nixos-option <xref linkend="opt-services.xserver.enable"/>
11076true
@@ -112,8 +78,7 @@ true
11278<prompt>$ </prompt>nixos-option <xref linkend="opt-boot.kernelModules"/>
11379[ "tun" "ipv6" "loop" <replaceable>...</replaceable> ]
11480</screen>
115− Interactive exploration of the configuration is possible using <command>nix
116− repl</command>, a read-eval-print loop for Nix expressions. A typical use:
81+ Interactive exploration of the configuration is possible using <command>nix repl</command>, a read-eval-print loop for Nix expressions. A typical use:
11782<screen>
11883<prompt>$ </prompt>nix repl '&lt;nixpkgs/nixos>'
11984
@@ -126,9 +91,7 @@ true
12691 </para>
12792
12893 <para>
129− While abstracting your configuration, you may find it useful to generate
130− modules using code, instead of writing files. The example below would have
131− the same effect as importing a file which sets those options.
94+ While abstracting your configuration, you may find it useful to generate modules using code, instead of writing files. The example below would have the same effect as importing a file which sets those options.
13295<programlisting>
13396{ config, pkgs, ... }:
13497
nixos/doc/manual/configuration/network-manager.xml+5−17
@@ -6,39 +6,27 @@
66 <title>NetworkManager</title>
77
88 <para>
9− To facilitate network configuration, some desktop environments use
10− NetworkManager. You can enable NetworkManager by setting:
9+ To facilitate network configuration, some desktop environments use NetworkManager. You can enable NetworkManager by setting:
1110<programlisting>
1211<xref linkend="opt-networking.networkmanager.enable"/> = true;
1312</programlisting>
14− some desktop managers (e.g., GNOME) enable NetworkManager automatically for
15− you.
13+ some desktop managers (e.g., GNOME) enable NetworkManager automatically for you.
1614 </para>
1715
1816 <para>
19− All users that should have permission to change network settings must belong
20− to the <code>networkmanager</code> group:
17+ All users that should have permission to change network settings must belong to the <code>networkmanager</code> group:
2118<programlisting>
2219<link linkend="opt-users.users._name__.extraGroups">users.users.alice.extraGroups</link> = [ "networkmanager" ];
2320</programlisting>
2421 </para>
2522
2623 <para>
27− NetworkManager is controlled using either <command>nmcli</command> or
28− <command>nmtui</command> (curses-based terminal user interface). See their
29− manual pages for details on their usage. Some desktop environments (GNOME,
30− KDE) have their own configuration tools for NetworkManager. On XFCE, there is
31− no configuration tool for NetworkManager by default: by adding
32− <code>networkmanagerapplet</code> to the list of system packages, the
33− graphical applet will be installed and will launch automatically when XFCE is
34− starting (and will show in the status tray).
24+ NetworkManager is controlled using either <command>nmcli</command> or <command>nmtui</command> (curses-based terminal user interface). See their manual pages for details on their usage. Some desktop environments (GNOME, KDE) have their own configuration tools for NetworkManager. On XFCE, there is no configuration tool for NetworkManager by default: by adding <code>networkmanagerapplet</code> to the list of system packages, the graphical applet will be installed and will launch automatically when XFCE is starting (and will show in the status tray).
3525 </para>
3626
3727 <note>
3828 <para>
39− <code>networking.networkmanager</code> and <code>networking.wireless</code>
40− (WPA Supplicant) cannot be enabled at the same time: you can still connect
41− to the wireless networks using NetworkManager.
29+ <code>networking.networkmanager</code> and <code>networking.wireless</code> (WPA Supplicant) cannot be enabled at the same time: you can still connect to the wireless networks using NetworkManager.
4230 </para>
4331 </note>
4432</section>
nixos/doc/manual/configuration/networking.xml+1−2
@@ -5,8 +5,7 @@
55 xml:id="sec-networking">
66 <title>Networking</title>
77 <para>
8− This section describes how to configure networking components on your NixOS
9− machine.
8+ This section describes how to configure networking components on your NixOS machine.
109 </para>
1110 <xi:include href="network-manager.xml" />
1211 <xi:include href="ssh.xml" />
nixos/doc/manual/configuration/package-mgmt.xml+3−10
@@ -5,23 +5,16 @@
55 xml:id="sec-package-management">
66 <title>Package Management</title>
77 <para>
8− This section describes how to add additional packages to your system. NixOS
9− has two distinct styles of package management:
8+ This section describes how to add additional packages to your system. NixOS has two distinct styles of package management:
109 <itemizedlist>
1110 <listitem>
1211 <para>
13− <emphasis>Declarative</emphasis>, where you declare what packages you want
14− in your <filename>configuration.nix</filename>. Every time you run
15− <command>nixos-rebuild</command>, NixOS will ensure that you get a
16− consistent set of binaries corresponding to your specification.
12+ <emphasis>Declarative</emphasis>, where you declare what packages you want in your <filename>configuration.nix</filename>. Every time you run <command>nixos-rebuild</command>, NixOS will ensure that you get a consistent set of binaries corresponding to your specification.
1713 </para>
1814 </listitem>
1915 <listitem>
2016 <para>
21− <emphasis>Ad hoc</emphasis>, where you install, upgrade and uninstall
22− packages via the <command>nix-env</command> command. This style allows
23− mixing packages from different Nixpkgs versions. It’s the only choice
24− for non-root users.
17+ <emphasis>Ad hoc</emphasis>, where you install, upgrade and uninstall packages via the <command>nix-env</command> command. This style allows mixing packages from different Nixpkgs versions. It’s the only choice for non-root users.
2518 </para>
2619 </listitem>
2720 </itemizedlist>
nixos/doc/manual/configuration/profiles.xml+3−10
@@ -5,12 +5,7 @@
55 xml:id="ch-profiles">
66 <title>Profiles</title>
77 <para>
8− In some cases, it may be desirable to take advantage of commonly-used,
9− predefined configurations provided by nixpkgs, but different from those that
10− come as default. This is a role fulfilled by NixOS's Profiles, which come as
11− files living in <filename>&lt;nixpkgs/nixos/modules/profiles&gt;</filename>.
12− That is to say, expected usage is to add them to the imports list of your
13− <filename>/etc/configuration.nix</filename> as such:
8+ In some cases, it may be desirable to take advantage of commonly-used, predefined configurations provided by nixpkgs, but different from those that come as default. This is a role fulfilled by NixOS's Profiles, which come as files living in <filename>&lt;nixpkgs/nixos/modules/profiles&gt;</filename>. That is to say, expected usage is to add them to the imports list of your <filename>/etc/configuration.nix</filename> as such:
149 </para>
1510<programlisting>
1611 imports = [
@@ -18,12 +13,10 @@
1813 ];
1914</programlisting>
2015 <para>
21− Even if some of these profiles seem only useful in the context of install
22− media, many are actually intended to be used in real installs.
16+ Even if some of these profiles seem only useful in the context of install media, many are actually intended to be used in real installs.
2317 </para>
2418 <para>
25− What follows is a brief explanation on the purpose and use-case for each
26− profile. Detailing each option configured by each one is out of scope.
19+ What follows is a brief explanation on the purpose and use-case for each profile. Detailing each option configured by each one is out of scope.
2720 </para>
2821 <xi:include href="profiles/all-hardware.xml" />
2922 <xi:include href="profiles/base.xml" />
nixos/doc/manual/configuration/profiles/all-hardware.xml+2−8
@@ -6,16 +6,10 @@
66 <title>All Hardware</title>
77
88 <para>
9− Enables all hardware supported by NixOS: i.e., all firmware is included, and
10− all devices from which one may boot are enabled in the initrd. Its primary
11− use is in the NixOS installation CDs.
9+ Enables all hardware supported by NixOS: i.e., all firmware is included, and all devices from which one may boot are enabled in the initrd. Its primary use is in the NixOS installation CDs.
1210 </para>
1311
1412 <para>
15− The enabled kernel modules include support for SATA and PATA, SCSI
16− (partially), USB, Firewire (untested), Virtio (QEMU, KVM, etc.), VMware, and
17− Hyper-V. Additionally, <xref linkend="opt-hardware.enableAllFirmware"/> is
18− enabled, and the firmware for the ZyDAS ZD1211 chipset is specifically
19− installed.
13+ The enabled kernel modules include support for SATA and PATA, SCSI (partially), USB, Firewire (untested), Virtio (QEMU, KVM, etc.), VMware, and Hyper-V. Additionally, <xref linkend="opt-hardware.enableAllFirmware"/> is enabled, and the firmware for the ZyDAS ZD1211 chipset is specifically installed.
2014 </para>
2115</section>
nixos/doc/manual/configuration/profiles/base.xml+1−5
@@ -6,10 +6,6 @@
66 <title>Base</title>
77
88 <para>
9− Defines the software packages included in the "minimal" installation CD. It
10− installs several utilities useful in a simple recovery or install media, such
11− as a text-mode web browser, and tools for manipulating block devices,
12− networking, hardware diagnostics, and filesystems (with their respective
13− kernel modules).
9+ Defines the software packages included in the "minimal" installation CD. It installs several utilities useful in a simple recovery or install media, such as a text-mode web browser, and tools for manipulating block devices, networking, hardware diagnostics, and filesystems (with their respective kernel modules).
1410 </para>
1511</section>
nixos/doc/manual/configuration/profiles/clone-config.xml+2−8
@@ -6,16 +6,10 @@
66 <title>Clone Config</title>
77
88 <para>
9− This profile is used in installer images. It provides an editable
10− configuration.nix that imports all the modules that were also used when
11− creating the image in the first place. As a result it allows users to edit
12− and rebuild the live-system.
9+ This profile is used in installer images. It provides an editable configuration.nix that imports all the modules that were also used when creating the image in the first place. As a result it allows users to edit and rebuild the live-system.
1310 </para>
1411
1512 <para>
16− On images where the installation media also becomes an installation target,
17− copying over <literal>configuration.nix</literal> should be disabled by
18− setting <literal>installer.cloneConfig</literal> to <literal>false</literal>.
19− For example, this is done in <literal>sd-image-aarch64.nix</literal>.
13+ On images where the installation media also becomes an installation target, copying over <literal>configuration.nix</literal> should be disabled by setting <literal>installer.cloneConfig</literal> to <literal>false</literal>. For example, this is done in <literal>sd-image-aarch64.nix</literal>.
2014 </para>
2115</section>
nixos/doc/manual/configuration/profiles/demo.xml+1−5
@@ -6,10 +6,6 @@
66 <title>Demo</title>
77
88 <para>
9− This profile just enables a <systemitem class="username">demo</systemitem>
10− user, with password <literal>demo</literal>, uid <literal>1000</literal>,
11− <systemitem class="groupname">wheel</systemitem> group and
12− <link linkend="opt-services.xserver.displayManager.sddm.autoLogin"> autologin
13− in the SDDM display manager</link>.
9+ This profile just enables a <systemitem class="username">demo</systemitem> user, with password <literal>demo</literal>, uid <literal>1000</literal>, <systemitem class="groupname">wheel</systemitem> group and <link linkend="opt-services.xserver.displayManager.sddm.autoLogin"> autologin in the SDDM display manager</link>.
1410 </para>
1511</section>
nixos/doc/manual/configuration/profiles/docker-container.xml+1−6
@@ -6,11 +6,6 @@
66 <title>Docker Container</title>
77
88 <para>
9− This is the profile from which the Docker images are generated. It prepares a
10− working system by importing the
11− <link linkend="sec-profile-minimal">Minimal</link> and
12− <link linkend="sec-profile-clone-config">Clone Config</link> profiles, and
13− setting appropriate configuration options that are useful inside a container
14− context, like <xref linkend="opt-boot.isContainer"/>.
9+ This is the profile from which the Docker images are generated. It prepares a working system by importing the <link linkend="sec-profile-minimal">Minimal</link> and <link linkend="sec-profile-clone-config">Clone Config</link> profiles, and setting appropriate configuration options that are useful inside a container context, like <xref linkend="opt-boot.isContainer"/>.
1510 </para>
1611</section>
nixos/doc/manual/configuration/profiles/graphical.xml+2−9
@@ -6,17 +6,10 @@
66 <title>Graphical</title>
77
88 <para>
9− Defines a NixOS configuration with the Plasma 5 desktop. It's used by the
10− graphical installation CD.
9+ Defines a NixOS configuration with the Plasma 5 desktop. It's used by the graphical installation CD.
1110 </para>
1211
1312 <para>
14− It sets <xref linkend="opt-services.xserver.enable"/>,
15− <xref linkend="opt-services.xserver.displayManager.sddm.enable"/>,
16− <xref linkend="opt-services.xserver.desktopManager.plasma5.enable"/> (
17− <link linkend="opt-services.xserver.desktopManager.plasma5.enableQt4Support">
18− without Qt4 Support</link>), and
19− <xref linkend="opt-services.xserver.libinput.enable"/> to true. It also
20− includes glxinfo and firefox in the system packages list.
13+ It sets <xref linkend="opt-services.xserver.enable"/>, <xref linkend="opt-services.xserver.displayManager.sddm.enable"/>, <xref linkend="opt-services.xserver.desktopManager.plasma5.enable"/> ( <link linkend="opt-services.xserver.desktopManager.plasma5.enableQt4Support"> without Qt4 Support</link>), and <xref linkend="opt-services.xserver.libinput.enable"/> to true. It also includes glxinfo and firefox in the system packages list.
2114 </para>
2215</section>
nixos/doc/manual/configuration/profiles/hardened.xml+3−11
@@ -6,19 +6,11 @@
66 <title>Hardened</title>
77
88 <para>
9− A profile with most (vanilla) hardening options enabled by default,
10− potentially at the cost of features and performance.
9+ A profile with most (vanilla) hardening options enabled by default, potentially at the cost of features and performance.
1110 </para>
1211
1312 <para>
14− This includes a hardened kernel, and limiting the system information
15− available to processes through the <filename>/sys</filename> and
16− <filename>/proc</filename> filesystems. It also disables the User Namespaces
17− feature of the kernel, which stops Nix from being able to build anything
18− (this particular setting can be overriden via
19− <xref linkend="opt-security.allowUserNamespaces"/>). See the
20− <literal
21− xlink:href="https://github.com/nixos/nixpkgs/tree/master/nixos/modules/profiles/hardened.nix">
22− profile source</literal> for further detail on which settings are altered.
13+ This includes a hardened kernel, and limiting the system information available to processes through the <filename>/sys</filename> and <filename>/proc</filename> filesystems. It also disables the User Namespaces feature of the kernel, which stops Nix from being able to build anything (this particular setting can be overriden via <xref linkend="opt-security.allowUserNamespaces"/>). See the <literal
14+ xlink:href="https://github.com/nixos/nixpkgs/tree/master/nixos/modules/profiles/hardened.nix"> profile source</literal> for further detail on which settings are altered.
2315 </para>
2416</section>
nixos/doc/manual/configuration/profiles/headless.xml+1−5
@@ -10,10 +10,6 @@
1010 </para>
1111
1212 <para>
13− Disables <link linkend="opt-sound.enable">sound</link>,
14− <link linkend="opt-boot.vesa">vesa</link>, serial consoles,
15− <link linkend="opt-systemd.enableEmergencyMode">emergency mode</link>,
16− <link linkend="opt-boot.loader.grub.splashImage">grub splash images</link>
17− and configures the kernel to reboot automatically on panic.
13+ Disables <link linkend="opt-sound.enable">sound</link>, <link linkend="opt-boot.vesa">vesa</link>, serial consoles, <link linkend="opt-systemd.enableEmergencyMode">emergency mode</link>, <link linkend="opt-boot.loader.grub.splashImage">grub splash images</link> and configures the kernel to reboot automatically on panic.
1814 </para>
1915</section>
nixos/doc/manual/configuration/profiles/installation-device.xml+6−19
@@ -6,31 +6,18 @@
66 <title>Installation Device</title>
77
88 <para>
9− Provides a basic configuration for installation devices like CDs.
10− This enables redistributable firmware, includes the
11− <link linkend="sec-profile-clone-config">Clone Config profile</link>
12− and a copy of the Nixpkgs channel, so <command>nixos-install</command>
13− works out of the box.
9+ Provides a basic configuration for installation devices like CDs. This enables redistributable firmware, includes the <link linkend="sec-profile-clone-config">Clone Config profile</link> and a copy of the Nixpkgs channel, so <command>nixos-install</command> works out of the box.
1410 </para>
11+
1512 <para>
16− Documentation for <link linkend="opt-documentation.enable">Nixpkgs</link>
17− and <link linkend="opt-documentation.nixos.enable">NixOS</link> are
18− forcefully enabled (to override the
19− <link linkend="sec-profile-minimal">Minimal profile</link> preference); the
20− NixOS manual is shown automatically on TTY 8, udisks is disabled.
21− Autologin is enabled as <literal>nixos</literal> user, while passwordless
22− login as both <literal>root</literal> and <literal>nixos</literal> is possible.
23− Passwordless <command>sudo</command> is enabled too.
24− <link linkend="opt-networking.wireless.enable">wpa_supplicant</link> is
25− enabled, but configured to not autostart.
13+ Documentation for <link linkend="opt-documentation.enable">Nixpkgs</link> and <link linkend="opt-documentation.nixos.enable">NixOS</link> are forcefully enabled (to override the <link linkend="sec-profile-minimal">Minimal profile</link> preference); the NixOS manual is shown automatically on TTY 8, udisks is disabled. Autologin is enabled as <literal>nixos</literal> user, while passwordless login as both <literal>root</literal> and <literal>nixos</literal> is possible. Passwordless <command>sudo</command> is enabled too. <link linkend="opt-networking.wireless.enable">wpa_supplicant</link> is enabled, but configured to not autostart.
2614 </para>
15+
2716 <para>
28− It is explained how to login, start the ssh server, and if available,
29− how to start the display manager.
17+ It is explained how to login, start the ssh server, and if available, how to start the display manager.
3018 </para>
3119
3220 <para>
33− Several settings are tweaked so that the installer has a better chance of
34− succeeding under low-memory environments.
21+ Several settings are tweaked so that the installer has a better chance of succeeding under low-memory environments.
3522 </para>
3623</section>
nixos/doc/manual/configuration/profiles/minimal.xml+1−7
@@ -6,12 +6,6 @@
66 <title>Minimal</title>
77
88 <para>
9− This profile defines a small NixOS configuration. It does not contain any
10− graphical stuff. It's a very short file that enables
11− <link linkend="opt-environment.noXlibs">noXlibs</link>, sets
12− <link linkend="opt-i18n.supportedLocales">i18n.supportedLocales</link> to
13− only support the user-selected locale,
14− <link linkend="opt-documentation.enable">disables packages' documentation
15− </link>, and <link linkend="opt-sound.enable">disables sound</link>.
9+ This profile defines a small NixOS configuration. It does not contain any graphical stuff. It's a very short file that enables <link linkend="opt-environment.noXlibs">noXlibs</link>, sets <link linkend="opt-i18n.supportedLocales">i18n.supportedLocales</link> to only support the user-selected locale, <link linkend="opt-documentation.enable">disables packages' documentation </link>, and <link linkend="opt-sound.enable">disables sound</link>.
1610 </para>
1711</section>
nixos/doc/manual/configuration/profiles/qemu-guest.xml+2−5
@@ -6,13 +6,10 @@
66 <title>QEMU Guest</title>
77
88 <para>
9− This profile contains common configuration for virtual machines running under
10− QEMU (using virtio).
9+ This profile contains common configuration for virtual machines running under QEMU (using virtio).
1110 </para>
1211
1312 <para>
14− It makes virtio modules available on the initrd, sets the system time from
15− the hardware clock to work around a bug in qemu-kvm, and
16− <link linkend="opt-security.rngd.enable">enables rngd</link>.
13+ It makes virtio modules available on the initrd, sets the system time from the hardware clock to work around a bug in qemu-kvm, and <link linkend="opt-security.rngd.enable">enables rngd</link>.
1714 </para>
1815</section>
nixos/doc/manual/configuration/ssh.xml+2−5
@@ -10,14 +10,11 @@
1010<programlisting>
1111<xref linkend="opt-services.openssh.enable"/> = true;
1212</programlisting>
13− By default, root logins using a password are disallowed. They can be disabled
14− entirely by setting <xref linkend="opt-services.openssh.permitRootLogin"/> to
15− <literal>"no"</literal>.
13+ By default, root logins using a password are disallowed. They can be disabled entirely by setting <xref linkend="opt-services.openssh.permitRootLogin"/> to <literal>"no"</literal>.
1614 </para>
1715
1816 <para>
19− You can declaratively specify authorised RSA/DSA public keys for a user as
20− follows:
17+ You can declaratively specify authorised RSA/DSA public keys for a user as follows:
2118<!-- FIXME: this might not work if the user is unmanaged. -->
2219<programlisting>
2320<link linkend="opt-users.users._name__.openssh.authorizedKeys.keys">users.users.alice.openssh.authorizedKeys.keys</link> =
nixos/doc/manual/configuration/summary.xml+2−6
@@ -6,12 +6,8 @@
66 <title>Syntax Summary</title>
77
88 <para>
9− Below is a summary of the most important syntactic constructs in the Nix
10− expression language. It’s not complete. In particular, there are many other
11− built-in functions. See the
12− <link
13−xlink:href="http://nixos.org/nix/manual/#chap-writing-nix-expressions">Nix
14− manual</link> for the rest.
9+ Below is a summary of the most important syntactic constructs in the Nix expression language. It’s not complete. In particular, there are many other built-in functions. See the <link
10+xlink:href="http://nixos.org/nix/manual/#chap-writing-nix-expressions">Nix manual</link> for the rest.
1511 </para>
1612
1713 <informaltable frame='none'>
nixos/doc/manual/configuration/user-mgmt.xml+10−43
@@ -5,10 +5,7 @@
55 xml:id="sec-user-management">
66 <title>User Management</title>
77 <para>
8− NixOS supports both declarative and imperative styles of user management. In
9− the declarative style, users are specified in
10− <filename>configuration.nix</filename>. For instance, the following states
11− that a user account named <literal>alice</literal> shall exist:
8+ NixOS supports both declarative and imperative styles of user management. In the declarative style, users are specified in <filename>configuration.nix</filename>. For instance, the following states that a user account named <literal>alice</literal> shall exist:
129<programlisting>
1310<xref linkend="opt-users.users"/>.alice = {
1411 <link linkend="opt-users.users._name__.isNormalUser">isNormalUser</link> = true;
@@ -18,60 +15,33 @@
1815 <link linkend="opt-users.users._name__.openssh.authorizedKeys.keys">openssh.authorizedKeys.keys</link> = [ "ssh-dss AAAAB3Nza... alice@foobar" ];
1916};
2017</programlisting>
21− Note that <literal>alice</literal> is a member of the
22− <literal>wheel</literal> and <literal>networkmanager</literal> groups, which
23− allows her to use <command>sudo</command> to execute commands as
24− <literal>root</literal> and to configure the network, respectively. Also note
25− the SSH public key that allows remote logins with the corresponding private
26− key. Users created in this way do not have a password by default, so they
27− cannot log in via mechanisms that require a password. However, you can use
28− the <command>passwd</command> program to set a password, which is retained
29− across invocations of <command>nixos-rebuild</command>.
18+ Note that <literal>alice</literal> is a member of the <literal>wheel</literal> and <literal>networkmanager</literal> groups, which allows her to use <command>sudo</command> to execute commands as <literal>root</literal> and to configure the network, respectively. Also note the SSH public key that allows remote logins with the corresponding private key. Users created in this way do not have a password by default, so they cannot log in via mechanisms that require a password. However, you can use the <command>passwd</command> program to set a password, which is retained across invocations of <command>nixos-rebuild</command>.
3019 </para>
3120 <para>
32− If you set <xref linkend="opt-users.mutableUsers"/> to false, then the
33− contents of <literal>/etc/passwd</literal> and <literal>/etc/group</literal>
34− will be congruent to your NixOS configuration. For instance, if you remove a
35− user from <xref linkend="opt-users.users"/> and run nixos-rebuild, the user
36− account will cease to exist. Also, imperative commands for managing users and
37− groups, such as useradd, are no longer available. Passwords may still be
38− assigned by setting the user's
39− <link linkend="opt-users.users._name__.hashedPassword">hashedPassword</link>
40− option. A hashed password can be generated using <command>mkpasswd -m
41− sha-512</command> after installing the <literal>mkpasswd</literal> package.
21+ If you set <xref linkend="opt-users.mutableUsers"/> to false, then the contents of <literal>/etc/passwd</literal> and <literal>/etc/group</literal> will be congruent to your NixOS configuration. For instance, if you remove a user from <xref linkend="opt-users.users"/> and run nixos-rebuild, the user account will cease to exist. Also, imperative commands for managing users and groups, such as useradd, are no longer available. Passwords may still be assigned by setting the user's <link linkend="opt-users.users._name__.hashedPassword">hashedPassword</link> option. A hashed password can be generated using <command>mkpasswd -m sha-512</command> after installing the <literal>mkpasswd</literal> package.
4222 </para>
4323 <para>
44− A user ID (uid) is assigned automatically. You can also specify a uid
45− manually by adding
24+ A user ID (uid) is assigned automatically. You can also specify a uid manually by adding
4625<programlisting>
4726uid = 1000;
4827</programlisting>
4928 to the user specification.
5029 </para>
5130 <para>
52− Groups can be specified similarly. The following states that a group named
53− <literal>students</literal> shall exist:
31+ Groups can be specified similarly. The following states that a group named <literal>students</literal> shall exist:
5432<programlisting>
5533<xref linkend="opt-users.groups"/>.students.gid = 1000;
5634</programlisting>
57− As with users, the group ID (gid) is optional and will be assigned
58− automatically if it’s missing.
35+ As with users, the group ID (gid) is optional and will be assigned automatically if it’s missing.
5936 </para>
6037 <para>
61− In the imperative style, users and groups are managed by commands such as
62− <command>useradd</command>, <command>groupmod</command> and so on. For
63− instance, to create a user account named <literal>alice</literal>:
38+ In the imperative style, users and groups are managed by commands such as <command>useradd</command>, <command>groupmod</command> and so on. For instance, to create a user account named <literal>alice</literal>:
6439<screen>
6540# useradd -m alice</screen>
66− To make all nix tools available to this new user use `su - USER` which opens
67− a login shell (==shell that loads the profile) for given user. This will
68− create the ~/.nix-defexpr symlink. So run:
41+ To make all nix tools available to this new user use `su - USER` which opens a login shell (==shell that loads the profile) for given user. This will create the ~/.nix-defexpr symlink. So run:
6942<screen>
7043# su - alice -c "true"</screen>
71− The flag <option>-m</option> causes the creation of a home directory for the
72− new user, which is generally what you want. The user does not have an initial
73− password and therefore cannot log in. A password can be set using the
74− <command>passwd</command> utility:
44+ The flag <option>-m</option> causes the creation of a home directory for the new user, which is generally what you want. The user does not have an initial password and therefore cannot log in. A password can be set using the <command>passwd</command> utility:
7545<screen>
7646# passwd alice
7747Enter new UNIX password: ***
@@ -80,9 +50,6 @@ Retype new UNIX password: ***
8050 A user can be deleted using <command>userdel</command>:
8151<screen>
8252# userdel -r alice</screen>
83− The flag <option>-r</option> deletes the user’s home directory. Accounts
84− can be modified using <command>usermod</command>. Unix groups can be managed
85− using <command>groupadd</command>, <command>groupmod</command> and
86− <command>groupdel</command>.
53+ The flag <option>-r</option> deletes the user’s home directory. Accounts can be modified using <command>usermod</command>. Unix groups can be managed using <command>groupadd</command>, <command>groupmod</command> and <command>groupdel</command>.
8754 </para>
8855</chapter>
nixos/doc/manual/configuration/wireless.xml+5−13
@@ -6,9 +6,7 @@
66 <title>Wireless Networks</title>
77
88 <para>
9− For a desktop installation using NetworkManager (e.g., GNOME), you just have
10− to make sure the user is in the <code>networkmanager</code> group and you can
11− skip the rest of this section on wireless networks.
9+ For a desktop installation using NetworkManager (e.g., GNOME), you just have to make sure the user is in the <code>networkmanager</code> group and you can skip the rest of this section on wireless networks.
1210 </para>
1311
1412 <para>
@@ -25,17 +23,13 @@
2523 "free.wifi" = {};
2624};
2725</programlisting>
28− Be aware that keys will be written to the nix store in plaintext! When no
29− networks are set, it will default to using a configuration file at
30− <literal>/etc/wpa_supplicant.conf</literal>. You should edit this file
31− yourself to define wireless networks, WPA keys and so on (see <citerefentry>
26+ Be aware that keys will be written to the nix store in plaintext! When no networks are set, it will default to using a configuration file at <literal>/etc/wpa_supplicant.conf</literal>. You should edit this file yourself to define wireless networks, WPA keys and so on (see <citerefentry>
3227 <refentrytitle>wpa_supplicant.conf</refentrytitle>
3328 <manvolnum>5</manvolnum> </citerefentry>).
3429 </para>
3530
3631 <para>
37− If you are using WPA2 you can generate pskRaw key using
38− <command>wpa_passphrase</command>:
32+ If you are using WPA2 you can generate pskRaw key using <command>wpa_passphrase</command>:
3933<screen>
4034<prompt>$ </prompt>wpa_passphrase ESSID PSK
4135network={
@@ -51,12 +45,10 @@ network={
5145 };
5246}
5347</programlisting>
54− or you can use it to directly generate the
55− <literal>wpa_supplicant.conf</literal>:
48+ or you can use it to directly generate the <literal>wpa_supplicant.conf</literal>:
5649<screen>
5750<prompt># </prompt>wpa_passphrase ESSID PSK > /etc/wpa_supplicant.conf</screen>
58− After you have edited the <literal>wpa_supplicant.conf</literal>, you need to
59− restart the wpa_supplicant service.
51+ After you have edited the <literal>wpa_supplicant.conf</literal>, you need to restart the wpa_supplicant service.
6052<screen>
6153<prompt># </prompt>systemctl restart wpa_supplicant.service</screen>
6254 </para>
nixos/doc/manual/configuration/x-windows.xml+40−111
@@ -5,23 +5,18 @@
55 xml:id="sec-x11">
66 <title>X Window System</title>
77 <para>
8− The X Window System (X11) provides the basis of NixOS’ graphical user
9− interface. It can be enabled as follows:
8+ The X Window System (X11) provides the basis of NixOS’ graphical user interface. It can be enabled as follows:
109<programlisting>
1110<xref linkend="opt-services.xserver.enable"/> = true;
1211</programlisting>
13− The X server will automatically detect and use the appropriate video driver
14− from a set of X.org drivers (such as <literal>vesa</literal> and
15− <literal>intel</literal>). You can also specify a driver manually, e.g.
12+ The X server will automatically detect and use the appropriate video driver from a set of X.org drivers (such as <literal>vesa</literal> and <literal>intel</literal>). You can also specify a driver manually, e.g.
1613<programlisting>
1714<xref linkend="opt-services.xserver.videoDrivers"/> = [ "r128" ];
1815</programlisting>
1916 to enable X.org’s <literal>xf86-video-r128</literal> driver.
2017 </para>
2118 <para>
22− You also need to enable at least one desktop or window manager. Otherwise,
23− you can only log into a plain undecorated <command>xterm</command> window.
24− Thus you should pick one or more of the following lines:
19+ You also need to enable at least one desktop or window manager. Otherwise, you can only log into a plain undecorated <command>xterm</command> window. Thus you should pick one or more of the following lines:
2520<programlisting>
2621<xref linkend="opt-services.xserver.desktopManager.plasma5.enable"/> = true;
2722<xref linkend="opt-services.xserver.desktopManager.xfce.enable"/> = true;
@@ -34,9 +29,7 @@
3429</programlisting>
3530 </para>
3631 <para>
37− NixOS’s default <emphasis>display manager</emphasis> (the program that
38− provides a graphical login prompt and manages the X server) is LightDM. You
39− can select an alternative one by picking one of the following lines:
32+ NixOS’s default <emphasis>display manager</emphasis> (the program that provides a graphical login prompt and manages the X server) is LightDM. You can select an alternative one by picking one of the following lines:
4033<programlisting>
4134<xref linkend="opt-services.xserver.displayManager.sddm.enable"/> = true;
4235<xref linkend="opt-services.xserver.displayManager.slim.enable"/> = true;
@@ -50,8 +43,7 @@
5043</programlisting>
5144 </para>
5245 <para>
53− The X server is started automatically at boot time. If you don’t want this
54− to happen, you can set:
46+ The X server is started automatically at boot time. If you don’t want this to happen, you can set:
5547<programlisting>
5648<xref linkend="opt-services.xserver.autorun"/> = false;
5749</programlisting>
@@ -61,8 +53,7 @@
6153</screen>
6254 </para>
6355 <para>
64− On 64-bit systems, if you want OpenGL for 32-bit programs such as in Wine,
65− you should also set the following:
56+ On 64-bit systems, if you want OpenGL for 32-bit programs such as in Wine, you should also set the following:
6657<programlisting>
6758<xref linkend="opt-hardware.opengl.driSupport32Bit"/> = true;
6859</programlisting>
@@ -70,23 +61,18 @@
7061 <simplesect xml:id="sec-x11-auto-login">
7162 <title>Auto-login</title>
7263 <para>
73− The x11 login screen can be skipped entirely, automatically logging you into
74− your window manager and desktop environment when you boot your computer.
64+ The x11 login screen can be skipped entirely, automatically logging you into your window manager and desktop environment when you boot your computer.
7565 </para>
7666 <para>
77− This is especially helpful if you have disk encryption enabled. Since you
78− already have to provide a password to decrypt your disk, entering a second
79− password to login can be redundant.
67+ This is especially helpful if you have disk encryption enabled. Since you already have to provide a password to decrypt your disk, entering a second password to login can be redundant.
8068 </para>
8169 <para>
82− To enable auto-login, you need to define your default window manager and
83− desktop environment. If you wanted no desktop environment and i3 as your your
84− window manager, you'd define:
70+ To enable auto-login, you need to define your default window manager and desktop environment. If you wanted no desktop environment and i3 as your your window manager, you'd define:
8571<programlisting>
8672<xref linkend="opt-services.xserver.desktopManager.default"/> = "none";
8773<xref linkend="opt-services.xserver.windowManager.default"/> = "i3";
8874</programlisting>
89− And, finally, to enable auto-login for a user <literal>johndoe</literal>:
75+ And, finally, to enable auto-login for a user <literal>johndoe</literal>:
9076<programlisting>
9177<xref linkend="opt-services.xserver.displayManager.auto.enable"/> = true;
9278<xref linkend="opt-services.xserver.displayManager.auto.user"/> = "johndoe";
@@ -96,9 +82,7 @@
9682 <simplesect xml:id="sec-x11-graphics-cards-nvidia">
9783 <title>Proprietary NVIDIA drivers</title>
9884 <para>
99− NVIDIA provides a proprietary driver for its graphics cards that has better
100− 3D performance than the X.org drivers. It is not enabled by default because
101− it’s not free software. You can enable it as follows:
85+ NVIDIA provides a proprietary driver for its graphics cards that has better 3D performance than the X.org drivers. It is not enabled by default because it’s not free software. You can enable it as follows:
10286<programlisting>
10387<xref linkend="opt-services.xserver.videoDrivers"/> = [ "nvidia" ];
10488</programlisting>
@@ -109,76 +93,51 @@
10993<xref linkend="opt-services.xserver.videoDrivers"/> = [ "nvidiaLegacy304" ];
11094<xref linkend="opt-services.xserver.videoDrivers"/> = [ "nvidiaLegacy173" ];
11195</programlisting>
112− You may need to reboot after enabling this driver to prevent a clash with
113− other kernel modules.
96+ You may need to reboot after enabling this driver to prevent a clash with other kernel modules.
11497 </para>
11598 </simplesect>
11699 <simplesect xml:id="sec-x11--graphics-cards-amd">
117100 <title>Proprietary AMD drivers</title>
118101 <para>
119− AMD provides a proprietary driver for its graphics cards that has better 3D
120− performance than the X.org drivers. It is not enabled by default because
121− it’s not free software. You can enable it as follows:
102+ AMD provides a proprietary driver for its graphics cards that has better 3D performance than the X.org drivers. It is not enabled by default because it’s not free software. You can enable it as follows:
122103<programlisting>
123104<xref linkend="opt-services.xserver.videoDrivers"/> = [ "ati_unfree" ];
124105</programlisting>
125− You will need to reboot after enabling this driver to prevent a clash with
126− other kernel modules.
106+ You will need to reboot after enabling this driver to prevent a clash with other kernel modules.
127107 </para>
128108 <note>
129− <para>
130− For recent AMD GPUs you most likely want to keep either the defaults
131− or <literal>"amdgpu"</literal> (both free).
132− </para>
109+ <para>
110+ For recent AMD GPUs you most likely want to keep either the defaults or <literal>"amdgpu"</literal> (both free).
111+ </para>
133112 </note>
134113 </simplesect>
135114 <simplesect xml:id="sec-x11-touchpads">
136115 <title>Touchpads</title>
137116 <para>
138− Support for Synaptics touchpads (found in many laptops such as the Dell
139− Latitude series) can be enabled as follows:
117+ Support for Synaptics touchpads (found in many laptops such as the Dell Latitude series) can be enabled as follows:
140118<programlisting>
141119<xref linkend="opt-services.xserver.libinput.enable"/> = true;
142120</programlisting>
143− The driver has many options (see <xref linkend="ch-options"/>). For
144− instance, the following disables tap-to-click behavior:
121+ The driver has many options (see <xref linkend="ch-options"/>). For instance, the following disables tap-to-click behavior:
145122<programlisting>
146123<xref linkend="opt-services.xserver.libinput.tapping"/> = false;
147124</programlisting>
148− Note: the use of <literal>services.xserver.synaptics</literal> is deprecated
149− since NixOS 17.09.
125+ Note: the use of <literal>services.xserver.synaptics</literal> is deprecated since NixOS 17.09.
150126 </para>
151127 </simplesect>
152128 <simplesect xml:id="sec-x11-gtk-and-qt-themes">
153129 <title>GTK/Qt themes</title>
154130 <para>
155− GTK themes can be installed either to user profile or system-wide (via
156− <literal>environment.systemPackages</literal>). To make Qt 5 applications
157− look similar to GTK2 ones, you can install <literal>qt5.qtbase.gtk</literal>
158− package into your system environment. It should work for all Qt 5 library
159− versions.
131+ GTK themes can be installed either to user profile or system-wide (via <literal>environment.systemPackages</literal>). To make Qt 5 applications look similar to GTK2 ones, you can install <literal>qt5.qtbase.gtk</literal> package into your system environment. It should work for all Qt 5 library versions.
160132 </para>
161133 </simplesect>
162134 <simplesect xml:id="custom-xkb-layouts">
163135 <title>Custom XKB layouts</title>
164136 <para>
165− It is possible to install custom
166− <link xlink:href="https://en.wikipedia.org/wiki/X_keyboard_extension">
167− XKB
168− </link>
169− keyboard layouts using the option
170− <option>
171− <link linkend="opt-services.xserver.extraLayouts">
172− services.xserver.extraLayouts
173− </link>
174− </option>.
175− As a first example, we are going to create a layout based on the basic US
176− layout, with an additional layer to type some greek symbols by pressing the
177− right-alt key.
137+ It is possible to install custom <link xlink:href="https://en.wikipedia.org/wiki/X_keyboard_extension"> XKB </link> keyboard layouts using the option <option> <link linkend="opt-services.xserver.extraLayouts"> services.xserver.extraLayouts </link> </option>. As a first example, we are going to create a layout based on the basic US layout, with an additional layer to type some greek symbols by pressing the right-alt key.
178138 </para>
179139 <para>
180− To do this we are going to create a <literal>us-greek</literal> file
181− with a <literal>xkb_symbols</literal> section.
140+ To do this we are going to create a <literal>us-greek</literal> file with a <literal>xkb_symbols</literal> section.
182141 </para>
183142<programlisting>
184143xkb_symbols &quot;us-greek&quot;
@@ -194,8 +153,7 @@ xkb_symbols &quot;us-greek&quot;
194153};
195154</programlisting>
196155 <para>
197− To install the layout, the filepath, a description and the list of
198− languages must be given:
156+ To install the layout, the filepath, a description and the list of languages must be given:
199157 </para>
200158<programlisting>
201159<xref linkend="opt-services.xserver.extraLayouts"/>.us-greek = {
@@ -205,32 +163,18 @@ xkb_symbols &quot;us-greek&quot;
205163}
206164</programlisting>
207165 <note>
208− <para>
209− The name should match the one given to the
210− <literal>xkb_symbols</literal> block.
211− </para>
166+ <para>
167+ The name should match the one given to the <literal>xkb_symbols</literal> block.
168+ </para>
212169 </note>
213170 <para>
214− The layout should now be installed and ready to use: try it by
215− running <literal>setxkbmap us-greek</literal> and type
216− <literal>&lt;alt&gt;+a</literal>. To change the default the usual
217− <option>
218− <link linkend="opt-services.xserver.layout">
219− services.xserver.layout
220− </link>
221− </option>
222− option can still be used.
171+ The layout should now be installed and ready to use: try it by running <literal>setxkbmap us-greek</literal> and type <literal>&lt;alt&gt;+a</literal>. To change the default the usual <option> <link linkend="opt-services.xserver.layout"> services.xserver.layout </link> </option> option can still be used.
223172 </para>
224173 <para>
225− A layout can have several other components besides
226− <literal>xkb_symbols</literal>, for example we will define new
227− keycodes for some multimedia key and bind these to some symbol.
174+ A layout can have several other components besides <literal>xkb_symbols</literal>, for example we will define new keycodes for some multimedia key and bind these to some symbol.
228175 </para>
229176 <para>
230− Use the <emphasis>xev</emphasis> utility from
231− <literal>pkgs.xorg.xev</literal> to find the codes of the keys of
232− interest, then create a <literal>media-key</literal> file to hold
233− the keycodes definitions
177+ Use the <emphasis>xev</emphasis> utility from <literal>pkgs.xorg.xev</literal> to find the codes of the keys of interest, then create a <literal>media-key</literal> file to hold the keycodes definitions
234178 </para>
235179<programlisting>
236180xkb_keycodes &quot;media&quot;
@@ -240,7 +184,7 @@ xkb_keycodes &quot;media&quot;
240184}
241185</programlisting>
242186 <para>
243− Now use the newly define keycodes in <literal>media-sym</literal>:
187+ Now use the newly define keycodes in <literal>media-sym</literal>:
244188 </para>
245189<programlisting>
246190xkb_symbols &quot;media&quot;
@@ -251,7 +195,7 @@ xkb_symbols &quot;media&quot;
251195}
252196</programlisting>
253197 <para>
254− As before, to install the layout do
198+ As before, to install the layout do
255199 </para>
256200<programlisting>
257201<xref linkend="opt-services.xserver.extraLayouts"/>.media = {
@@ -262,37 +206,22 @@ xkb_symbols &quot;media&quot;
262206};
263207</programlisting>
264208 <note>
265− <para>
266− The function <literal>pkgs.writeText &lt;filename&gt; &lt;content&gt;
267− </literal> can be useful if you prefer to keep the layout definitions
268− inside the NixOS configuration.
269− </para>
209+ <para>
210+ The function <literal>pkgs.writeText &lt;filename&gt; &lt;content&gt; </literal> can be useful if you prefer to keep the layout definitions inside the NixOS configuration.
211+ </para>
270212 </note>
271213 <para>
272− Unfortunately, the Xorg server does not (currently) support setting a
273− keymap directly but relies instead on XKB rules to select the matching
274− components (keycodes, types, ...) of a layout. This means that components
275− other than symbols won't be loaded by default. As a workaround, you
276− can set the keymap using <literal>setxkbmap</literal> at the start of the
277− session with:
214+ Unfortunately, the Xorg server does not (currently) support setting a keymap directly but relies instead on XKB rules to select the matching components (keycodes, types, ...) of a layout. This means that components other than symbols won't be loaded by default. As a workaround, you can set the keymap using <literal>setxkbmap</literal> at the start of the session with:
278215 </para>
279216<programlisting>
280217<xref linkend="opt-services.xserver.displayManager.sessionCommands"/> = "setxkbmap -keycodes media";
281218</programlisting>
282219 <para>
283− If you are manually starting the X server, you should set the argument
284− <literal>-xkbdir /etc/X11/xkb</literal>, otherwise X won't find your layout files.
285− For example with <command>xinit</command> run
286− <screen><prompt>$ </prompt>xinit -- -xkbdir /etc/X11/xkb</screen>
220+ If you are manually starting the X server, you should set the argument <literal>-xkbdir /etc/X11/xkb</literal>, otherwise X won't find your layout files. For example with <command>xinit</command> run
221+<screen><prompt>$ </prompt>xinit -- -xkbdir /etc/X11/xkb</screen>
287222 </para>
288223 <para>
289− To learn how to write layouts take a look at the XKB
290− <link xlink:href="https://www.x.org/releases/current/doc/xorg-docs/input/XKB-Enhancing.html#Defining_New_Layouts">
291− documentation
292− </link>. More example layouts can also be found
293− <link xlink:href="https://wiki.archlinux.org/index.php/X_KeyBoard_extension#Basic_examples">
294− here
295− </link>.
224+ To learn how to write layouts take a look at the XKB <link xlink:href="https://www.x.org/releases/current/doc/xorg-docs/input/XKB-Enhancing.html#Defining_New_Layouts"> documentation </link>. More example layouts can also be found <link xlink:href="https://wiki.archlinux.org/index.php/X_KeyBoard_extension#Basic_examples"> here </link>.
296225 </para>
297−</simplesect>
226+ </simplesect>
298227</chapter>
nixos/doc/manual/configuration/xfce.xml+5−16
@@ -14,8 +14,7 @@
1414</programlisting>
1515 </para>
1616 <para>
17− Optionally, <emphasis>compton</emphasis> can be enabled for nice graphical
18− effects, some example settings:
17+ Optionally, <emphasis>compton</emphasis> can be enabled for nice graphical effects, some example settings:
1918<programlisting>
2019<link linkend="opt-services.compton.enable">services.compton</link> = {
2120 <link linkend="opt-services.compton.enable">enable</link> = true;
@@ -27,9 +26,7 @@
2726</programlisting>
2827 </para>
2928 <para>
30− Some Xfce programs are not installed automatically. To install them manually
31− (system wide), put them into your
32− <xref linkend="opt-environment.systemPackages"/>.
29+ Some Xfce programs are not installed automatically. To install them manually (system wide), put them into your <xref linkend="opt-environment.systemPackages"/>.
3330 </para>
3431 <simplesect xml:id="sec-xfce-thunar-volumes">
3532 <title>Thunar Volume Support</title>
@@ -44,25 +41,17 @@
4441 <simplesect xml:id="sec-xfce-polkit">
4542 <title>Polkit Authentication Agent</title>
4643 <para>
47− There is no authentication agent automatically installed alongside Xfce. To
48− allow mounting of local (non-removable) filesystems, you will need to
49− install one. Installing <emphasis>polkit_gnome</emphasis>, a rebuild, logout
50− and login did the trick.
44+ There is no authentication agent automatically installed alongside Xfce. To allow mounting of local (non-removable) filesystems, you will need to install one. Installing <emphasis>polkit_gnome</emphasis>, a rebuild, logout and login did the trick.
5145 </para>
5246 </simplesect>
5347 <simplesect xml:id="sec-xfce-troubleshooting">
5448 <title>Troubleshooting</title>
5549 <para>
56− Even after enabling udisks2, volume management might not work. Thunar and/or
57− the desktop takes time to show up. Thunar will spit out this kind of message
58− on start (look at <command>journalctl --user -b</command>).
50+ Even after enabling udisks2, volume management might not work. Thunar and/or the desktop takes time to show up. Thunar will spit out this kind of message on start (look at <command>journalctl --user -b</command>).
5951<programlisting>
6052Thunar:2410): GVFS-RemoteVolumeMonitor-WARNING **: remote volume monitor with dbus name org.gtk.Private.UDisks2VolumeMonitor is not supported
6153</programlisting>
62− This is caused by some needed GNOME services not running. This is all fixed
63− by enabling "Launch GNOME services on startup" in the Advanced tab of the
64− Session and Startup settings panel. Alternatively, you can run this command
65− to do the same thing.
54+ This is caused by some needed GNOME services not running. This is all fixed by enabling "Launch GNOME services on startup" in the Advanced tab of the Session and Startup settings panel. Alternatively, you can run this command to do the same thing.
6655<programlisting>
6756<prompt>$ </prompt>xfconf-query -c xfce4-session -p /compat/LaunchGNOME -s true
6857</programlisting>
nixos/doc/manual/development/assertions.xml+3−15
@@ -6,18 +6,11 @@
66 <title>Warnings and Assertions</title>
77
88 <para>
9− When configuration problems are detectable in a module, it is a good idea to
10− write an assertion or warning. Doing so provides clear feedback to the user
11− and prevents errors after the build.
9+ When configuration problems are detectable in a module, it is a good idea to write an assertion or warning. Doing so provides clear feedback to the user and prevents errors after the build.
1210 </para>
1311
1412 <para>
15− Although Nix has the <literal>abort</literal> and
16− <literal>builtins.trace</literal>
17− <link xlink:href="https://nixos.org/nix/manual/#ssec-builtins">functions</link>
18− to perform such tasks, they are not ideally suited for NixOS modules. Instead
19− of these functions, you can declare your warnings and assertions using the
20− NixOS module system.
13+ Although Nix has the <literal>abort</literal> and <literal>builtins.trace</literal> <link xlink:href="https://nixos.org/nix/manual/#ssec-builtins">functions</link> to perform such tasks, they are not ideally suited for NixOS modules. Instead of these functions, you can declare your warnings and assertions using the NixOS module system.
2114 </para>
2215
2316 <section xml:id="sec-assertions-warnings">
@@ -48,12 +41,7 @@
4841 <title>Assertions</title>
4942
5043 <para>
51− This example, extracted from the
52− <link xlink:href="https://github.com/NixOS/nixpkgs/blob/release-17.09/nixos/modules/services/logging/syslogd.nix">
53− <literal>syslogd</literal> module </link> shows how to use
54− <literal>assertions</literal>. Since there can only be one active syslog
55− daemon at a time, an assertion is useful to prevent such a broken system
56− from being built.
44+ This example, extracted from the <link xlink:href="https://github.com/NixOS/nixpkgs/blob/release-17.09/nixos/modules/services/logging/syslogd.nix"> <literal>syslogd</literal> module </link> shows how to use <literal>assertions</literal>. Since there can only be one active syslog daemon at a time, an assertion is useful to prevent such a broken system from being built.
5745 </para>
5846
5947<programlisting>
nixos/doc/manual/development/building-nixos.xml+3−8
@@ -5,22 +5,17 @@
55 xml:id="sec-building-cd">
66 <title>Building Your Own NixOS CD</title>
77 <para>
8− Building a NixOS CD is as easy as configuring your own computer. The idea is
9− to use another module which will replace your
10− <filename>configuration.nix</filename> to configure the system that would be
11− installed on the CD.
8+ Building a NixOS CD is as easy as configuring your own computer. The idea is to use another module which will replace your <filename>configuration.nix</filename> to configure the system that would be installed on the CD.
129 </para>
1310 <para>
14− Default CD/DVD configurations are available inside
15− <filename>nixos/modules/installer/cd-dvd</filename>.
11+ Default CD/DVD configurations are available inside <filename>nixos/modules/installer/cd-dvd</filename>.
1612<screen>
1713<prompt>$ </prompt>git clone https://github.com/NixOS/nixpkgs.git
1814<prompt>$ </prompt>cd nixpkgs/nixos
1915<prompt>$ </prompt>nix-build -A config.system.build.isoImage -I nixos-config=modules/installer/cd-dvd/installation-cd-minimal.nix default.nix</screen>
2016 </para>
2117 <para>
22− Before burning your CD/DVD, you can check the content of the image by
23− mounting anywhere like suggested by the following command:
18+ Before burning your CD/DVD, you can check the content of the image by mounting anywhere like suggested by the following command:
2419<screen>
2520<prompt># </prompt>mount -o loop -t iso9660 ./result/iso/cd.iso /mnt/iso</screen>
2621 </para>
nixos/doc/manual/development/building-parts.xml+8−23
@@ -5,14 +5,11 @@
55 xml:id="sec-building-parts">
66 <title>Building Specific Parts of NixOS</title>
77 <para>
8− With the command <command>nix-build</command>, you can build specific parts
9− of your NixOS configuration. This is done as follows:
8+ With the command <command>nix-build</command>, you can build specific parts of your NixOS configuration. This is done as follows:
109<screen>
1110<prompt>$ </prompt>cd <replaceable>/path/to/nixpkgs/nixos</replaceable>
1211<prompt>$ </prompt>nix-build -A config.<replaceable>option</replaceable></screen>
13− where <replaceable>option</replaceable> is a NixOS option with type
14− “derivation” (i.e. something that can be built). Attributes of interest
15− include:
12+ where <replaceable>option</replaceable> is a NixOS option with type “derivation” (i.e. something that can be built). Attributes of interest include:
1613 <variablelist>
1714 <varlistentry>
1815 <term>
@@ -20,10 +17,7 @@
2017 </term>
2118 <listitem>
2219 <para>
23− The top-level option that builds the entire NixOS system. Everything else
24− in your configuration is indirectly pulled in by this option. This is
25− what <command>nixos-rebuild</command> builds and what
26− <filename>/run/current-system</filename> points to afterwards.
20+ The top-level option that builds the entire NixOS system. Everything else in your configuration is indirectly pulled in by this option. This is what <command>nixos-rebuild</command> builds and what <filename>/run/current-system</filename> points to afterwards.
2721 </para>
2822 <para>
2923 A shortcut to build this is:
@@ -48,8 +42,7 @@
4842 </term>
4943 <listitem>
5044 <para>
51− A tree of symlinks that form the static parts of
52− <filename>/etc</filename>.
45+ A tree of symlinks that form the static parts of <filename>/etc</filename>.
5346 </para>
5447 </listitem>
5548 </varlistentry>
@@ -62,9 +55,7 @@
6255 </term>
6356 <listitem>
6457 <para>
65− The initial ramdisk and kernel of the system. This allows a quick way to
66− test whether the kernel and the initial ramdisk boot correctly, by using
67− QEMU’s <option>-kernel</option> and <option>-initrd</option> options:
58+ The initial ramdisk and kernel of the system. This allows a quick way to test whether the kernel and the initial ramdisk boot correctly, by using QEMU’s <option>-kernel</option> and <option>-initrd</option> options:
6859<screen>
6960<prompt>$ </prompt>nix-build -A config.system.build.initialRamdisk -o initrd
7061<prompt>$ </prompt>nix-build -A config.system.build.kernel -o kernel
@@ -95,24 +86,18 @@
9586 </term>
9687 <listitem>
9788 <para>
98− This builds the unit with the specified name. Note that since unit names
99− contain dots (e.g. <literal>httpd.service</literal>), you need to put
100− them between quotes, like this:
89+ This builds the unit with the specified name. Note that since unit names contain dots (e.g. <literal>httpd.service</literal>), you need to put them between quotes, like this:
10190<screen>
10291<prompt>$ </prompt>nix-build -A 'config.systemd.units."httpd.service".unit'
10392</screen>
104− You can also test individual units, without rebuilding the whole system,
105− by putting them in <filename>/run/systemd/system</filename>:
93+ You can also test individual units, without rebuilding the whole system, by putting them in <filename>/run/systemd/system</filename>:
10694<screen>
10795<prompt>$ </prompt>cp $(nix-build -A 'config.systemd.units."httpd.service".unit')/httpd.service \
10896 /run/systemd/system/tmp-httpd.service
10997<prompt># </prompt>systemctl daemon-reload
11098<prompt># </prompt>systemctl start tmp-httpd.service
11199</screen>
112− Note that the unit must not have the same name as any unit in
113− <filename>/etc/systemd/system</filename> since those take precedence over
114− <filename>/run/systemd/system</filename>. That’s why the unit is
115− installed as <filename>tmp-httpd.service</filename> here.
100+ Note that the unit must not have the same name as any unit in <filename>/etc/systemd/system</filename> since those take precedence over <filename>/run/systemd/system</filename>. That’s why the unit is installed as <filename>tmp-httpd.service</filename> here.
116101 </para>
117102 </listitem>
118103 </varlistentry>
nixos/doc/manual/development/importing-modules.xml+2−5
@@ -6,8 +6,7 @@
66 <title>Importing Modules</title>
77
88 <para>
9− Sometimes NixOS modules need to be used in configuration but exist outside of
10− Nixpkgs. These modules can be imported:
9+ Sometimes NixOS modules need to be used in configuration but exist outside of Nixpkgs. These modules can be imported:
1110 </para>
1211
1312<programlisting>
@@ -25,9 +24,7 @@
2524</programlisting>
2625
2726 <para>
28− The environment variable <literal>NIXOS_EXTRA_MODULE_PATH</literal> is an
29− absolute path to a NixOS module that is included alongside the Nixpkgs NixOS
30− modules. Like any NixOS module, this module can import additional modules:
27+ The environment variable <literal>NIXOS_EXTRA_MODULE_PATH</literal> is an absolute path to a NixOS module that is included alongside the Nixpkgs NixOS modules. Like any NixOS module, this module can import additional modules:
3128 </para>
3229
3330<programlisting>
nixos/doc/manual/development/meta-attributes.xml+5−14
@@ -6,18 +6,12 @@
66 <title>Meta Attributes</title>
77
88 <para>
9− Like Nix packages, NixOS modules can declare meta-attributes to provide extra
10− information. Module meta attributes are defined in the
11− <filename
12− xlink:href="https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/misc/meta.nix">meta.nix</filename>
13− special module.
9+ Like Nix packages, NixOS modules can declare meta-attributes to provide extra information. Module meta attributes are defined in the <filename
10+ xlink:href="https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/misc/meta.nix">meta.nix</filename> special module.
1411 </para>
1512
1613 <para>
17− <literal>meta</literal> is a top level attribute like
18− <literal>options</literal> and <literal>config</literal>. Available
19− meta-attributes are <literal>maintainers</literal> and
20− <literal>doc</literal>.
14+ <literal>meta</literal> is a top level attribute like <literal>options</literal> and <literal>config</literal>. Available meta-attributes are <literal>maintainers</literal> and <literal>doc</literal>.
2115 </para>
2216
2317 <para>
@@ -51,11 +45,8 @@
5145 </callout>
5246 <callout arearefs='modules-meta-2'>
5347 <para>
54− <varname>doc</varname> points to a valid DocBook file containing the module
55− documentation. Its contents is automatically added to
56− <xref
57− linkend="ch-configuration"/>. Changes to a module documentation
58− have to be checked to not break building the NixOS manual:
48+ <varname>doc</varname> points to a valid DocBook file containing the module documentation. Its contents is automatically added to <xref
49+ linkend="ch-configuration"/>. Changes to a module documentation have to be checked to not break building the NixOS manual:
5950 </para>
6051<programlisting>$ nix-build nixos/release.nix -A manual</programlisting>
6152 </callout>
nixos/doc/manual/development/nixos-tests.xml+2−7
@@ -5,13 +5,8 @@
55 xml:id="sec-nixos-tests">
66 <title>NixOS Tests</title>
77 <para>
8− When you add some feature to NixOS, you should write a test for it. NixOS
9− tests are kept in the directory
10− <filename
11−xlink:href="https://github.com/NixOS/nixpkgs/tree/master/nixos/tests">nixos/tests</filename>,
12− and are executed (using Nix) by a testing framework that automatically starts
13− one or more virtual machines containing the NixOS system(s) required for the
14− test.
8+ When you add some feature to NixOS, you should write a test for it. NixOS tests are kept in the directory <filename
9+xlink:href="https://github.com/NixOS/nixpkgs/tree/master/nixos/tests">nixos/tests</filename>, and are executed (using Nix) by a testing framework that automatically starts one or more virtual machines containing the NixOS system(s) required for the test.
1510 </para>
1611 <xi:include href="writing-nixos-tests.xml" />
1712 <xi:include href="running-nixos-tests.xml" />
nixos/doc/manual/development/option-declarations.xml+19−61
@@ -6,9 +6,7 @@
66 <title>Option Declarations</title>
77
88 <para>
9− An option declaration specifies the name, type and description of a NixOS
10− configuration option. It is invalid to define an option that hasn’t been
11− declared in any module. An option declaration generally looks like this:
9+ An option declaration specifies the name, type and description of a NixOS configuration option. It is invalid to define an option that hasn’t been declared in any module. An option declaration generally looks like this:
1210<programlisting>
1311options = {
1412 <replaceable>name</replaceable> = mkOption {
@@ -19,13 +17,8 @@ options = {
1917 };
2018};
2119</programlisting>
22− The attribute names within the <replaceable>name</replaceable> attribute path
23− must be camel cased in general but should, as an exception, match the
24− <link
25−xlink:href="https://nixos.org/nixpkgs/manual/#sec-package-naming">
26− package attribute name</link> when referencing a Nixpkgs package. For
27− example, the option <varname>services.nix-serve.bindAddress</varname>
28− references the <varname>nix-serve</varname> Nixpkgs package.
20+ The attribute names within the <replaceable>name</replaceable> attribute path must be camel cased in general but should, as an exception, match the <link
21+xlink:href="https://nixos.org/nixpkgs/manual/#sec-package-naming"> package attribute name</link> when referencing a Nixpkgs package. For example, the option <varname>services.nix-serve.bindAddress</varname> references the <varname>nix-serve</varname> Nixpkgs package.
2922 </para>
3023
3124 <para>
@@ -37,9 +30,7 @@ xlink:href="https://nixos.org/nixpkgs/manual/#sec-package-naming">
3730 </term>
3831 <listitem>
3932 <para>
40− The type of the option (see <xref linkend='sec-option-types' />). It may
41− be omitted, but that’s not advisable since it may lead to errors that
42− are hard to diagnose.
33+ The type of the option (see <xref linkend='sec-option-types' />). It may be omitted, but that’s not advisable since it may lead to errors that are hard to diagnose.
4334 </para>
4435 </listitem>
4536 </varlistentry>
@@ -49,10 +40,7 @@ xlink:href="https://nixos.org/nixpkgs/manual/#sec-package-naming">
4940 </term>
5041 <listitem>
5142 <para>
52− The default value used if no value is defined by any module. A default is
53− not required; but if a default is not given, then users of the module
54− will have to define the value of the option, otherwise an error will be
55− thrown.
43+ The default value used if no value is defined by any module. A default is not required; but if a default is not given, then users of the module will have to define the value of the option, otherwise an error will be thrown.
5644 </para>
5745 </listitem>
5846 </varlistentry>
@@ -72,8 +60,7 @@ xlink:href="https://nixos.org/nixpkgs/manual/#sec-package-naming">
7260 </term>
7361 <listitem>
7462 <para>
75− A textual description of the option, in DocBook format, that will be
76− included in the NixOS manual.
63+ A textual description of the option, in DocBook format, that will be included in the NixOS manual.
7764 </para>
7865 </listitem>
7966 </varlistentry>
@@ -84,22 +71,15 @@ xlink:href="https://nixos.org/nixpkgs/manual/#sec-package-naming">
8471 <title>Extensible Option Types</title>
8572
8673 <para>
87− Extensible option types is a feature that allow to extend certain types
88− declaration through multiple module files. This feature only work with a
89− restricted set of types, namely <literal>enum</literal> and
90− <literal>submodules</literal> and any composed forms of them.
74+ Extensible option types is a feature that allow to extend certain types declaration through multiple module files. This feature only work with a restricted set of types, namely <literal>enum</literal> and <literal>submodules</literal> and any composed forms of them.
9175 </para>
9276
9377 <para>
94− Extensible option types can be used for <literal>enum</literal> options that
95− affects multiple modules, or as an alternative to related
96− <literal>enable</literal> options.
78+ Extensible option types can be used for <literal>enum</literal> options that affects multiple modules, or as an alternative to related <literal>enable</literal> options.
9779 </para>
9880
9981 <para>
100− As an example, we will take the case of display managers. There is a central
101− display manager module for generic display manager options and a module file
102− per display manager backend (slim, sddm, gdm ...).
82+ As an example, we will take the case of display managers. There is a central display manager module for generic display manager options and a module file per display manager backend (slim, sddm, gdm ...).
10383 </para>
10484
10585 <para>
@@ -107,14 +87,12 @@ xlink:href="https://nixos.org/nixpkgs/manual/#sec-package-naming">
10787 <itemizedlist>
10888 <listitem>
10989 <para>
110− Managing the display managers independently by adding an enable option to
111− every display manager module backend. (NixOS)
90+ Managing the display managers independently by adding an enable option to every display manager module backend. (NixOS)
11291 </para>
11392 </listitem>
11493 <listitem>
11594 <para>
116− Managing the display managers in the central module by adding an option
117− to select which display manager backend to use.
95+ Managing the display managers in the central module by adding an option to select which display manager backend to use.
11896 </para>
11997 </listitem>
12098 </itemizedlist>
@@ -125,37 +103,22 @@ xlink:href="https://nixos.org/nixpkgs/manual/#sec-package-naming">
125103 </para>
126104
127105 <para>
128− Making backends independent can quickly become hard to manage. For display
129− managers, there can be only one enabled at a time, but the type system can
130− not enforce this restriction as there is no relation between each backend
131− <literal>enable</literal> option. As a result, this restriction has to be
132− done explicitely by adding assertions in each display manager backend
133− module.
106+ Making backends independent can quickly become hard to manage. For display managers, there can be only one enabled at a time, but the type system can not enforce this restriction as there is no relation between each backend <literal>enable</literal> option. As a result, this restriction has to be done explicitely by adding assertions in each display manager backend module.
134107 </para>
135108
136109 <para>
137− On the other hand, managing the display managers backends in the central
138− module will require to change the central module option every time a new
139− backend is added or removed.
110+ On the other hand, managing the display managers backends in the central module will require to change the central module option every time a new backend is added or removed.
140111 </para>
141112
142113 <para>
143− By using extensible option types, it is possible to create a placeholder
144− option in the central module
145− (<xref linkend='ex-option-declaration-eot-service'
146− />), and to extend
147− it in each backend module
148− (<xref
149− linkend='ex-option-declaration-eot-backend-slim' />,
150− <xref
114+ By using extensible option types, it is possible to create a placeholder option in the central module (<xref linkend='ex-option-declaration-eot-service'
115+ />), and to extend it in each backend module (<xref
116+ linkend='ex-option-declaration-eot-backend-slim' />, <xref
151117 linkend='ex-option-declaration-eot-backend-sddm' />).
152118 </para>
153119
154120 <para>
155− As a result, <literal>displayManager.enable</literal> option values can be
156− added without changing the main service module file and the type system
157− automatically enforce that there can only be a single display manager
158− enabled.
121+ As a result, <literal>displayManager.enable</literal> option values can be added without changing the main service module file and the type system automatically enforce that there can only be a single display manager enabled.
159122 </para>
160123
161124 <example xml:id='ex-option-declaration-eot-service'>
@@ -184,16 +147,11 @@ services.xserver.displayManager.enable = mkOption {
184147 </example>
185148
186149 <para>
187− The placeholder declaration is a standard <literal>mkOption</literal>
188− declaration, but it is important that extensible option declarations only
189− use the <literal>type</literal> argument.
150+ The placeholder declaration is a standard <literal>mkOption</literal> declaration, but it is important that extensible option declarations only use the <literal>type</literal> argument.
190151 </para>
191152
192153 <para>
193− Extensible option types work with any of the composed variants of
194− <literal>enum</literal> such as <literal>with types; nullOr (enum [ "foo"
195− "bar" ])</literal> or <literal>with types; listOf (enum [ "foo" "bar"
196− ])</literal>.
154+ Extensible option types work with any of the composed variants of <literal>enum</literal> such as <literal>with types; nullOr (enum [ "foo" "bar" ])</literal> or <literal>with types; listOf (enum [ "foo" "bar" ])</literal>.
197155 </para>
198156 </section>
199157</section>
nixos/doc/manual/development/option-def.xml+8−26
@@ -6,33 +6,26 @@
66 <title>Option Definitions</title>
77
88 <para>
9− Option definitions are generally straight-forward bindings of values to
10− option names, like
9+ Option definitions are generally straight-forward bindings of values to option names, like
1110<programlisting>
1211config = {
1312 services.httpd.enable = true;
1413};
1514</programlisting>
16− However, sometimes you need to wrap an option definition or set of option
17− definitions in a <emphasis>property</emphasis> to achieve certain effects:
15+ However, sometimes you need to wrap an option definition or set of option definitions in a <emphasis>property</emphasis> to achieve certain effects:
1816 </para>
1917
2018 <simplesect xml:id="sec-option-definitions-delaying-conditionals">
2119 <title>Delaying Conditionals</title>
2220 <para>
23− If a set of option definitions is conditional on the value of another
24− option, you may need to use <varname>mkIf</varname>. Consider, for instance:
21+ If a set of option definitions is conditional on the value of another option, you may need to use <varname>mkIf</varname>. Consider, for instance:
2522<programlisting>
2623config = if config.services.httpd.enable then {
2724 environment.systemPackages = [ <replaceable>...</replaceable> ];
2825 <replaceable>...</replaceable>
2926} else {};
3027</programlisting>
31− This definition will cause Nix to fail with an “infinite recursion”
32− error. Why? Because the value of
33− <option>config.services.httpd.enable</option> depends on the value being
34− constructed here. After all, you could also write the clearly circular and
35− contradictory:
28+ This definition will cause Nix to fail with an “infinite recursion” error. Why? Because the value of <option>config.services.httpd.enable</option> depends on the value being constructed here. After all, you could also write the clearly circular and contradictory:
3629<programlisting>
3730config = if config.services.httpd.enable then {
3831 services.httpd.enable = false;
@@ -47,9 +40,7 @@ config = mkIf config.services.httpd.enable {
4740 <replaceable>...</replaceable>
4841};
4942</programlisting>
50− The special function <varname>mkIf</varname> causes the evaluation of the
51− conditional to be “pushed down” into the individual definitions, as if
52− you had written:
43+ The special function <varname>mkIf</varname> causes the evaluation of the conditional to be “pushed down” into the individual definitions, as if you had written:
5344<programlisting>
5445config = {
5546 environment.systemPackages = if config.services.httpd.enable then [ <replaceable>...</replaceable> ] else [];
@@ -62,27 +53,18 @@ config = {
6253 <simplesect xml:id="sec-option-definitions-setting-priorities">
6354 <title>Setting Priorities</title>
6455 <para>
65− A module can override the definitions of an option in other modules by
66− setting a <emphasis>priority</emphasis>. All option definitions that do not
67− have the lowest priority value are discarded. By default, option definitions
68− have priority 1000. You can specify an explicit priority by using
69− <varname>mkOverride</varname>, e.g.
56+ A module can override the definitions of an option in other modules by setting a <emphasis>priority</emphasis>. All option definitions that do not have the lowest priority value are discarded. By default, option definitions have priority 1000. You can specify an explicit priority by using <varname>mkOverride</varname>, e.g.
7057<programlisting>
7158services.openssh.enable = mkOverride 10 false;
7259</programlisting>
73− This definition causes all other definitions with priorities above 10 to be
74− discarded. The function <varname>mkForce</varname> is equal to
75− <varname>mkOverride 50</varname>.
60+ This definition causes all other definitions with priorities above 10 to be discarded. The function <varname>mkForce</varname> is equal to <varname>mkOverride 50</varname>.
7661 </para>
7762 </simplesect>
7863
7964 <simplesect xml:id="sec-option-definitions-merging">
8065 <title>Merging Configurations</title>
8166 <para>
82− In conjunction with <literal>mkIf</literal>, it is sometimes useful for a
83− module to return multiple sets of option definitions, to be merged together
84− as if they were declared in separate modules. This can be done using
85− <varname>mkMerge</varname>:
67+ In conjunction with <literal>mkIf</literal>, it is sometimes useful for a module to return multiple sets of option definitions, to be merged together as if they were declared in separate modules. This can be done using <varname>mkMerge</varname>:
8668<programlisting>
8769config = mkMerge
8870 [ # Unconditional stuff.
nixos/doc/manual/development/option-types.xml+47−161
@@ -6,18 +6,14 @@
66 <title>Options Types</title>
77
88 <para>
9− Option types are a way to put constraints on the values a module option can
10− take. Types are also responsible of how values are merged in case of multiple
11− value definitions.
9+ Option types are a way to put constraints on the values a module option can take. Types are also responsible of how values are merged in case of multiple value definitions.
1210 </para>
1311
1412 <section xml:id="sec-option-types-basic">
1513 <title>Basic Types</title>
1614
1715 <para>
18− Basic types are the simplest available types in the module system. Basic
19− types include multiple string types that mainly differ in how definition
20− merging is handled.
16+ Basic types are the simplest available types in the module system. Basic types include multiple string types that mainly differ in how definition merging is handled.
2117 </para>
2218
2319 <variablelist>
@@ -37,8 +33,7 @@
3733 </term>
3834 <listitem>
3935 <para>
40− A boolean, its values can be <literal>true</literal> or
41− <literal>false</literal>.
36+ A boolean, its values can be <literal>true</literal> or <literal>false</literal>.
4237 </para>
4338 </listitem>
4439 </varlistentry>
@@ -48,9 +43,7 @@
4843 </term>
4944 <listitem>
5045 <para>
51− A filesystem path, defined as anything that when coerced to a string
52− starts with a slash. Even if derivations can be considered as path, the
53− more specific <literal>types.package</literal> should be preferred.
46+ A filesystem path, defined as anything that when coerced to a string starts with a slash. Even if derivations can be considered as path, the more specific <literal>types.package</literal> should be preferred.
5447 </para>
5548 </listitem>
5649 </varlistentry>
@@ -87,12 +80,7 @@
8780 </term>
8881 <listitem>
8982 <para>
90− Signed integers with a fixed length (8, 16 or 32 bits). They go from
91− <inlineequation><mathphrase>−2<superscript>n</superscript>/2</mathphrase>
92− </inlineequation> to <inlineequation>
93− <mathphrase>2<superscript>n</superscript>/2−1</mathphrase>
94− </inlineequation> respectively (e.g. <literal>−128</literal> to
95− <literal>127</literal> for 8 bits).
83+ Signed integers with a fixed length (8, 16 or 32 bits). They go from <inlineequation><mathphrase>−2<superscript>n</superscript>/2</mathphrase> </inlineequation> to <inlineequation> <mathphrase>2<superscript>n</superscript>/2−1</mathphrase> </inlineequation> respectively (e.g. <literal>−128</literal> to <literal>127</literal> for 8 bits).
9684 </para>
9785 </listitem>
9886 </varlistentry>
@@ -112,12 +100,7 @@
112100 </term>
113101 <listitem>
114102 <para>
115− Unsigned integers with a fixed length (8, 16 or 32 bits). They go from
116− <inlineequation><mathphrase>0</mathphrase></inlineequation> to
117− <inlineequation>
118− <mathphrase>2<superscript>n</superscript>−1</mathphrase>
119− </inlineequation> respectively (e.g. <literal>0</literal> to
120− <literal>255</literal> for 8 bits).
103+ Unsigned integers with a fixed length (8, 16 or 32 bits). They go from <inlineequation><mathphrase>0</mathphrase></inlineequation> to <inlineequation> <mathphrase>2<superscript>n</superscript>−1</mathphrase> </inlineequation> respectively (e.g. <literal>0</literal> to <literal>255</literal> for 8 bits).
121104 </para>
122105 </listitem>
123106 </varlistentry>
@@ -137,8 +120,7 @@
137120 </term>
138121 <listitem>
139122 <para>
140− A port number. This type is an alias to
141− <link linkend='types.ints.ux'><varname>types.ints.u16</varname></link>.
123+ A port number. This type is an alias to <link linkend='types.ints.ux'><varname>types.ints.u16</varname></link>.
142124 </para>
143125 </listitem>
144126 </varlistentry>
@@ -165,8 +147,7 @@
165147 </term>
166148 <listitem>
167149 <para>
168− A string. Multiple definitions are concatenated with a new line
169− <literal>"\n"</literal>.
150+ A string. Multiple definitions are concatenated with a new line <literal>"\n"</literal>.
170151 </para>
171152 </listitem>
172153 </varlistentry>
@@ -176,8 +157,7 @@
176157 </term>
177158 <listitem>
178159 <para>
179− A string. Multiple definitions are concatenated with a comma
180− <literal>","</literal>.
160+ A string. Multiple definitions are concatenated with a comma <literal>","</literal>.
181161 </para>
182162 </listitem>
183163 </varlistentry>
@@ -187,8 +167,7 @@
187167 </term>
188168 <listitem>
189169 <para>
190− A string. Multiple definitions are concatenated with a collon
191− <literal>":"</literal>.
170+ A string. Multiple definitions are concatenated with a collon <literal>":"</literal>.
192171 </para>
193172 </listitem>
194173 </varlistentry>
@@ -198,9 +177,7 @@
198177 </term>
199178 <listitem>
200179 <para>
201− A string matching a specific regular expression. Multiple definitions
202− cannot be merged. The regular expression is processed using
203− <literal>builtins.match</literal>.
180+ A string matching a specific regular expression. Multiple definitions cannot be merged. The regular expression is processed using <literal>builtins.match</literal>.
204181 </para>
205182 </listitem>
206183 </varlistentry>
@@ -221,9 +198,7 @@
221198 </term>
222199 <listitem>
223200 <para>
224− One element of the list <replaceable>l</replaceable>, e.g.
225− <literal>types.enum [ "left" "right" ]</literal>. Multiple definitions
226− cannot be merged.
201+ One element of the list <replaceable>l</replaceable>, e.g. <literal>types.enum [ "left" "right" ]</literal>. Multiple definitions cannot be merged.
227202 </para>
228203 </listitem>
229204 </varlistentry>
@@ -233,8 +208,7 @@
233208 </term>
234209 <listitem>
235210 <para>
236− A string with a custom separator <replaceable>sep</replaceable>, e.g.
237− <literal>types.separatedString "|"</literal>.
211+ A string with a custom separator <replaceable>sep</replaceable>, e.g. <literal>types.separatedString "|"</literal>.
238212 </para>
239213 </listitem>
240214 </varlistentry>
@@ -244,9 +218,7 @@
244218 </term>
245219 <listitem>
246220 <para>
247− An integer between <replaceable>lowest</replaceable> and
248− <replaceable>highest</replaceable> (both inclusive). Useful for creating
249− types like <literal>types.port</literal>.
221+ An integer between <replaceable>lowest</replaceable> and <replaceable>highest</replaceable> (both inclusive). Useful for creating types like <literal>types.port</literal>.
250222 </para>
251223 </listitem>
252224 </varlistentry>
@@ -256,11 +228,7 @@
256228 </term>
257229 <listitem>
258230 <para>
259− A set of sub options <replaceable>o</replaceable>.
260− <replaceable>o</replaceable> can be an attribute set or a function
261− returning an attribute set. Submodules are used in composed types to
262− create modular options. Submodule are detailed in
263− <xref
231+ A set of sub options <replaceable>o</replaceable>. <replaceable>o</replaceable> can be an attribute set or a function returning an attribute set. Submodules are used in composed types to create modular options. Submodule are detailed in <xref
264232 linkend='section-option-types-submodule' />.
265233 </para>
266234 </listitem>
@@ -272,9 +240,7 @@
272240 <title>Composed Types</title>
273241
274242 <para>
275− Composed types are types that take a type as parameter. <literal>listOf
276− int</literal> and <literal>either int str</literal> are examples of composed
277− types.
243+ Composed types are types that take a type as parameter. <literal>listOf int</literal> and <literal>either int str</literal> are examples of composed types.
278244 </para>
279245
280246 <variablelist>
@@ -284,8 +250,7 @@
284250 </term>
285251 <listitem>
286252 <para>
287− A list of <replaceable>t</replaceable> type, e.g. <literal>types.listOf
288− int</literal>. Multiple definitions are merged with list concatenation.
253+ A list of <replaceable>t</replaceable> type, e.g. <literal>types.listOf int</literal>. Multiple definitions are merged with list concatenation.
289254 </para>
290255 </listitem>
291256 </varlistentry>
@@ -295,9 +260,7 @@
295260 </term>
296261 <listitem>
297262 <para>
298− An attribute set of where all the values are of
299− <replaceable>t</replaceable> type. Multiple definitions result in the
300− joined attribute set.
263+ An attribute set of where all the values are of <replaceable>t</replaceable> type. Multiple definitions result in the joined attribute set.
301264 </para>
302265 </listitem>
303266 </varlistentry>
@@ -307,8 +270,7 @@
307270 </term>
308271 <listitem>
309272 <para>
310− An attribute set or a list of <replaceable>t</replaceable> type. Multiple
311− definitions are merged according to the value.
273+ An attribute set or a list of <replaceable>t</replaceable> type. Multiple definitions are merged according to the value.
312274 </para>
313275 </listitem>
314276 </varlistentry>
@@ -318,8 +280,7 @@
318280 </term>
319281 <listitem>
320282 <para>
321− <literal>null</literal> or type <replaceable>t</replaceable>. Multiple
322− definitions are merged according to type <replaceable>t</replaceable>.
283+ <literal>null</literal> or type <replaceable>t</replaceable>. Multiple definitions are merged according to type <replaceable>t</replaceable>.
323284 </para>
324285 </listitem>
325286 </varlistentry>
@@ -329,8 +290,7 @@
329290 </term>
330291 <listitem>
331292 <para>
332− Ensures that type <replaceable>t</replaceable> cannot be merged. It is
333− used to ensure option definitions are declared only once.
293+ Ensures that type <replaceable>t</replaceable> cannot be merged. It is used to ensure option definitions are declared only once.
334294 </para>
335295 </listitem>
336296 </varlistentry>
@@ -340,9 +300,7 @@
340300 </term>
341301 <listitem>
342302 <para>
343− Type <replaceable>t1</replaceable> or type <replaceable>t2</replaceable>,
344− e.g. <literal>with types; either int str</literal>. Multiple definitions
345− cannot be merged.
303+ Type <replaceable>t1</replaceable> or type <replaceable>t2</replaceable>, e.g. <literal>with types; either int str</literal>. Multiple definitions cannot be merged.
346304 </para>
347305 </listitem>
348306 </varlistentry>
@@ -352,9 +310,7 @@
352310 </term>
353311 <listitem>
354312 <para>
355− Type <replaceable>t1</replaceable> or type <replaceable>t2</replaceable> and so forth,
356− e.g. <literal>with types; oneOf [ int str bool ]</literal>. Multiple definitions
357− cannot be merged.
313+ Type <replaceable>t1</replaceable> or type <replaceable>t2</replaceable> and so forth, e.g. <literal>with types; oneOf [ int str bool ]</literal>. Multiple definitions cannot be merged.
358314 </para>
359315 </listitem>
360316 </varlistentry>
@@ -364,12 +320,7 @@
364320 </term>
365321 <listitem>
366322 <para>
367− Type <replaceable>to</replaceable> or type
368− <replaceable>from</replaceable> which will be coerced to type
369− <replaceable>to</replaceable> using function <replaceable>f</replaceable>
370− which takes an argument of type <replaceable>from</replaceable> and
371− return a value of type <replaceable>to</replaceable>. Can be used to
372− preserve backwards compatibility of an option if its type was changed.
323+ Type <replaceable>to</replaceable> or type <replaceable>from</replaceable> which will be coerced to type <replaceable>to</replaceable> using function <replaceable>f</replaceable> which takes an argument of type <replaceable>from</replaceable> and return a value of type <replaceable>to</replaceable>. Can be used to preserve backwards compatibility of an option if its type was changed.
373324 </para>
374325 </listitem>
375326 </varlistentry>
@@ -380,22 +331,15 @@
380331 <title>Submodule</title>
381332
382333 <para>
383− <literal>submodule</literal> is a very powerful type that defines a set of
384− sub-options that are handled like a separate module.
334+ <literal>submodule</literal> is a very powerful type that defines a set of sub-options that are handled like a separate module.
385335 </para>
386336
387337 <para>
388− It takes a parameter <replaceable>o</replaceable>, that should be a set, or
389− a function returning a set with an <literal>options</literal> key defining
390− the sub-options. Submodule option definitions are type-checked accordingly
391− to the <literal>options</literal> declarations. Of course, you can nest
392− submodule option definitons for even higher modularity.
338+ It takes a parameter <replaceable>o</replaceable>, that should be a set, or a function returning a set with an <literal>options</literal> key defining the sub-options. Submodule option definitions are type-checked accordingly to the <literal>options</literal> declarations. Of course, you can nest submodule option definitons for even higher modularity.
393339 </para>
394340
395341 <para>
396− The option set can be defined directly
397− (<xref linkend='ex-submodule-direct' />) or as reference
398− (<xref linkend='ex-submodule-reference' />).
342+ The option set can be defined directly (<xref linkend='ex-submodule-direct' />) or as reference (<xref linkend='ex-submodule-reference' />).
399343 </para>
400344
401345 <example xml:id='ex-submodule-direct'>
@@ -438,12 +382,7 @@ options.mod = mkOption {
438382 </example>
439383
440384 <para>
441− The <literal>submodule</literal> type is especially interesting when used
442− with composed types like <literal>attrsOf</literal> or
443− <literal>listOf</literal>. When composed with <literal>listOf</literal>
444− (<xref linkend='ex-submodule-listof-declaration' />),
445− <literal>submodule</literal> allows multiple definitions of the submodule
446− option set (<xref linkend='ex-submodule-listof-definition' />).
385+ The <literal>submodule</literal> type is especially interesting when used with composed types like <literal>attrsOf</literal> or <literal>listOf</literal>. When composed with <literal>listOf</literal> (<xref linkend='ex-submodule-listof-declaration' />), <literal>submodule</literal> allows multiple definitions of the submodule option set (<xref linkend='ex-submodule-listof-definition' />).
447386 </para>
448387
449388 <example xml:id='ex-submodule-listof-declaration'>
@@ -474,10 +413,7 @@ config.mod = [
474413 </example>
475414
476415 <para>
477− When composed with <literal>attrsOf</literal>
478− (<xref linkend='ex-submodule-attrsof-declaration' />),
479− <literal>submodule</literal> allows multiple named definitions of the
480− submodule option set (<xref linkend='ex-submodule-attrsof-definition' />).
416+ When composed with <literal>attrsOf</literal> (<xref linkend='ex-submodule-attrsof-declaration' />), <literal>submodule</literal> allows multiple named definitions of the submodule option set (<xref linkend='ex-submodule-attrsof-definition' />).
481417 </para>
482418
483419 <example xml:id='ex-submodule-attrsof-declaration'>
@@ -510,8 +446,7 @@ config.mod.two = { foo = 2; bar = "two"; };</screen>
510446 <title>Extending types</title>
511447
512448 <para>
513− Types are mainly characterized by their <literal>check</literal> and
514− <literal>merge</literal> functions.
449+ Types are mainly characterized by their <literal>check</literal> and <literal>merge</literal> functions.
515450 </para>
516451
517452 <variablelist>
@@ -521,13 +456,8 @@ config.mod.two = { foo = 2; bar = "two"; };</screen>
521456 </term>
522457 <listitem>
523458 <para>
524− The function to type check the value. Takes a value as parameter and
525− return a boolean. It is possible to extend a type check with the
526− <literal>addCheck</literal> function
527− (<xref
528− linkend='ex-extending-type-check-1' />), or to fully
529− override the check function
530− (<xref linkend='ex-extending-type-check-2' />).
459+ The function to type check the value. Takes a value as parameter and return a boolean. It is possible to extend a type check with the <literal>addCheck</literal> function (<xref
460+ linkend='ex-extending-type-check-1' />), or to fully override the check function (<xref linkend='ex-extending-type-check-2' />).
531461 </para>
532462 <example xml:id='ex-extending-type-check-1'>
533463 <title>Adding a type check</title>
@@ -555,11 +485,7 @@ nixThings = mkOption {
555485 </term>
556486 <listitem>
557487 <para>
558− Function to merge the options values when multiple values are set. The
559− function takes two parameters, <literal>loc</literal> the option path as
560− a list of strings, and <literal>defs</literal> the list of defined values
561− as a list. It is possible to override a type merge function for custom
562− needs.
488+ Function to merge the options values when multiple values are set. The function takes two parameters, <literal>loc</literal> the option path as a list of strings, and <literal>defs</literal> the list of defined values as a list. It is possible to override a type merge function for custom needs.
563489 </para>
564490 </listitem>
565491 </varlistentry>
@@ -570,12 +496,8 @@ nixThings = mkOption {
570496 <title>Custom Types</title>
571497
572498 <para>
573− Custom types can be created with the <literal>mkOptionType</literal>
574− function. As type creation includes some more complex topics such as
575− submodule handling, it is recommended to get familiar with
576− <filename
577− xlink:href="https://github.com/NixOS/nixpkgs/blob/master/lib/types.nix">types.nix</filename>
578− code before creating a new type.
499+ Custom types can be created with the <literal>mkOptionType</literal> function. As type creation includes some more complex topics such as submodule handling, it is recommended to get familiar with <filename
500+ xlink:href="https://github.com/NixOS/nixpkgs/blob/master/lib/types.nix">types.nix</filename> code before creating a new type.
579501 </para>
580502
581503 <para>
@@ -599,8 +521,7 @@ nixThings = mkOption {
599521 </term>
600522 <listitem>
601523 <para>
602− Description of the type used in documentation. Give information of the
603− type and any of its arguments.
524+ Description of the type used in documentation. Give information of the type and any of its arguments.
604525 </para>
605526 </listitem>
606527 </varlistentry>
@@ -610,10 +531,7 @@ nixThings = mkOption {
610531 </term>
611532 <listitem>
612533 <para>
613− A function to type check the definition value. Takes the definition value
614− as a parameter and returns a boolean indicating the type check result,
615− <literal>true</literal> for success and <literal>false</literal> for
616− failure.
534+ A function to type check the definition value. Takes the definition value as a parameter and returns a boolean indicating the type check result, <literal>true</literal> for success and <literal>false</literal> for failure.
617535 </para>
618536 </listitem>
619537 </varlistentry>
@@ -632,8 +550,7 @@ nixThings = mkOption {
632550 </term>
633551 <listitem>
634552 <para>
635− The option path as a list of strings, e.g. <literal>["boot" "loader
636− "grub" "enable"]</literal>.
553+ The option path as a list of strings, e.g. <literal>["boot" "loader "grub" "enable"]</literal>.
637554 </para>
638555 </listitem>
639556 </varlistentry>
@@ -643,12 +560,7 @@ nixThings = mkOption {
643560 </term>
644561 <listitem>
645562 <para>
646− The list of sets of defined <literal>value</literal> and
647− <literal>file</literal> where the value was defined, e.g. <literal>[ {
648− file = "/foo.nix"; value = 1; } { file = "/bar.nix"; value = 2 }
649− ]</literal>. The <literal>merge</literal> function should return the
650− merged value or throw an error in case the values are impossible or
651− not meant to be merged.
563+ The list of sets of defined <literal>value</literal> and <literal>file</literal> where the value was defined, e.g. <literal>[ { file = "/foo.nix"; value = 1; } { file = "/bar.nix"; value = 2 } ]</literal>. The <literal>merge</literal> function should return the merged value or throw an error in case the values are impossible or not meant to be merged.
652564 </para>
653565 </listitem>
654566 </varlistentry>
@@ -661,13 +573,7 @@ nixThings = mkOption {
661573 </term>
662574 <listitem>
663575 <para>
664− For composed types that can take a submodule as type parameter, this
665− function generate sub-options documentation. It takes the current option
666− prefix as a list and return the set of sub-options. Usually defined in a
667− recursive manner by adding a term to the prefix, e.g. <literal>prefix:
668− elemType.getSubOptions (prefix ++
669− [<replaceable>"prefix"</replaceable>])</literal> where
670− <replaceable>"prefix"</replaceable> is the newly added prefix.
576+ For composed types that can take a submodule as type parameter, this function generate sub-options documentation. It takes the current option prefix as a list and return the set of sub-options. Usually defined in a recursive manner by adding a term to the prefix, e.g. <literal>prefix: elemType.getSubOptions (prefix ++ [<replaceable>"prefix"</replaceable>])</literal> where <replaceable>"prefix"</replaceable> is the newly added prefix.
671577 </para>
672578 </listitem>
673579 </varlistentry>
@@ -677,11 +583,7 @@ nixThings = mkOption {
677583 </term>
678584 <listitem>
679585 <para>
680− For composed types that can take a submodule as type parameter, this
681− function should return the type parameters submodules. If the type
682− parameter is called <literal>elemType</literal>, the function should just
683− recursively look into submodules by returning
684− <literal>elemType.getSubModules;</literal>.
586+ For composed types that can take a submodule as type parameter, this function should return the type parameters submodules. If the type parameter is called <literal>elemType</literal>, the function should just recursively look into submodules by returning <literal>elemType.getSubModules;</literal>.
685587 </para>
686588 </listitem>
687589 </varlistentry>
@@ -691,14 +593,7 @@ nixThings = mkOption {
691593 </term>
692594 <listitem>
693595 <para>
694− For composed types that can take a submodule as type parameter, this
695− function can be used to substitute the parameter of a submodule type. It
696− takes a module as parameter and return the type with the submodule
697− options substituted. It is usually defined as a type function call with a
698− recursive call to <literal>substSubModules</literal>, e.g for a type
699− <literal>composedType</literal> that take an <literal>elemtype</literal>
700− type parameter, this function should be defined as <literal>m:
701− composedType (elemType.substSubModules m)</literal>.
596+ For composed types that can take a submodule as type parameter, this function can be used to substitute the parameter of a submodule type. It takes a module as parameter and return the type with the submodule options substituted. It is usually defined as a type function call with a recursive call to <literal>substSubModules</literal>, e.g for a type <literal>composedType</literal> that take an <literal>elemtype</literal> type parameter, this function should be defined as <literal>m: composedType (elemType.substSubModules m)</literal>.
702597 </para>
703598 </listitem>
704599 </varlistentry>
@@ -708,9 +603,7 @@ nixThings = mkOption {
708603 </term>
709604 <listitem>
710605 <para>
711− A function to merge multiple type declarations. Takes the type to merge
712− <literal>functor</literal> as parameter. A <literal>null</literal> return
713− value means that type cannot be merged.
606+ A function to merge multiple type declarations. Takes the type to merge <literal>functor</literal> as parameter. A <literal>null</literal> return value means that type cannot be merged.
714607 </para>
715608 <variablelist>
716609 <varlistentry>
@@ -725,8 +618,7 @@ nixThings = mkOption {
725618 </varlistentry>
726619 </variablelist>
727620 <para>
728− Note: There is a generic <literal>defaultTypeMerge</literal> that work
729− with most of value and composed types.
621+ Note: There is a generic <literal>defaultTypeMerge</literal> that work with most of value and composed types.
730622 </para>
731623 </listitem>
732624 </varlistentry>
@@ -736,8 +628,7 @@ nixThings = mkOption {
736628 </term>
737629 <listitem>
738630 <para>
739− An attribute set representing the type. It is used for type operations
740− and has the following keys:
631+ An attribute set representing the type. It is used for type operations and has the following keys:
741632 </para>
742633 <variablelist>
743634 <varlistentry>
@@ -766,10 +657,7 @@ nixThings = mkOption {
766657 </term>
767658 <listitem>
768659 <para>
769− Holds the value parameter for value types. The types that have a
770− <literal>payload</literal> are the <literal>enum</literal>,
771− <literal>separatedString</literal> and <literal>submodule</literal>
772− types.
660+ Holds the value parameter for value types. The types that have a <literal>payload</literal> are the <literal>enum</literal>, <literal>separatedString</literal> and <literal>submodule</literal> types.
773661 </para>
774662 </listitem>
775663 </varlistentry>
@@ -779,9 +667,7 @@ nixThings = mkOption {
779667 </term>
780668 <listitem>
781669 <para>
782− A binary operation that can merge the payloads of two same types.
783− Defined as a function that take two payloads as parameters and return
784− the payloads merged.
670+ A binary operation that can merge the payloads of two same types. Defined as a function that take two payloads as parameters and return the payloads merged.
785671 </para>
786672 </listitem>
787673 </varlistentry>
nixos/doc/manual/development/releases.xml+54−72
@@ -17,15 +17,12 @@
1717 <itemizedlist spacing="compact">
1818 <listitem>
1919 <para>
20− Send an email to the nix-devel mailinglist as a warning about upcoming
21− beta "feature freeze" in a month.
20+ Send an email to the nix-devel mailinglist as a warning about upcoming beta "feature freeze" in a month.
2221 </para>
2322 </listitem>
2423 <listitem>
2524 <para>
26− Discuss with Eelco Dolstra and the community (via IRC, ML) about what
27− will reach the deadline. Any issue or Pull Request targeting the release
28− should be included in the release milestone.
25+ Discuss with Eelco Dolstra and the community (via IRC, ML) about what will reach the deadline. Any issue or Pull Request targeting the release should be included in the release milestone.
2926 </para>
3027 </listitem>
3128 </itemizedlist>
@@ -37,42 +34,32 @@
3734 <itemizedlist spacing="compact">
3835 <listitem>
3936 <para>
40− <link xlink:href="https://github.com/NixOS/nixpkgs/issues/13559">Create
41− an issue for tracking Zero Hydra Failures progress. ZHF is an effort to
42− get build failures down to zero.</link>
37+ <link xlink:href="https://github.com/NixOS/nixpkgs/issues/13559">Create an issue for tracking Zero Hydra Failures progress. ZHF is an effort to get build failures down to zero.</link>
4338 </para>
4439 </listitem>
4540 <listitem>
4641 <para>
47− <literal>git tag -a -s -m &quot;Release 17.09-beta&quot; 17.09-beta
48− &amp;&amp; git push --tags</literal>
42+ <literal>git tag -a -s -m &quot;Release 17.09-beta&quot; 17.09-beta &amp;&amp; git push --tags</literal>
4943 </para>
5044 </listitem>
5145 <listitem>
5246 <para>
53− From the master branch run <literal>git checkout -B
54− release-17.09</literal>.
47+ From the master branch run <literal>git checkout -B release-17.09</literal>.
5548 </para>
5649 </listitem>
5750 <listitem>
5851 <para>
59− <link xlink:href="https://github.com/NixOS/nixos-org-configurations/pull/18">
60− Make sure a channel is created at http://nixos.org/channels/. </link>
52+ <link xlink:href="https://github.com/NixOS/nixos-org-configurations/pull/18"> Make sure a channel is created at http://nixos.org/channels/. </link>
6153 </para>
6254 </listitem>
6355 <listitem>
6456 <para>
65− <link xlink:href="https://github.com/NixOS/nixpkgs/compare/bdf161ed8d21...6b63c4616790">
66− Bump the <literal>system.defaultChannel</literal> attribute in
67− <literal>nixos/modules/misc/version.nix</literal> </link>
57+ <link xlink:href="https://github.com/NixOS/nixpkgs/compare/bdf161ed8d21...6b63c4616790"> Bump the <literal>system.defaultChannel</literal> attribute in <literal>nixos/modules/misc/version.nix</literal> </link>
6858 </para>
6959 </listitem>
7060 <listitem>
7161 <para>
72− <link xlink:href="https://github.com/NixOS/nixpkgs/commit/d6b08acd1ccac0d9d502c4b635e00b04d3387f06">
73− Update <literal>versionSuffix</literal> in
74− <literal>nixos/release.nix</literal></link>, use <literal>git log
75− --format=%an|wc -l</literal> to get the commit count
62+ <link xlink:href="https://github.com/NixOS/nixpkgs/commit/d6b08acd1ccac0d9d502c4b635e00b04d3387f06"> Update <literal>versionSuffix</literal> in <literal>nixos/release.nix</literal></link>, use <literal>git log --format=%an|wc -l</literal> to get the commit count
7663 </para>
7764 </listitem>
7865 <listitem>
@@ -82,44 +69,32 @@
8269 </listitem>
8370 <listitem>
8471 <para>
85− <link xlink:href="https://github.com/NixOS/nixpkgs/commit/b8a4095003e27659092892a4708bb3698231a842">
86− Pick a new name for the unstable branch. </link>
72+ <link xlink:href="https://github.com/NixOS/nixpkgs/commit/b8a4095003e27659092892a4708bb3698231a842"> Pick a new name for the unstable branch. </link>
8773 </para>
8874 </listitem>
8975 <listitem>
9076 <para>
91− Create a new release notes file for the upcoming release + 1, in this
92− case <literal>rl-1803.xml</literal>.
77+ Create a new release notes file for the upcoming release + 1, in this case <literal>rl-1803.xml</literal>.
9378 </para>
9479 </listitem>
9580 <listitem>
9681 <para>
97− Create two Hydra jobsets: release-17.09 and release-17.09-small with
98− <literal>stableBranch</literal> set to false.
82+ Create two Hydra jobsets: release-17.09 and release-17.09-small with <literal>stableBranch</literal> set to false.
9983 </para>
10084 </listitem>
10185 <listitem>
10286 <para>
103− Remove attributes that we know we will not be able to support,
104− especially if there is a stable alternative. E.g. Check that our
105− Linux kernels'
106− <link xlink:href="https://www.kernel.org/category/releases.html">
107− projected end-of-life</link> are after our release projected
108− end-of-life
87+ Remove attributes that we know we will not be able to support, especially if there is a stable alternative. E.g. Check that our Linux kernels' <link xlink:href="https://www.kernel.org/category/releases.html"> projected end-of-life</link> are after our release projected end-of-life
10988 </para>
11089 </listitem>
11190 <listitem>
11291 <para>
113− Edit changelog at
114− <literal>nixos/doc/manual/release-notes/rl-1709.xml</literal> (double
115− check desktop versions are noted)
92+ Edit changelog at <literal>nixos/doc/manual/release-notes/rl-1709.xml</literal> (double check desktop versions are noted)
11693 </para>
11794 <itemizedlist spacing="compact">
11895 <listitem>
11996 <para>
120− Get all new NixOS modules <literal>git diff
121− release-17.03..release-17.09 nixos/modules/module-list.nix|grep
122− ^+</literal>
97+ Get all new NixOS modules <literal>git diff release-17.03..release-17.09 nixos/modules/module-list.nix|grep ^+</literal>
12398 </para>
12499 </listitem>
125100 <listitem>
@@ -138,8 +113,7 @@
138113 <itemizedlist spacing="compact">
139114 <listitem>
140115 <para>
141− Monitor the master branch for bugfixes and minor updates and cherry-pick
142− them to the release branch.
116+ Monitor the master branch for bugfixes and minor updates and cherry-pick them to the release branch.
143117 </para>
144118 </listitem>
145119 </itemizedlist>
@@ -156,21 +130,17 @@
156130 </listitem>
157131 <listitem>
158132 <para>
159− Release Nix (currently only Eelco Dolstra can do that).
160− <link xlink:href="https://github.com/NixOS/nixpkgs/commit/53710c752a85f00658882531bc90a23a3d1287e4">
161− Make sure fallback is updated. </link>
133+ Release Nix (currently only Eelco Dolstra can do that). <link xlink:href="https://github.com/NixOS/nixpkgs/commit/53710c752a85f00658882531bc90a23a3d1287e4"> Make sure fallback is updated. </link>
162134 </para>
163135 </listitem>
164136 <listitem>
165137 <para>
166− <link xlink:href="https://github.com/NixOS/nixpkgs/commit/40fd9ae3ac8048758abdcfc7d28a78b5f22fe97e">
167− Update README.md with new stable NixOS version information. </link>
138+ <link xlink:href="https://github.com/NixOS/nixpkgs/commit/40fd9ae3ac8048758abdcfc7d28a78b5f22fe97e"> Update README.md with new stable NixOS version information. </link>
168139 </para>
169140 </listitem>
170141 <listitem>
171142 <para>
172− Change <literal>stableBranch</literal> to true and wait for channel to
173− update.
143+ Change <literal>stableBranch</literal> to true and wait for channel to update.
174144 </para>
175145 </listitem>
176146 </itemizedlist>
@@ -187,34 +157,27 @@
187157 </listitem>
188158 <listitem>
189159 <para>
190− Update "Chapter 4. Upgrading NixOS" section of the manual to match
191− new stable release version.
160+ Update "Chapter 4. Upgrading NixOS" section of the manual to match new stable release version.
192161 </para>
193162 </listitem>
194163 <listitem>
195164 <para>
196− Update http://nixos.org/nixos/download.html and
197− http://nixos.org/nixos/manual in
198− https://github.com/NixOS/nixos-org-configurations
165+ Update http://nixos.org/nixos/download.html and http://nixos.org/nixos/manual in https://github.com/NixOS/nixos-org-configurations
199166 </para>
200167 </listitem>
201168 <listitem>
202169 <para>
203− Get number of commits for the release: <literal>git log
204− release-14.04..release-14.12 --format=%an|wc -l</literal>
170+ Get number of commits for the release: <literal>git log release-14.04..release-14.12 --format=%an|wc -l</literal>
205171 </para>
206172 </listitem>
207173 <listitem>
208174 <para>
209− Commits by contributor: <literal>git log release-14.04..release-14.12
210− --format=%an|sort|uniq -c|sort -rn</literal>
175+ Commits by contributor: <literal>git log release-14.04..release-14.12 --format=%an|sort|uniq -c|sort -rn</literal>
211176 </para>
212177 </listitem>
213178 <listitem>
214179 <para>
215− Send an email to nix-dev to announce the release with above information.
216− Best to check how previous email was formulated to see what needs to be
217− included.
180+ Send an email to nix-dev to announce the release with above information. Best to check how previous email was formulated to see what needs to be included.
218181 </para>
219182 </listitem>
220183 </itemizedlist>
@@ -222,26 +185,45 @@
222185 </section>
223186 <section xml:id="release-managers">
224187 <title>Release Management Team</title>
188+
225189 <para>
226− For each release there are two release managers. After each release the
227− release manager having managed two releases steps down and the release
228− management team of the last release appoints a new release manager.
190+ For each release there are two release managers. After each release the release manager having managed two releases steps down and the release management team of the last release appoints a new release manager.
229191 </para>
192+
230193 <para>
231− This makes sure a release management team always consists of one release
232− manager who already has managed one release and one release manager being
233− introduced to their role, making it easier to pass on knowledge and
234− experience.
194+ This makes sure a release management team always consists of one release manager who already has managed one release and one release manager being introduced to their role, making it easier to pass on knowledge and experience.
235195 </para>
196+
236197 <para>
237198 A release manager's role and responsibilities are:
238199 </para>
200+
239201 <itemizedlist>
240− <listitem><para>manage the release process</para></listitem>
241− <listitem><para>start discussions about features and changes for a given release</para></listitem>
242− <listitem><para>create a roadmap</para></listitem>
243− <listitem><para>release in cooperation with Eelco Dolstra</para></listitem>
244− <listitem><para>decide which bug fixes, features, etc... get backported after a release</para></listitem>
202+ <listitem>
203+ <para>
204+ manage the release process
205+ </para>
206+ </listitem>
207+ <listitem>
208+ <para>
209+ start discussions about features and changes for a given release
210+ </para>
211+ </listitem>
212+ <listitem>
213+ <para>
214+ create a roadmap
215+ </para>
216+ </listitem>
217+ <listitem>
218+ <para>
219+ release in cooperation with Eelco Dolstra
220+ </para>
221+ </listitem>
222+ <listitem>
223+ <para>
224+ decide which bug fixes, features, etc... get backported after a release
225+ </para>
226+ </listitem>
245227 </itemizedlist>
246228 </section>
247229 <section xml:id="release-schedule">
nixos/doc/manual/development/replace-modules.xml+4−18
@@ -6,27 +6,15 @@
66 <title>Replace Modules</title>
77
88 <para>
9− Modules that are imported can also be disabled. The option declarations and
10− config implementation of a disabled module will be ignored, allowing another
11− to take it's place. This can be used to import a set of modules from another
12− channel while keeping the rest of the system on a stable release.
9+ Modules that are imported can also be disabled. The option declarations and config implementation of a disabled module will be ignored, allowing another to take it's place. This can be used to import a set of modules from another channel while keeping the rest of the system on a stable release.
1310 </para>
1411
1512 <para>
16− <literal>disabledModules</literal> is a top level attribute like
17− <literal>imports</literal>, <literal>options</literal> and
18− <literal>config</literal>. It contains a list of modules that will be
19− disabled. This can either be the full path to the module or a string with the
20− filename relative to the modules path (eg. &lt;nixpkgs/nixos/modules&gt; for
21− nixos).
13+ <literal>disabledModules</literal> is a top level attribute like <literal>imports</literal>, <literal>options</literal> and <literal>config</literal>. It contains a list of modules that will be disabled. This can either be the full path to the module or a string with the filename relative to the modules path (eg. &lt;nixpkgs/nixos/modules&gt; for nixos).
2214 </para>
2315
2416 <para>
25− This example will replace the existing postgresql module with the version
26− defined in the nixos-unstable channel while keeping the rest of the modules
27− and packages from the original nixos channel. This only overrides the module
28− definition, this won't use postgresql from nixos-unstable unless explicitly
29− configured to do so.
17+ This example will replace the existing postgresql module with the version defined in the nixos-unstable channel while keeping the rest of the modules and packages from the original nixos channel. This only overrides the module definition, this won't use postgresql from nixos-unstable unless explicitly configured to do so.
3018 </para>
3119
3220<programlisting>
@@ -46,9 +34,7 @@
4634</programlisting>
4735
4836 <para>
49− This example shows how to define a custom module as a replacement for an
50− existing module. Importing this module will disable the original module
51− without having to know it's implementation details.
37+ This example shows how to define a custom module as a replacement for an existing module. Importing this module will disable the original module without having to know it's implementation details.
5238 </para>
5339
5440<programlisting>
nixos/doc/manual/development/running-nixos-tests-interactively.xml+4−10
@@ -6,8 +6,7 @@
66 <title>Running Tests interactively</title>
77
88 <para>
9− The test itself can be run interactively. This is particularly useful when
10− developing or debugging a test:
9+ The test itself can be run interactively. This is particularly useful when developing or debugging a test:
1110<screen>
1211<prompt>$ </prompt>nix-build nixos/tests/login.nix -A driver
1312<prompt>$ </prompt>./result/bin/nixos-test-driver
@@ -21,10 +20,7 @@ starting VDE switch for network 1
2120<prompt>&gt;</prompt> $machine->succeed("touch /tmp/foo")
2221<prompt>&gt;</prompt> print($machine->succeed("pwd")) # Show stdout of command
2322</screen>
24− The function <command>testScript</command> executes the entire test script
25− and drops you back into the test driver command line upon its completion.
26− This allows you to inspect the state of the VMs after the test (e.g. to debug
27− the test script).
23+ The function <command>testScript</command> executes the entire test script and drops you back into the test driver command line upon its completion. This allows you to inspect the state of the VMs after the test (e.g. to debug the test script).
2824 </para>
2925
3026 <para>
@@ -33,12 +29,10 @@ starting VDE switch for network 1
3329<prompt>$ </prompt>nix-build nixos/tests/login.nix -A driver
3430<prompt>$ </prompt>./result/bin/nixos-run-vms
3531</screen>
36− The script <command>nixos-run-vms</command> starts the virtual machines
37− defined by test.
32+ The script <command>nixos-run-vms</command> starts the virtual machines defined by test.
3833 </para>
3934
4035 <para>
41− The machine state is kept across VM restarts in
42− <filename>/tmp/vm-state-</filename><varname>machinename</varname>.
36+ The machine state is kept across VM restarts in <filename>/tmp/vm-state-</filename><varname>machinename</varname>.
4337 </para>
4438</section>
nixos/doc/manual/development/running-nixos-tests.xml+3−10
@@ -6,11 +6,8 @@
66 <title>Running Tests</title>
77
88 <para>
9− You can run tests using <command>nix-build</command>. For example, to run the
10− test
11− <filename
12−xlink:href="https://github.com/NixOS/nixpkgs/blob/master/nixos/tests/login.nix">login.nix</filename>,
13− you just do:
9+ You can run tests using <command>nix-build</command>. For example, to run the test <filename
10+xlink:href="https://github.com/NixOS/nixpkgs/blob/master/nixos/tests/login.nix">login.nix</filename>, you just do:
1411<screen>
1512<prompt>$ </prompt>nix-build '&lt;nixpkgs/nixos/tests/login.nix>'
1613</screen>
@@ -24,11 +21,7 @@ machine: QEMU running (pid 8841)
2421…
25226 out of 6 tests succeeded
2623</screen>
27− After building/downloading all required dependencies, this will perform a
28− build that starts a QEMU/KVM virtual machine containing a NixOS system. The
29− virtual machine mounts the Nix store of the host; this makes VM creation very
30− fast, as no disk image needs to be created. Afterwards, you can view a
31− pretty-printed log of the test:
24+ After building/downloading all required dependencies, this will perform a build that starts a QEMU/KVM virtual machine containing a NixOS system. The virtual machine mounts the Nix store of the host; this makes VM creation very fast, as no disk image needs to be created. Afterwards, you can view a pretty-printed log of the test:
3225<screen>
3326<prompt>$ </prompt>firefox result/log.html
3427</screen>
nixos/doc/manual/development/sources.xml+9−39
@@ -5,77 +5,47 @@
55 xml:id="sec-getting-sources">
66 <title>Getting the Sources</title>
77 <para>
8− By default, NixOS’s <command>nixos-rebuild</command> command uses the NixOS
9− and Nixpkgs sources provided by the <literal>nixos</literal> channel (kept in
10− <filename>/nix/var/nix/profiles/per-user/root/channels/nixos</filename>). To
11− modify NixOS, however, you should check out the latest sources from Git. This
12− is as follows:
8+ By default, NixOS’s <command>nixos-rebuild</command> command uses the NixOS and Nixpkgs sources provided by the <literal>nixos</literal> channel (kept in <filename>/nix/var/nix/profiles/per-user/root/channels/nixos</filename>). To modify NixOS, however, you should check out the latest sources from Git. This is as follows:
139<screen>
1410<prompt>$ </prompt>git clone https://github.com/NixOS/nixpkgs
1511<prompt>$ </prompt>cd nixpkgs
1612<prompt>$ </prompt>git remote add channels https://github.com/NixOS/nixpkgs-channels
1713<prompt>$ </prompt>git remote update channels
1814</screen>
19− This will check out the latest Nixpkgs sources to
20− <filename>./nixpkgs</filename> the NixOS sources to
21− <filename>./nixpkgs/nixos</filename>. (The NixOS source tree lives in a
22− subdirectory of the Nixpkgs repository.) The remote
23− <literal>channels</literal> refers to a read-only repository that tracks the
24− Nixpkgs/NixOS channels (see <xref linkend="sec-upgrading"/> for more
25− information about channels). Thus, the Git branch
26− <literal>channels/nixos-17.03</literal> will contain the latest built and
27− tested version available in the <literal>nixos-17.03</literal> channel.
15+ This will check out the latest Nixpkgs sources to <filename>./nixpkgs</filename> the NixOS sources to <filename>./nixpkgs/nixos</filename>. (The NixOS source tree lives in a subdirectory of the Nixpkgs repository.) The remote <literal>channels</literal> refers to a read-only repository that tracks the Nixpkgs/NixOS channels (see <xref linkend="sec-upgrading"/> for more information about channels). Thus, the Git branch <literal>channels/nixos-17.03</literal> will contain the latest built and tested version available in the <literal>nixos-17.03</literal> channel.
2816 </para>
2917 <para>
30− It’s often inconvenient to develop directly on the master branch, since if
31− somebody has just committed (say) a change to GCC, then the binary cache may
32− not have caught up yet and you’ll have to rebuild everything from source.
33− So you may want to create a local branch based on your current NixOS version:
18+ It’s often inconvenient to develop directly on the master branch, since if somebody has just committed (say) a change to GCC, then the binary cache may not have caught up yet and you’ll have to rebuild everything from source. So you may want to create a local branch based on your current NixOS version:
3419<screen>
3520<prompt>$ </prompt>nixos-version
362117.09pre104379.6e0b727 (Hummingbird)
3722
3823<prompt>$ </prompt>git checkout -b local 6e0b727
3924</screen>
40− Or, to base your local branch on the latest version available in a NixOS
41− channel:
25+ Or, to base your local branch on the latest version available in a NixOS channel:
4226<screen>
4327<prompt>$ </prompt>git remote update channels
4428<prompt>$ </prompt>git checkout -b local channels/nixos-17.03
4529</screen>
46− (Replace <literal>nixos-17.03</literal> with the name of the channel you want
47− to use.) You can use <command>git merge</command> or <command>git
48− rebase</command> to keep your local branch in sync with the channel, e.g.
30+ (Replace <literal>nixos-17.03</literal> with the name of the channel you want to use.) You can use <command>git merge</command> or <command>git rebase</command> to keep your local branch in sync with the channel, e.g.
4931<screen>
5032<prompt>$ </prompt>git remote update channels
5133<prompt>$ </prompt>git merge channels/nixos-17.03
5234</screen>
53− You can use <command>git cherry-pick</command> to copy commits from your
54− local branch to the upstream branch.
35+ You can use <command>git cherry-pick</command> to copy commits from your local branch to the upstream branch.
5536 </para>
5637 <para>
57− If you want to rebuild your system using your (modified) sources, you need to
58− tell <command>nixos-rebuild</command> about them using the
59− <option>-I</option> flag:
38+ If you want to rebuild your system using your (modified) sources, you need to tell <command>nixos-rebuild</command> about them using the <option>-I</option> flag:
6039<screen>
6140<prompt># </prompt>nixos-rebuild switch -I nixpkgs=<replaceable>/my/sources</replaceable>/nixpkgs
6241</screen>
6342 </para>
6443 <para>
65− If you want <command>nix-env</command> to use the expressions in
66− <replaceable>/my/sources</replaceable>, use <command>nix-env -f
67− <replaceable>/my/sources</replaceable>/nixpkgs</command>, or change the
68− default by adding a symlink in <filename>~/.nix-defexpr</filename>:
44+ If you want <command>nix-env</command> to use the expressions in <replaceable>/my/sources</replaceable>, use <command>nix-env -f <replaceable>/my/sources</replaceable>/nixpkgs</command>, or change the default by adding a symlink in <filename>~/.nix-defexpr</filename>:
6945<screen>
7046<prompt>$ </prompt>ln -s <replaceable>/my/sources</replaceable>/nixpkgs ~/.nix-defexpr/nixpkgs
7147</screen>
72− You may want to delete the symlink
73− <filename>~/.nix-defexpr/channels_root</filename> to prevent root’s NixOS
74− channel from clashing with your own tree (this may break the
75− command-not-found utility though). If you want to go back to the default
76− state, you may just remove the <filename>~/.nix-defexpr</filename> directory
77− completely, log out and log in again and it should have been recreated with a
78− link to the root channels.
48+ You may want to delete the symlink <filename>~/.nix-defexpr/channels_root</filename> to prevent root’s NixOS channel from clashing with your own tree (this may break the command-not-found utility though). If you want to go back to the default state, you may just remove the <filename>~/.nix-defexpr</filename> directory completely, log out and log in again and it should have been recreated with a link to the root channels.
7949 </para>
8050<!-- FIXME: not sure what this means.
8151<para>You should not pass the base directory
nixos/doc/manual/development/testing-installer.xml+2−4
@@ -5,15 +5,13 @@
55 xml:id="ch-testing-installer">
66 <title>Testing the Installer</title>
77 <para>
8− Building, burning, and booting from an installation CD is rather tedious, so
9− here is a quick way to see if the installer works properly:
8+ Building, burning, and booting from an installation CD is rather tedious, so here is a quick way to see if the installer works properly:
109<screen>
1110<prompt># </prompt>mount -t tmpfs none /mnt
1211<prompt># </prompt>nixos-generate-config --root /mnt
1312<prompt>$ </prompt>nix-build '&lt;nixpkgs/nixos>' -A config.system.build.nixos-install
1413<prompt># </prompt>./result/bin/nixos-install</screen>
15− To start a login shell in the new NixOS installation in
16− <filename>/mnt</filename>:
14+ To start a login shell in the new NixOS installation in <filename>/mnt</filename>:
1715<screen>
1816<prompt>$ </prompt>nix-build '&lt;nixpkgs/nixos>' -A config.system.build.nixos-enter
1917<prompt># </prompt>./result/bin/nixos-enter
nixos/doc/manual/development/writing-documentation.xml+18−56
@@ -5,18 +5,13 @@
55 xml:id="sec-writing-documentation">
66 <title>Writing NixOS Documentation</title>
77 <para>
8− As NixOS grows, so too does the need for a catalogue and explanation of its
9− extensive functionality. Collecting pertinent information from disparate
10− sources and presenting it in an accessible style would be a worthy
11− contribution to the project.
8+ As NixOS grows, so too does the need for a catalogue and explanation of its extensive functionality. Collecting pertinent information from disparate sources and presenting it in an accessible style would be a worthy contribution to the project.
129 </para>
1310 <section xml:id="sec-writing-docs-building-the-manual">
1411 <title>Building the Manual</title>
1512
1613 <para>
17− The DocBook sources of the <xref linkend="book-nixos-manual"/> are in the
18− <link xlink:href="https://github.com/NixOS/nixpkgs/tree/master/nixos/doc/manual"><filename>nixos/doc/manual</filename></link>
19− subdirectory of the Nixpkgs repository.
14+ The DocBook sources of the <xref linkend="book-nixos-manual"/> are in the <link xlink:href="https://github.com/NixOS/nixpkgs/tree/master/nixos/doc/manual"><filename>nixos/doc/manual</filename></link> subdirectory of the Nixpkgs repository.
2015 </para>
2116
2217 <para>
@@ -29,59 +24,45 @@
2924</screen>
3025
3126 <para>
32− Once you are done making modifications to the manual, it's important to
33− build it before committing. You can do that as follows:
27+ Once you are done making modifications to the manual, it's important to build it before committing. You can do that as follows:
3428 </para>
3529
3630<screen>nix-build nixos/release.nix -A manual.x86_64-linux</screen>
3731
3832 <para>
39− When this command successfully finishes, it will tell you where the manual
40− got generated. The HTML will be accessible through the
41− <filename>result</filename> symlink at
42− <filename>./result/share/doc/nixos/index.html</filename>.
33+ When this command successfully finishes, it will tell you where the manual got generated. The HTML will be accessible through the <filename>result</filename> symlink at <filename>./result/share/doc/nixos/index.html</filename>.
4334 </para>
4435 </section>
4536 <section xml:id="sec-writing-docs-editing-docbook-xml">
4637 <title>Editing DocBook XML</title>
4738
4839 <para>
49− For general information on how to write in DocBook, see
50− <link xlink:href="http://www.docbook.org/tdg5/en/html/docbook.html"> DocBook
51− 5: The Definitive Guide</link>.
40+ For general information on how to write in DocBook, see <link xlink:href="http://www.docbook.org/tdg5/en/html/docbook.html"> DocBook 5: The Definitive Guide</link>.
5241 </para>
5342
5443 <para>
55− Emacs nXML Mode is very helpful for editing DocBook XML because it validates
56− the document as you write, and precisely locates errors. To use it, see
57− <xref linkend="sec-emacs-docbook-xml"/>.
44+ Emacs nXML Mode is very helpful for editing DocBook XML because it validates the document as you write, and precisely locates errors. To use it, see <xref linkend="sec-emacs-docbook-xml"/>.
5845 </para>
5946
6047 <para>
61− <link xlink:href="http://pandoc.org">Pandoc</link> can generate DocBook XML
62− from a multitude of formats, which makes a good starting point.
48+ <link xlink:href="http://pandoc.org">Pandoc</link> can generate DocBook XML from a multitude of formats, which makes a good starting point.
6349 <example xml:id="ex-pandoc-xml-conv">
6450 <title>Pandoc invocation to convert GitHub-Flavoured MarkDown to DocBook 5 XML</title>
6551<screen>pandoc -f markdown_github -t docbook5 docs.md -o my-section.md</screen>
6652 </example>
67− Pandoc can also quickly convert a single <filename>section.xml</filename> to
68− HTML, which is helpful when drafting.
53+ Pandoc can also quickly convert a single <filename>section.xml</filename> to HTML, which is helpful when drafting.
6954 </para>
7055
7156 <para>
72− Sometimes writing valid DocBook is simply too difficult. In this case,
73− submit your documentation updates in a
74− <link
75− xlink:href="https://github.com/NixOS/nixpkgs/issues/new">GitHub
76− Issue</link> and someone will handle the conversion to XML for you.
57+ Sometimes writing valid DocBook is simply too difficult. In this case, submit your documentation updates in a <link
58+ xlink:href="https://github.com/NixOS/nixpkgs/issues/new">GitHub Issue</link> and someone will handle the conversion to XML for you.
7759 </para>
7860 </section>
7961 <section xml:id="sec-writing-docs-creating-a-topic">
8062 <title>Creating a Topic</title>
8163
8264 <para>
83− You can use an existing topic as a basis for the new topic or create a topic
84− from scratch.
65+ You can use an existing topic as a basis for the new topic or create a topic from scratch.
8566 </para>
8667
8768 <para>
@@ -89,40 +70,27 @@
8970 <itemizedlist>
9071 <listitem>
9172 <para>
92− The NixOS
93− <link xlink:href="http://www.docbook.org/tdg5/en/html/book.html"><tag>book</tag></link>
94− element is in <filename>nixos/doc/manual/manual.xml</filename>. It
95− includes several
96− <link xlink:href="http://www.docbook.org/tdg5/en/html/book.html"><tag>part</tag>s</link>
97− which are in subdirectories.
73+ The NixOS <link xlink:href="http://www.docbook.org/tdg5/en/html/book.html"><tag>book</tag></link> element is in <filename>nixos/doc/manual/manual.xml</filename>. It includes several <link xlink:href="http://www.docbook.org/tdg5/en/html/book.html"><tag>part</tag>s</link> which are in subdirectories.
9874 </para>
9975 </listitem>
10076 <listitem>
10177 <para>
102− Store the topic file in the same directory as the <tag>part</tag> to
103− which it belongs. If your topic is about configuring a NixOS module, then
104− the XML file can be stored alongside the module definition
105− <filename>nix</filename> file.
78+ Store the topic file in the same directory as the <tag>part</tag> to which it belongs. If your topic is about configuring a NixOS module, then the XML file can be stored alongside the module definition <filename>nix</filename> file.
10679 </para>
10780 </listitem>
10881 <listitem>
10982 <para>
110− If you include multiple words in the file name, separate the words with a
111− dash. For example: <filename>ipv6-config.xml</filename>.
83+ If you include multiple words in the file name, separate the words with a dash. For example: <filename>ipv6-config.xml</filename>.
11284 </para>
11385 </listitem>
11486 <listitem>
11587 <para>
116− Make sure that the <tag>xml:id</tag> value is unique. You can use
117− abbreviations if the ID is too long. For example:
118− <varname>nixos-config</varname>.
88+ Make sure that the <tag>xml:id</tag> value is unique. You can use abbreviations if the ID is too long. For example: <varname>nixos-config</varname>.
11989 </para>
12090 </listitem>
12191 <listitem>
12292 <para>
123− Determine whether your topic is a chapter or a section. If you are
124− unsure, open an existing topic file and check whether the main element is
125− chapter or section.
93+ Determine whether your topic is a chapter or a section. If you are unsure, open an existing topic file and check whether the main element is chapter or section.
12694 </para>
12795 </listitem>
12896 </itemizedlist>
@@ -132,17 +100,11 @@
132100 <title>Adding a Topic to the Book</title>
133101
134102 <para>
135− Open the parent XML file and add an <varname>xi:include</varname> element to
136− the list of chapters with the file name of the topic that you created. If
137− you created a <tag>section</tag>, you add the file to the <tag>chapter</tag>
138− file. If you created a <tag>chapter</tag>, you add the file to the
139− <tag>part</tag> file.
103+ Open the parent XML file and add an <varname>xi:include</varname> element to the list of chapters with the file name of the topic that you created. If you created a <tag>section</tag>, you add the file to the <tag>chapter</tag> file. If you created a <tag>chapter</tag>, you add the file to the <tag>part</tag> file.
140104 </para>
141105
142106 <para>
143− If the topic is about configuring a NixOS module, it can be automatically
144− included in the manual by using the <varname>meta.doc</varname> attribute.
145− See <xref
107+ If the topic is about configuring a NixOS module, it can be automatically included in the manual by using the <varname>meta.doc</varname> attribute. See <xref
146108 linkend="sec-meta-attributes"/> for an explanation.
147109 </para>
148110 </section>
nixos/doc/manual/development/writing-modules.xml+13−56
@@ -5,49 +5,25 @@
55 xml:id="sec-writing-modules">
66 <title>Writing NixOS Modules</title>
77 <para>
8− NixOS has a modular system for declarative configuration. This system
9− combines multiple <emphasis>modules</emphasis> to produce the full system
10− configuration. One of the modules that constitute the configuration is
11− <filename>/etc/nixos/configuration.nix</filename>. Most of the others live in
12− the
13− <link
14−xlink:href="https://github.com/NixOS/nixpkgs/tree/master/nixos/modules"><filename>nixos/modules</filename></link>
15− subdirectory of the Nixpkgs tree.
8+ NixOS has a modular system for declarative configuration. This system combines multiple <emphasis>modules</emphasis> to produce the full system configuration. One of the modules that constitute the configuration is <filename>/etc/nixos/configuration.nix</filename>. Most of the others live in the <link
9+xlink:href="https://github.com/NixOS/nixpkgs/tree/master/nixos/modules"><filename>nixos/modules</filename></link> subdirectory of the Nixpkgs tree.
1610 </para>
1711 <para>
18− Each NixOS module is a file that handles one logical aspect of the
19− configuration, such as a specific kind of hardware, a service, or network
20− settings. A module configuration does not have to handle everything from
21− scratch; it can use the functionality provided by other modules for its
22− implementation. Thus a module can <emphasis>declare</emphasis> options that
23− can be used by other modules, and conversely can <emphasis>define</emphasis>
24− options provided by other modules in its own implementation. For example, the
25− module
26− <link
27−xlink:href="https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/security/pam.nix"><filename>pam.nix</filename></link>
28− declares the option <option>security.pam.services</option> that allows other
29− modules (e.g.
30− <link
31−xlink:href="https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/networking/ssh/sshd.nix"><filename>sshd.nix</filename></link>)
32− to define PAM services; and it defines the option
33− <option>environment.etc</option> (declared by
34− <link
35−xlink:href="https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/system/etc/etc.nix"><filename>etc.nix</filename></link>)
36− to cause files to be created in <filename>/etc/pam.d</filename>.
12+ Each NixOS module is a file that handles one logical aspect of the configuration, such as a specific kind of hardware, a service, or network settings. A module configuration does not have to handle everything from scratch; it can use the functionality provided by other modules for its implementation. Thus a module can <emphasis>declare</emphasis> options that can be used by other modules, and conversely can <emphasis>define</emphasis> options provided by other modules in its own implementation. For example, the module <link
13+xlink:href="https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/security/pam.nix"><filename>pam.nix</filename></link> declares the option <option>security.pam.services</option> that allows other modules (e.g. <link
14+xlink:href="https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/networking/ssh/sshd.nix"><filename>sshd.nix</filename></link>) to define PAM services; and it defines the option <option>environment.etc</option> (declared by <link
15+xlink:href="https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/system/etc/etc.nix"><filename>etc.nix</filename></link>) to cause files to be created in <filename>/etc/pam.d</filename>.
3716 </para>
3817 <para xml:id="para-module-syn">
3918 In <xref
40−linkend="sec-configuration-syntax"/>, we saw the following structure
41− of NixOS modules:
19+linkend="sec-configuration-syntax"/>, we saw the following structure of NixOS modules:
4220<programlisting>
4321{ config, pkgs, ... }:
4422
4523{ <replaceable>option definitions</replaceable>
4624}
4725</programlisting>
48− This is actually an <emphasis>abbreviated</emphasis> form of module that only
49− defines options, but does not declare any. The structure of full NixOS
50− modules is shown in <xref linkend='ex-module-syntax' />.
26+ This is actually an <emphasis>abbreviated</emphasis> form of module that only defines options, but does not declare any. The structure of full NixOS modules is shown in <xref linkend='ex-module-syntax' />.
5127 </para>
5228 <example xml:id='ex-module-syntax'>
5329 <title>Structure of NixOS Modules</title>
@@ -73,47 +49,28 @@ linkend="sec-configuration-syntax"/>, we saw the following structure
7349 <calloutlist>
7450 <callout arearefs='module-syntax-1'>
7551 <para>
76− This line makes the current Nix expression a function. The variable
77− <varname>pkgs</varname> contains Nixpkgs, while <varname>config</varname>
78− contains the full system configuration. This line can be omitted if there
79− is no reference to <varname>pkgs</varname> and <varname>config</varname>
80− inside the module.
52+ This line makes the current Nix expression a function. The variable <varname>pkgs</varname> contains Nixpkgs, while <varname>config</varname> contains the full system configuration. This line can be omitted if there is no reference to <varname>pkgs</varname> and <varname>config</varname> inside the module.
8153 </para>
8254 </callout>
8355 <callout arearefs='module-syntax-2'>
8456 <para>
85− This list enumerates the paths to other NixOS modules that should be
86− included in the evaluation of the system configuration. A default set of
87− modules is defined in the file
88− <filename>modules/module-list.nix</filename>. These don't need to be added
89− in the import list.
57+ This list enumerates the paths to other NixOS modules that should be included in the evaluation of the system configuration. A default set of modules is defined in the file <filename>modules/module-list.nix</filename>. These don't need to be added in the import list.
9058 </para>
9159 </callout>
9260 <callout arearefs='module-syntax-3'>
9361 <para>
94− The attribute <varname>options</varname> is a nested set of
95− <emphasis>option declarations</emphasis> (described below).
62+ The attribute <varname>options</varname> is a nested set of <emphasis>option declarations</emphasis> (described below).
9663 </para>
9764 </callout>
9865 <callout arearefs='module-syntax-4'>
9966 <para>
100− The attribute <varname>config</varname> is a nested set of
101− <emphasis>option definitions</emphasis> (also described below).
67+ The attribute <varname>config</varname> is a nested set of <emphasis>option definitions</emphasis> (also described below).
10268 </para>
10369 </callout>
10470 </calloutlist>
10571 </para>
10672 <para>
107− <xref linkend='locate-example' /> shows a module that handles the regular
108− update of the “locate” database, an index of all files in the file
109− system. This module declares two options that can be defined by other modules
110− (typically the user’s <filename>configuration.nix</filename>):
111− <option>services.locate.enable</option> (whether the database should be
112− updated) and <option>services.locate.interval</option> (when the update
113− should be done). It implements its functionality by defining two options
114− declared by other modules: <option>systemd.services</option> (the set of all
115− systemd services) and <option>systemd.timers</option> (the list of commands
116− to be executed periodically by <command>systemd</command>).
73+ <xref linkend='locate-example' /> shows a module that handles the regular update of the “locate” database, an index of all files in the file system. This module declares two options that can be defined by other modules (typically the user’s <filename>configuration.nix</filename>): <option>services.locate.enable</option> (whether the database should be updated) and <option>services.locate.interval</option> (when the update should be done). It implements its functionality by defining two options declared by other modules: <option>systemd.services</option> (the set of all systemd services) and <option>systemd.timers</option> (the list of commands to be executed periodically by <command>systemd</command>).
11774 </para>
11875 <example xml:id='locate-example'>
11976 <title>NixOS Module for the “locate” Service</title>
nixos/doc/manual/development/writing-nixos-tests.xml+29−84
@@ -31,22 +31,9 @@ import ./make-test.nix {
3131 '';
3232}
3333</programlisting>
34− The attribute <literal>testScript</literal> is a bit of Perl code that
35− executes the test (described below). During the test, it will start one or
36− more virtual machines, the configuration of which is described by the
37− attribute <literal>machine</literal> (if you need only one machine in your
38− test) or by the attribute <literal>nodes</literal> (if you need multiple
39− machines). For instance,
40− <filename
41−xlink:href="https://github.com/NixOS/nixpkgs/blob/master/nixos/tests/login.nix">login.nix</filename>
42− only needs a single machine to test whether users can log in on the virtual
43− console, whether device ownership is correctly maintained when switching
44− between consoles, and so on. On the other hand,
45− <filename
46−xlink:href="https://github.com/NixOS/nixpkgs/blob/master/nixos/tests/nfs.nix">nfs.nix</filename>,
47− which tests NFS client and server functionality in the Linux kernel
48− (including whether locks are maintained across server crashes), requires
49− three machines: a server and two clients.
34+ The attribute <literal>testScript</literal> is a bit of Perl code that executes the test (described below). During the test, it will start one or more virtual machines, the configuration of which is described by the attribute <literal>machine</literal> (if you need only one machine in your test) or by the attribute <literal>nodes</literal> (if you need multiple machines). For instance, <filename
35+xlink:href="https://github.com/NixOS/nixpkgs/blob/master/nixos/tests/login.nix">login.nix</filename> only needs a single machine to test whether users can log in on the virtual console, whether device ownership is correctly maintained when switching between consoles, and so on. On the other hand, <filename
36+xlink:href="https://github.com/NixOS/nixpkgs/blob/master/nixos/tests/nfs.nix">nfs.nix</filename>, which tests NFS client and server functionality in the Linux kernel (including whether locks are maintained across server crashes), requires three machines: a server and two clients.
5037 </para>
5138
5239 <para>
@@ -69,10 +56,8 @@ xlink:href="https://github.com/NixOS/nixpkgs/blob/master/nixos/tests/nfs.nix">nf
6956 </term>
7057 <listitem>
7158 <para>
72− The virtual networks to which the VM is connected. See
73− <filename
74− xlink:href="https://github.com/NixOS/nixpkgs/blob/master/nixos/tests/nat.nix">nat.nix</filename>
75− for an example.
59+ The virtual networks to which the VM is connected. See <filename
60+ xlink:href="https://github.com/NixOS/nixpkgs/blob/master/nixos/tests/nat.nix">nat.nix</filename> for an example.
7661 </para>
7762 </listitem>
7863 </varlistentry>
@@ -82,38 +67,23 @@ xlink:href="https://github.com/NixOS/nixpkgs/blob/master/nixos/tests/nfs.nix">nf
8267 </term>
8368 <listitem>
8469 <para>
85− By default, the Nix store in the VM is not writable. If you enable this
86− option, a writable union file system is mounted on top of the Nix store
87− to make it appear writable. This is necessary for tests that run Nix
88− operations that modify the store.
70+ By default, the Nix store in the VM is not writable. If you enable this option, a writable union file system is mounted on top of the Nix store to make it appear writable. This is necessary for tests that run Nix operations that modify the store.
8971 </para>
9072 </listitem>
9173 </varlistentry>
9274 </variablelist>
93− For more options, see the module
94− <filename
75+ For more options, see the module <filename
9576xlink:href="https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/virtualisation/qemu-vm.nix">qemu-vm.nix</filename>.
9677 </para>
9778
9879 <para>
99− The test script is a sequence of Perl statements that perform various
100− actions, such as starting VMs, executing commands in the VMs, and so on. Each
101− virtual machine is represented as an object stored in the variable
102− <literal>$<replaceable>name</replaceable></literal>, where
103− <replaceable>name</replaceable> is the identifier of the machine (which is
104− just <literal>machine</literal> if you didn’t specify multiple machines
105− using the <literal>nodes</literal> attribute). For instance, the following
106− starts the machine, waits until it has finished booting, then executes a
107− command and checks that the output is more-or-less correct:
80+ The test script is a sequence of Perl statements that perform various actions, such as starting VMs, executing commands in the VMs, and so on. Each virtual machine is represented as an object stored in the variable <literal>$<replaceable>name</replaceable></literal>, where <replaceable>name</replaceable> is the identifier of the machine (which is just <literal>machine</literal> if you didn’t specify multiple machines using the <literal>nodes</literal> attribute). For instance, the following starts the machine, waits until it has finished booting, then executes a command and checks that the output is more-or-less correct:
10881<programlisting>
10982$machine->start;
11083$machine->waitForUnit("default.target");
11184$machine->succeed("uname") =~ /Linux/ or die;
11285</programlisting>
113− The first line is actually unnecessary; machines are implicitly started when
114− you first execute an action on them (such as <literal>waitForUnit</literal>
115− or <literal>succeed</literal>). If you have multiple machines, you can speed
116− up the test by starting them in parallel:
86+ The first line is actually unnecessary; machines are implicitly started when you first execute an action on them (such as <literal>waitForUnit</literal> or <literal>succeed</literal>). If you have multiple machines, you can speed up the test by starting them in parallel:
11787<programlisting>
11888startAll;
11989</programlisting>
@@ -128,8 +98,7 @@ startAll;
12898 </term>
12999 <listitem>
130100 <para>
131− Start the virtual machine. This method is asynchronous — it does not
132− wait for the machine to finish booting.
101+ Start the virtual machine. This method is asynchronous — it does not wait for the machine to finish booting.
133102 </para>
134103 </listitem>
135104 </varlistentry>
@@ -159,8 +128,7 @@ startAll;
159128 </term>
160129 <listitem>
161130 <para>
162− Simulate unplugging the Ethernet cable that connects the machine to the
163− other machines.
131+ Simulate unplugging the Ethernet cable that connects the machine to the other machines.
164132 </para>
165133 </listitem>
166134 </varlistentry>
@@ -180,8 +148,7 @@ startAll;
180148 </term>
181149 <listitem>
182150 <para>
183− Take a picture of the display of the virtual machine, in PNG format. The
184− screenshot is linked from the HTML log.
151+ Take a picture of the display of the virtual machine, in PNG format. The screenshot is linked from the HTML log.
185152 </para>
186153 </listitem>
187154 </varlistentry>
@@ -191,13 +158,11 @@ startAll;
191158 </term>
192159 <listitem>
193160 <para>
194− Return a textual representation of what is currently visible on the
195− machine's screen using optical character recognition.
161+ Return a textual representation of what is currently visible on the machine's screen using optical character recognition.
196162 </para>
197163 <note>
198164 <para>
199− This requires passing <option>enableOCR</option> to the test attribute
200− set.
165+ This requires passing <option>enableOCR</option> to the test attribute set.
201166 </para>
202167 </note>
203168 </listitem>
@@ -208,8 +173,7 @@ startAll;
208173 </term>
209174 <listitem>
210175 <para>
211− Send a command to the QEMU monitor. This is rarely used, but allows doing
212− stuff such as attaching virtual USB disks to a running machine.
176+ Send a command to the QEMU monitor. This is rarely used, but allows doing stuff such as attaching virtual USB disks to a running machine.
213177 </para>
214178 </listitem>
215179 </varlistentry>
@@ -219,8 +183,7 @@ startAll;
219183 </term>
220184 <listitem>
221185 <para>
222− Simulate pressing keys on the virtual keyboard, e.g.,
223− <literal>sendKeys("ctrl-alt-delete")</literal>.
186+ Simulate pressing keys on the virtual keyboard, e.g., <literal>sendKeys("ctrl-alt-delete")</literal>.
224187 </para>
225188 </listitem>
226189 </varlistentry>
@@ -230,9 +193,7 @@ startAll;
230193 </term>
231194 <listitem>
232195 <para>
233− Simulate typing a sequence of characters on the virtual keyboard, e.g.,
234− <literal>sendKeys("foobar\n")</literal> will type the string
235− <literal>foobar</literal> followed by the Enter key.
196+ Simulate typing a sequence of characters on the virtual keyboard, e.g., <literal>sendKeys("foobar\n")</literal> will type the string <literal>foobar</literal> followed by the Enter key.
236197 </para>
237198 </listitem>
238199 </varlistentry>
@@ -242,9 +203,7 @@ startAll;
242203 </term>
243204 <listitem>
244205 <para>
245− Execute a shell command, returning a list
246− <literal>(<replaceable>status</replaceable>,
247− <replaceable>stdout</replaceable>)</literal>.
206+ Execute a shell command, returning a list <literal>(<replaceable>status</replaceable>, <replaceable>stdout</replaceable>)</literal>.
248207 </para>
249208 </listitem>
250209 </varlistentry>
@@ -254,8 +213,7 @@ startAll;
254213 </term>
255214 <listitem>
256215 <para>
257− Execute a shell command, raising an exception if the exit status is not
258− zero, otherwise returning the standard output.
216+ Execute a shell command, raising an exception if the exit status is not zero, otherwise returning the standard output.
259217 </para>
260218 </listitem>
261219 </varlistentry>
@@ -265,8 +223,7 @@ startAll;
265223 </term>
266224 <listitem>
267225 <para>
268− Like <methodname>succeed</methodname>, but raising an exception if the
269− command returns a zero status.
226+ Like <methodname>succeed</methodname>, but raising an exception if the command returns a zero status.
270227 </para>
271228 </listitem>
272229 </varlistentry>
@@ -316,8 +273,7 @@ startAll;
316273 </term>
317274 <listitem>
318275 <para>
319− Wait until a process is listening on the given TCP port (on
320− <literal>localhost</literal>, at least).
276+ Wait until a process is listening on the given TCP port (on <literal>localhost</literal>, at least).
321277 </para>
322278 </listitem>
323279 </varlistentry>
@@ -347,14 +303,11 @@ startAll;
347303 </term>
348304 <listitem>
349305 <para>
350− Wait until the supplied regular expressions matches the textual contents
351− of the screen by using optical character recognition (see
352− <methodname>getScreenText</methodname>).
306+ Wait until the supplied regular expressions matches the textual contents of the screen by using optical character recognition (see <methodname>getScreenText</methodname>).
353307 </para>
354308 <note>
355309 <para>
356− This requires passing <option>enableOCR</option> to the test attribute
357− set.
310+ This requires passing <option>enableOCR</option> to the test attribute set.
358311 </para>
359312 </note>
360313 </listitem>
@@ -365,8 +318,7 @@ startAll;
365318 </term>
366319 <listitem>
367320 <para>
368− Wait until an X11 window has appeared whose name matches the given
369− regular expression, e.g., <literal>waitForWindow(qr/Terminal/)</literal>.
321+ Wait until an X11 window has appeared whose name matches the given regular expression, e.g., <literal>waitForWindow(qr/Terminal/)</literal>.
370322 </para>
371323 </listitem>
372324 </varlistentry>
@@ -376,13 +328,10 @@ startAll;
376328 </term>
377329 <listitem>
378330 <para>
379− Copies a file from host to machine, e.g.,
380− <literal>copyFileFromHost("myfile", "/etc/my/important/file")</literal>.
331+ Copies a file from host to machine, e.g., <literal>copyFileFromHost("myfile", "/etc/my/important/file")</literal>.
381332 </para>
382333 <para>
383− The first argument is the file on the host. The file needs to be
384− accessible while building the nix derivation. The second argument is the
385− location of the file on the machine.
334+ The first argument is the file on the host. The file needs to be accessible while building the nix derivation. The second argument is the location of the file on the machine.
386335 </para>
387336 </listitem>
388337 </varlistentry>
@@ -392,8 +341,7 @@ startAll;
392341 </term>
393342 <listitem>
394343 <para>
395− Runs <literal>systemctl</literal> commands with optional support for
396− <literal>systemctl --user</literal>
344+ Runs <literal>systemctl</literal> commands with optional support for <literal>systemctl --user</literal>
397345 </para>
398346 <para>
399347<programlisting>
@@ -407,15 +355,12 @@ $machine->systemctl("list-jobs --no-pager", "any-user"); // spawns a shell for `
407355 </para>
408356
409357 <para>
410− To test user units declared by <literal>systemd.user.services</literal> the
411− optional <literal>$user</literal> argument can be used:
358+ To test user units declared by <literal>systemd.user.services</literal> the optional <literal>$user</literal> argument can be used:
412359<programlisting>
413360$machine->start;
414361$machine->waitForX;
415362$machine->waitForUnit("xautolock.service", "x-session-user");
416363</programlisting>
417− This applies to <literal>systemctl</literal>, <literal>getUnitInfo</literal>,
418− <literal>waitForUnit</literal>, <literal>startJob</literal> and
419− <literal>stopJob</literal>.
364+ This applies to <literal>systemctl</literal>, <literal>getUnitInfo</literal>, <literal>waitForUnit</literal>, <literal>startJob</literal> and <literal>stopJob</literal>.
420365 </para>
421366</section>
nixos/doc/manual/installation/changing-config.xml+13−40
@@ -4,28 +4,20 @@
44 xml:id="sec-changing-config">
55 <title>Changing the Configuration</title>
66 <para>
7− The file <filename>/etc/nixos/configuration.nix</filename> contains the
8− current configuration of your machine. Whenever you’ve
9− <link linkend="ch-configuration">changed something</link> in that file, you
10− should do
7+ The file <filename>/etc/nixos/configuration.nix</filename> contains the current configuration of your machine. Whenever you’ve <link linkend="ch-configuration">changed something</link> in that file, you should do
118<screen>
129<prompt># </prompt>nixos-rebuild switch
1310</screen>
14− to build the new configuration, make it the default configuration for
15− booting, and try to realise the configuration in the running system (e.g., by
16− restarting system services).
11+ to build the new configuration, make it the default configuration for booting, and try to realise the configuration in the running system (e.g., by restarting system services).
1712 <warning>
1813 <para>
19− This command doesn't start/stop <link linkend="opt-systemd.user.services">user
20− services</link> automatically. <command>nixos-rebuild</command> only runs a
21− <literal>daemon-reload</literal> for each user with running user services.
14+ This command doesn't start/stop <link linkend="opt-systemd.user.services">user services</link> automatically. <command>nixos-rebuild</command> only runs a <literal>daemon-reload</literal> for each user with running user services.
2215 </para>
2316 </warning>
2417 </para>
2518 <warning>
2619 <para>
27− These commands must be executed as root, so you should either run them from
28− a root shell or by prefixing them with <literal>sudo -i</literal>.
20+ These commands must be executed as root, so you should either run them from a root shell or by prefixing them with <literal>sudo -i</literal>.
2921 </para>
3022 </warning>
3123 <para>
@@ -33,63 +25,44 @@
3325<screen>
3426<prompt># </prompt>nixos-rebuild test
3527</screen>
36− to build the configuration and switch the running system to it, but without
37− making it the boot default. So if (say) the configuration locks up your
38− machine, you can just reboot to get back to a working configuration.
28+ to build the configuration and switch the running system to it, but without making it the boot default. So if (say) the configuration locks up your machine, you can just reboot to get back to a working configuration.
3929 </para>
4030 <para>
4131 There is also
4232<screen>
4333<prompt># </prompt>nixos-rebuild boot
4434</screen>
45− to build the configuration and make it the boot default, but not switch to it
46− now (so it will only take effect after the next reboot).
35+ to build the configuration and make it the boot default, but not switch to it now (so it will only take effect after the next reboot).
4736 </para>
4837 <para>
49− You can make your configuration show up in a different submenu of the GRUB 2
50− boot screen by giving it a different <emphasis>profile name</emphasis>, e.g.
38+ You can make your configuration show up in a different submenu of the GRUB 2 boot screen by giving it a different <emphasis>profile name</emphasis>, e.g.
5139<screen>
5240<prompt># </prompt>nixos-rebuild switch -p test
5341</screen>
54− which causes the new configuration (and previous ones created using
55− <literal>-p test</literal>) to show up in the GRUB submenu “NixOS - Profile
56− 'test'”. This can be useful to separate test configurations from
57− “stable” configurations.
42+ which causes the new configuration (and previous ones created using <literal>-p test</literal>) to show up in the GRUB submenu “NixOS - Profile 'test'”. This can be useful to separate test configurations from “stable” configurations.
5843 </para>
5944 <para>
6045 Finally, you can do
6146<screen>
6247<prompt>$ </prompt>nixos-rebuild build
6348</screen>
64− to build the configuration but nothing more. This is useful to see whether
65− everything compiles cleanly.
49+ to build the configuration but nothing more. This is useful to see whether everything compiles cleanly.
6650 </para>
6751 <para>
68− If you have a machine that supports hardware virtualisation, you can also
69− test the new configuration in a sandbox by building and running a QEMU
70− <emphasis>virtual machine</emphasis> that contains the desired configuration.
71− Just do
52+ If you have a machine that supports hardware virtualisation, you can also test the new configuration in a sandbox by building and running a QEMU <emphasis>virtual machine</emphasis> that contains the desired configuration. Just do
7253<screen>
7354<prompt>$ </prompt>nixos-rebuild build-vm
7455<prompt>$ </prompt>./result/bin/run-*-vm
7556</screen>
76− The VM does not have any data from your host system, so your existing user
77− accounts and home directories will not be available unless you have set
78− <literal>mutableUsers = false</literal>. Another way is to temporarily add
79− the following to your configuration:
57+ The VM does not have any data from your host system, so your existing user accounts and home directories will not be available unless you have set <literal>mutableUsers = false</literal>. Another way is to temporarily add the following to your configuration:
8058<screen>
8159<link linkend="opt-users.users._name__.initialHashedPassword">users.users.your-user.initialHashedPassword</link> = "test";
8260</screen>
83− <emphasis>Important:</emphasis> delete the $hostname.qcow2 file if you have
84− started the virtual machine at least once without the right users, otherwise
85− the changes will not get picked up. You can forward ports on the host to the
86− guest. For instance, the following will forward host port 2222 to guest port
87− 22 (SSH):
61+ <emphasis>Important:</emphasis> delete the $hostname.qcow2 file if you have started the virtual machine at least once without the right users, otherwise the changes will not get picked up. You can forward ports on the host to the guest. For instance, the following will forward host port 2222 to guest port 22 (SSH):
8862<screen>
8963<prompt>$ </prompt>QEMU_NET_OPTS="hostfwd=tcp::2222-:22" ./result/bin/run-*-vm
9064</screen>
91− allowing you to log in via SSH (assuming you have set the appropriate
92− passwords or SSH authorized keys):
65+ allowing you to log in via SSH (assuming you have set the appropriate passwords or SSH authorized keys):
9366<screen>
9467<prompt>$ </prompt>ssh -p 2222 localhost
9568</screen>
nixos/doc/manual/installation/installation.xml+1−2
@@ -6,8 +6,7 @@
66 <title>Installation</title>
77 <partintro xml:id="ch-installation-intro">
88 <para>
9− This section describes how to obtain, install, and configure NixOS for
10− first-time use.
9+ This section describes how to obtain, install, and configure NixOS for first-time use.
1110 </para>
1211 </partintro>
1312 <xi:include href="obtaining.xml" />
nixos/doc/manual/installation/installing-behind-a-proxy.xml+4−11
@@ -6,16 +6,13 @@
66 <title>Installing behind a proxy</title>
77
88 <para>
9− To install NixOS behind a proxy, do the following before running
10− <literal>nixos-install</literal>.
9+ To install NixOS behind a proxy, do the following before running <literal>nixos-install</literal>.
1110 </para>
1211
1312 <orderedlist numeration="arabic">
1413 <listitem>
1514 <para>
16− Update proxy configuration in
17− <literal>/mnt/etc/nixos/configuration.nix</literal> to keep the internet
18− accessible after reboot.
15+ Update proxy configuration in <literal>/mnt/etc/nixos/configuration.nix</literal> to keep the internet accessible after reboot.
1916 </para>
2017<programlisting>
2118networking.proxy.default = &quot;http://user:password@proxy:port/&quot;;
@@ -24,8 +21,7 @@ networking.proxy.noProxy = &quot;127.0.0.1,localhost,internal.domain&quot;;
2421 </listitem>
2522 <listitem>
2623 <para>
27− Setup the proxy environment variables in the shell where you are running
28− <literal>nixos-install</literal>.
24+ Setup the proxy environment variables in the shell where you are running <literal>nixos-install</literal>.
2925 </para>
3026<programlisting>
3127# proxy_url=&quot;http://user:password@proxy:port/&quot;
@@ -39,10 +35,7 @@ networking.proxy.noProxy = &quot;127.0.0.1,localhost,internal.domain&quot;;
3935
4036 <note>
4137 <para>
42− If you are switching networks with different proxy configurations, use the
43− <literal>nesting.clone</literal> option in
44− <literal>configuration.nix</literal> to switch proxies at runtime. Refer to
45− <xref linkend="ch-options" /> for more information.
38+ If you are switching networks with different proxy configurations, use the <literal>nesting.clone</literal> option in <literal>configuration.nix</literal> to switch proxies at runtime. Refer to <xref linkend="ch-options" /> for more information.
4639 </para>
4740 </note>
4841</section>
nixos/doc/manual/installation/installing-from-other-distro.xml+40−112
@@ -8,28 +8,23 @@
88 <title>Installing from another Linux distribution</title>
99
1010 <para>
11− Because Nix (the package manager) &amp; Nixpkgs (the Nix packages collection)
12− can both be installed on any (most?) Linux distributions, they can be used to
13− install NixOS in various creative ways. You can, for instance:
11+ Because Nix (the package manager) &amp; Nixpkgs (the Nix packages collection) can both be installed on any (most?) Linux distributions, they can be used to install NixOS in various creative ways. You can, for instance:
1412 </para>
1513
1614 <orderedlist>
1715 <listitem>
1816 <para>
19− Install NixOS on another partition, from your existing Linux distribution
20− (without the use of a USB or optical device!)
17+ Install NixOS on another partition, from your existing Linux distribution (without the use of a USB or optical device!)
2118 </para>
2219 </listitem>
2320 <listitem>
2421 <para>
25− Install NixOS on the same partition (in place!), from your existing
26− non-NixOS Linux distribution using <literal>NIXOS_LUSTRATE</literal>.
22+ Install NixOS on the same partition (in place!), from your existing non-NixOS Linux distribution using <literal>NIXOS_LUSTRATE</literal>.
2723 </para>
2824 </listitem>
2925 <listitem>
3026 <para>
31− Install NixOS on your hard drive from the Live CD of any Linux
32− distribution.
27+ Install NixOS on your hard drive from the Live CD of any Linux distribution.
3328 </para>
3429 </listitem>
3530 </orderedlist>
@@ -50,10 +45,8 @@
5045<prompt>$ </prompt>curl https://nixos.org/nix/install | sh
5146<prompt>$ </prompt>. $HOME/.nix-profile/etc/profile.d/nix.sh # …or open a fresh shell</screen>
5247 <para>
53− More details in the
54− <link
55− xlink:href="https://nixos.org/nix/manual/#chap-quick-start">
56− Nix manual</link>
48+ More details in the <link
49+ xlink:href="https://nixos.org/nix/manual/#chap-quick-start"> Nix manual</link>
5750 </para>
5851 </listitem>
5952 <listitem>
@@ -61,21 +54,18 @@
6154 Switch to the NixOS channel:
6255 </para>
6356 <para>
64− If you've just installed Nix on a non-NixOS distribution, you will be on
65− the <literal>nixpkgs</literal> channel by default.
57+ If you've just installed Nix on a non-NixOS distribution, you will be on the <literal>nixpkgs</literal> channel by default.
6658 </para>
6759<screen>
6860<prompt>$ </prompt>nix-channel --list
6961nixpkgs https://nixos.org/channels/nixpkgs-unstable</screen>
7062 <para>
71− As that channel gets released without running the NixOS tests, it will be
72− safer to use the <literal>nixos-*</literal> channels instead:
63+ As that channel gets released without running the NixOS tests, it will be safer to use the <literal>nixos-*</literal> channels instead:
7364 </para>
7465<screen>
7566<prompt>$ </prompt>nix-channel --add https://nixos.org/channels/nixos-<replaceable>version</replaceable> nixpkgs</screen>
7667 <para>
77− You may want to throw in a <literal>nix-channel --update</literal> for good
78− measure.
68+ You may want to throw in a <literal>nix-channel --update</literal> for good measure.
7969 </para>
8070 </listitem>
8171 <listitem>
@@ -83,33 +73,24 @@ nixpkgs https://nixos.org/channels/nixpkgs-unstable</screen>
8373 Install the NixOS installation tools:
8474 </para>
8575 <para>
86− You'll need <literal>nixos-generate-config</literal> and
87− <literal>nixos-install</literal> and we'll throw in some man pages and
88− <literal>nixos-enter</literal> just in case you want to chroot into your
89− NixOS partition. They are installed by default on NixOS, but you don't have
90− NixOS yet..
76+ You'll need <literal>nixos-generate-config</literal> and <literal>nixos-install</literal> and we'll throw in some man pages and <literal>nixos-enter</literal> just in case you want to chroot into your NixOS partition. They are installed by default on NixOS, but you don't have NixOS yet..
9177 </para>
9278<screen><prompt>$ </prompt>nix-env -iE "_: with import &lt;nixpkgs/nixos&gt; { configuration = {}; }; with config.system.build; [ nixos-generate-config nixos-install nixos-enter manual.manpages ]"</screen>
9379 </listitem>
9480 <listitem>
9581 <note>
9682 <para>
97− The following 5 steps are only for installing NixOS to another partition.
98− For installing NixOS in place using <literal>NIXOS_LUSTRATE</literal>,
99− skip ahead.
83+ The following 5 steps are only for installing NixOS to another partition. For installing NixOS in place using <literal>NIXOS_LUSTRATE</literal>, skip ahead.
10084 </para>
10185 </note>
10286 <para>
10387 Prepare your target partition:
10488 </para>
10589 <para>
106− At this point it is time to prepare your target partition. Please refer to
107− the partitioning, file-system creation, and mounting steps of
108− <xref linkend="sec-installation" />
90+ At this point it is time to prepare your target partition. Please refer to the partitioning, file-system creation, and mounting steps of <xref linkend="sec-installation" />
10991 </para>
11092 <para>
111− If you're about to install NixOS in place using
112− <literal>NIXOS_LUSTRATE</literal> there is nothing to do for this step.
93+ If you're about to install NixOS in place using <literal>NIXOS_LUSTRATE</literal> there is nothing to do for this step.
11394 </para>
11495 </listitem>
11596 <listitem>
@@ -118,17 +99,11 @@ nixpkgs https://nixos.org/channels/nixpkgs-unstable</screen>
11899 </para>
119100<screen><prompt>$ </prompt>sudo `which nixos-generate-config` --root /mnt</screen>
120101 <para>
121− You'll probably want to edit the configuration files. Refer to the
122− <literal>nixos-generate-config</literal> step in
123− <xref
124− linkend="sec-installation" /> for more
125− information.
102+ You'll probably want to edit the configuration files. Refer to the <literal>nixos-generate-config</literal> step in <xref
103+ linkend="sec-installation" /> for more information.
126104 </para>
127105 <para>
128− Consider setting up the NixOS bootloader to give you the ability to boot on
129− your existing Linux partition. For instance, if you're using GRUB and your
130− existing distribution is running Ubuntu, you may want to add something like
131− this to your <literal>configuration.nix</literal>:
106+ Consider setting up the NixOS bootloader to give you the ability to boot on your existing Linux partition. For instance, if you're using GRUB and your existing distribution is running Ubuntu, you may want to add something like this to your <literal>configuration.nix</literal>:
132107 </para>
133108<programlisting>
134109<xref linkend="opt-boot.loader.grub.extraEntries"/> = ''
@@ -138,14 +113,12 @@ nixpkgs https://nixos.org/channels/nixpkgs-unstable</screen>
138113 }
139114'';</programlisting>
140115 <para>
141− (You can find the appropriate UUID for your partition in
142− <literal>/dev/disk/by-uuid</literal>)
116+ (You can find the appropriate UUID for your partition in <literal>/dev/disk/by-uuid</literal>)
143117 </para>
144118 </listitem>
145119 <listitem>
146120 <para>
147− Create the <literal>nixbld</literal> group and user on your original
148− distribution:
121+ Create the <literal>nixbld</literal> group and user on your original distribution:
149122 </para>
150123<screen>
151124<prompt>$ </prompt>sudo groupadd -g 30000 nixbld
@@ -157,14 +130,12 @@ nixpkgs https://nixos.org/channels/nixpkgs-unstable</screen>
157130 </para>
158131 <warning>
159132 <para>
160− Once you complete this step, you might no longer be able to boot on
161− existing systems without the help of a rescue USB drive or similar.
133+ Once you complete this step, you might no longer be able to boot on existing systems without the help of a rescue USB drive or similar.
162134 </para>
163135 </warning>
164136<screen><prompt>$ </prompt>sudo PATH="$PATH" NIX_PATH="$NIX_PATH" `which nixos-install` --root /mnt</screen>
165137 <para>
166− Again, please refer to the <literal>nixos-install</literal> step in
167− <xref linkend="sec-installation" /> for more information.
138+ Again, please refer to the <literal>nixos-install</literal> step in <xref linkend="sec-installation" /> for more information.
168139 </para>
169140 <para>
170141 That should be it for installation to another partition!
@@ -178,16 +149,13 @@ nixpkgs https://nixos.org/channels/nixpkgs-unstable</screen>
178149<prompt>$ </prompt>sudo userdel nixbld
179150<prompt>$ </prompt>sudo groupdel nixbld</screen>
180151 <para>
181− If you do not wish to keep the Nix package manager installed either, run
182− something like <literal>sudo rm -rv ~/.nix-* /nix</literal> and remove the
183− line that the Nix installer added to your <literal>~/.profile</literal>.
152+ If you do not wish to keep the Nix package manager installed either, run something like <literal>sudo rm -rv ~/.nix-* /nix</literal> and remove the line that the Nix installer added to your <literal>~/.profile</literal>.
184153 </para>
185154 </listitem>
186155 <listitem>
187156 <note>
188157 <para>
189− The following steps are only for installing NixOS in place using
190− <literal>NIXOS_LUSTRATE</literal>:
158+ The following steps are only for installing NixOS in place using <literal>NIXOS_LUSTRATE</literal>:
191159 </para>
192160 </note>
193161 <para>
@@ -195,20 +163,11 @@ nixpkgs https://nixos.org/channels/nixpkgs-unstable</screen>
195163 </para>
196164<screen><prompt>$ </prompt>sudo `which nixos-generate-config` --root /</screen>
197165 <para>
198− Note that this will place the generated configuration files in
199− <literal>/etc/nixos</literal>. You'll probably want to edit the
200− configuration files. Refer to the <literal>nixos-generate-config</literal>
201− step in <xref
202− linkend="sec-installation" /> for more
203− information.
166+ Note that this will place the generated configuration files in <literal>/etc/nixos</literal>. You'll probably want to edit the configuration files. Refer to the <literal>nixos-generate-config</literal> step in <xref
167+ linkend="sec-installation" /> for more information.
204168 </para>
205169 <para>
206− You'll likely want to set a root password for your first boot using the
207− configuration files because you won't have a chance to enter a password
208− until after you reboot. You can initalize the root password to an empty one
209− with this line: (and of course don't forget to set one once you've rebooted
210− or to lock the account with <literal>sudo passwd -l root</literal> if you
211− use <literal>sudo</literal>)
170+ You'll likely want to set a root password for your first boot using the configuration files because you won't have a chance to enter a password until after you reboot. You can initalize the root password to an empty one with this line: (and of course don't forget to set one once you've rebooted or to lock the account with <literal>sudo passwd -l root</literal> if you use <literal>sudo</literal>)
212171 </para>
213172<programlisting>
214173<link linkend="opt-users.users._name__.initialHashedPassword">users.users.root.initialHashedPassword</link> = "";
@@ -216,34 +175,25 @@ nixpkgs https://nixos.org/channels/nixpkgs-unstable</screen>
216175 </listitem>
217176 <listitem>
218177 <para>
219− Build the NixOS closure and install it in the <literal>system</literal>
220− profile:
178+ Build the NixOS closure and install it in the <literal>system</literal> profile:
221179 </para>
222180<screen><prompt>$ </prompt>nix-env -p /nix/var/nix/profiles/system -f '&lt;nixpkgs/nixos&gt;' -I nixos-config=/etc/nixos/configuration.nix -iA system</screen>
223181 </listitem>
224182 <listitem>
225183 <para>
226− Change ownership of the <literal>/nix</literal> tree to root (since your
227− Nix install was probably single user):
184+ Change ownership of the <literal>/nix</literal> tree to root (since your Nix install was probably single user):
228185 </para>
229186<screen><prompt>$ </prompt>sudo chown -R 0.0 /nix</screen>
230187 </listitem>
231188 <listitem>
232189 <para>
233− Set up the <literal>/etc/NIXOS</literal> and
234− <literal>/etc/NIXOS_LUSTRATE</literal> files:
190+ Set up the <literal>/etc/NIXOS</literal> and <literal>/etc/NIXOS_LUSTRATE</literal> files:
235191 </para>
236192 <para>
237− <literal>/etc/NIXOS</literal> officializes that this is now a NixOS
238− partition (the bootup scripts require its presence).
193+ <literal>/etc/NIXOS</literal> officializes that this is now a NixOS partition (the bootup scripts require its presence).
239194 </para>
240195 <para>
241− <literal>/etc/NIXOS_LUSTRATE</literal> tells the NixOS bootup scripts to
242− move <emphasis>everything</emphasis> that's in the root partition to
243− <literal>/old-root</literal>. This will move your existing distribution out
244− of the way in the very early stages of the NixOS bootup. There are
245− exceptions (we do need to keep NixOS there after all), so the NixOS
246− lustrate process will not touch:
196+ <literal>/etc/NIXOS_LUSTRATE</literal> tells the NixOS bootup scripts to move <emphasis>everything</emphasis> that's in the root partition to <literal>/old-root</literal>. This will move your existing distribution out of the way in the very early stages of the NixOS bootup. There are exceptions (we do need to keep NixOS there after all), so the NixOS lustrate process will not touch:
247197 </para>
248198 <itemizedlist>
249199 <listitem>
@@ -258,26 +208,19 @@ nixpkgs https://nixos.org/channels/nixpkgs-unstable</screen>
258208 </listitem>
259209 <listitem>
260210 <para>
261− Any file or directory listed in <literal>/etc/NIXOS_LUSTRATE</literal>
262− (one per line)
211+ Any file or directory listed in <literal>/etc/NIXOS_LUSTRATE</literal> (one per line)
263212 </para>
264213 </listitem>
265214 </itemizedlist>
266215 <note>
267216 <para>
268− Support for <literal>NIXOS_LUSTRATE</literal> was added in NixOS 16.09.
269− The act of "lustrating" refers to the wiping of the existing distribution.
270− Creating <literal>/etc/NIXOS_LUSTRATE</literal> can also be used on NixOS
271− to remove all mutable files from your root partition (anything that's not
272− in <literal>/nix</literal> or <literal>/boot</literal> gets "lustrated" on
273− the next boot.
217+ Support for <literal>NIXOS_LUSTRATE</literal> was added in NixOS 16.09. The act of "lustrating" refers to the wiping of the existing distribution. Creating <literal>/etc/NIXOS_LUSTRATE</literal> can also be used on NixOS to remove all mutable files from your root partition (anything that's not in <literal>/nix</literal> or <literal>/boot</literal> gets "lustrated" on the next boot.
274218 </para>
275219 <para>
276220 lustrate /ˈlʌstreɪt/ verb.
277221 </para>
278222 <para>
279− purify by expiatory sacrifice, ceremonial washing, or some other ritual
280− action.
223+ purify by expiatory sacrifice, ceremonial washing, or some other ritual action.
281224 </para>
282225 </note>
283226 <para>
@@ -288,8 +231,7 @@ nixpkgs https://nixos.org/channels/nixpkgs-unstable</screen>
288231<prompt>$ </prompt>sudo touch /etc/NIXOS_LUSTRATE
289232</screen>
290233 <para>
291− Let's also make sure the NixOS configuration files are kept once we reboot
292− on NixOS:
234+ Let's also make sure the NixOS configuration files are kept once we reboot on NixOS:
293235 </para>
294236<screen>
295237<prompt>$ </prompt>echo etc/nixos | sudo tee -a /etc/NIXOS_LUSTRATE
@@ -297,18 +239,11 @@ nixpkgs https://nixos.org/channels/nixpkgs-unstable</screen>
297239 </listitem>
298240 <listitem>
299241 <para>
300− Finally, move the <literal>/boot</literal> directory of your current
301− distribution out of the way (the lustrate process will take care of the
302− rest once you reboot, but this one must be moved out now because NixOS
303− needs to install its own boot files:
242+ Finally, move the <literal>/boot</literal> directory of your current distribution out of the way (the lustrate process will take care of the rest once you reboot, but this one must be moved out now because NixOS needs to install its own boot files:
304243 </para>
305244 <warning>
306245 <para>
307− Once you complete this step, your current distribution will no longer be
308− bootable! If you didn't get all the NixOS configuration right, especially
309− those settings pertaining to boot loading and root partition, NixOS may
310− not be bootable either. Have a USB rescue device ready in case this
311− happens.
246+ Once you complete this step, your current distribution will no longer be bootable! If you didn't get all the NixOS configuration right, especially those settings pertaining to boot loading and root partition, NixOS may not be bootable either. Have a USB rescue device ready in case this happens.
312247 </para>
313248 </warning>
314249<screen>
@@ -321,8 +256,7 @@ sudo /nix/var/nix/profiles/system/bin/switch-to-configuration boot
321256 </listitem>
322257 <listitem>
323258 <para>
324− If for some reason you want to revert to the old distribution, you'll need
325− to boot on a USB rescue disk and do something along these lines:
259+ If for some reason you want to revert to the old distribution, you'll need to boot on a USB rescue disk and do something along these lines:
326260 </para>
327261<screen>
328262# mkdir root
@@ -337,20 +271,14 @@ sudo /nix/var/nix/profiles/system/bin/switch-to-configuration boot
337271 This may work as is or you might also need to reinstall the boot loader
338272 </para>
339273 <para>
340− And of course, if you're happy with NixOS and no longer need the old
341− distribution:
274+ And of course, if you're happy with NixOS and no longer need the old distribution:
342275 </para>
343276<screen>sudo rm -rf /old-root</screen>
344277 </listitem>
345278 <listitem>
346279 <para>
347− It's also worth noting that this whole process can be automated. This is
348− especially useful for Cloud VMs, where provider do not provide NixOS. For
349− instance,
350− <link
351− xlink:href="https://github.com/elitak/nixos-infect">nixos-infect</link>
352− uses the lustrate process to convert Digital Ocean droplets to NixOS from
353− other distributions automatically.
280+ It's also worth noting that this whole process can be automated. This is especially useful for Cloud VMs, where provider do not provide NixOS. For instance, <link
281+ xlink:href="https://github.com/elitak/nixos-infect">nixos-infect</link> uses the lustrate process to convert Digital Ocean droplets to NixOS from other distributions automatically.
354282 </para>
355283 </listitem>
356284 </orderedlist>
nixos/doc/manual/installation/installing-pxe.xml+5−20
@@ -10,9 +10,7 @@
1010 </para>
1111
1212 <para>
13− These instructions assume that you have an existing PXE or iPXE
14− infrastructure and simply want to add the NixOS installer as another option.
15− To build the necessary files from a recent version of nixpkgs, you can run:
13+ These instructions assume that you have an existing PXE or iPXE infrastructure and simply want to add the NixOS installer as another option. To build the necessary files from a recent version of nixpkgs, you can run:
1614 </para>
1715
1816<programlisting>
@@ -20,31 +18,18 @@ nix-build -A netboot nixos/release.nix
2018</programlisting>
2119
2220 <para>
23− This will create a <literal>result</literal> directory containing: *
24− <literal>bzImage</literal> – the Linux kernel * <literal>initrd</literal>
25− – the initrd file * <literal>netboot.ipxe</literal> – an example ipxe
26− script demonstrating the appropriate kernel command line arguments for this
27− image
21+ This will create a <literal>result</literal> directory containing: * <literal>bzImage</literal> – the Linux kernel * <literal>initrd</literal> – the initrd file * <literal>netboot.ipxe</literal> – an example ipxe script demonstrating the appropriate kernel command line arguments for this image
2822 </para>
2923
3024 <para>
31− If you’re using plain PXE, configure your boot loader to use the
32− <literal>bzImage</literal> and <literal>initrd</literal> files and have it
33− provide the same kernel command line arguments found in
34− <literal>netboot.ipxe</literal>.
25+ If you’re using plain PXE, configure your boot loader to use the <literal>bzImage</literal> and <literal>initrd</literal> files and have it provide the same kernel command line arguments found in <literal>netboot.ipxe</literal>.
3526 </para>
3627
3728 <para>
38− If you’re using iPXE, depending on how your HTTP/FTP/etc. server is
39− configured you may be able to use <literal>netboot.ipxe</literal> unmodified,
40− or you may need to update the paths to the files to match your server’s
41− directory layout
29+ If you’re using iPXE, depending on how your HTTP/FTP/etc. server is configured you may be able to use <literal>netboot.ipxe</literal> unmodified, or you may need to update the paths to the files to match your server’s directory layout
4230 </para>
4331
4432 <para>
45− In the future we may begin making these files available as build products
46− from hydra at which point we will update this documentation with instructions
47− on how to obtain them either for placing on a dedicated TFTP server or to
48− boot them directly over the internet.
33+ In the future we may begin making these files available as build products from hydra at which point we will update this documentation with instructions on how to obtain them either for placing on a dedicated TFTP server or to boot them directly over the internet.
4934 </para>
5035</section>
nixos/doc/manual/installation/installing-usb.xml+3−12
@@ -6,12 +6,7 @@
66 <title>Booting from a USB Drive</title>
77
88 <para>
9− For systems without CD drive, the NixOS live CD can be booted from a USB
10− stick. You can use the <command>dd</command> utility to write the image:
11− <command>dd if=<replaceable>path-to-image</replaceable>
12− of=<replaceable>/dev/sdX</replaceable></command>. Be careful about specifying
13− the correct drive; you can use the <command>lsblk</command> command to get a
14− list of block devices.
9+ For systems without CD drive, the NixOS live CD can be booted from a USB stick. You can use the <command>dd</command> utility to write the image: <command>dd if=<replaceable>path-to-image</replaceable> of=<replaceable>/dev/sdX</replaceable></command>. Be careful about specifying the correct drive; you can use the <command>lsblk</command> command to get a list of block devices.
1510 <note>
1611 <title>On macOS</title>
1712 <para>
@@ -25,16 +20,12 @@
2520Unmount of all volumes on diskN was successful
2621<prompt>$ </prompt>sudo dd if=nix.iso of=/dev/rdiskN
2722</screen>
28− Using the 'raw' <command>rdiskN</command> device instead of
29− <command>diskN</command> completes in minutes instead of hours. After
30− <command>dd</command> completes, a GUI dialog "The disk you inserted was
31− not readable by this computer" will pop up, which can be ignored.
23+ Using the 'raw' <command>rdiskN</command> device instead of <command>diskN</command> completes in minutes instead of hours. After <command>dd</command> completes, a GUI dialog "The disk you inserted was not readable by this computer" will pop up, which can be ignored.
3224 </para>
3325 </note>
3426 </para>
3527
3628 <para>
37− The <command>dd</command> utility will write the image verbatim to the drive,
38− making it the recommended option for both UEFI and non-UEFI installations.
29+ The <command>dd</command> utility will write the image verbatim to the drive, making it the recommended option for both UEFI and non-UEFI installations.
3930 </para>
4031</section>
nixos/doc/manual/installation/installing-virtualbox-guest.xml+7−22
@@ -6,13 +6,8 @@
66 <title>Installing in a VirtualBox guest</title>
77
88 <para>
9− Installing NixOS into a VirtualBox guest is convenient for users who want to
10− try NixOS without installing it on bare metal. If you want to use a pre-made
11− VirtualBox appliance, it is available at
12− <link
13− xlink:href="https://nixos.org/nixos/download.html">the downloads
14− page</link>. If you want to set up a VirtualBox guest manually, follow these
15− instructions:
9+ Installing NixOS into a VirtualBox guest is convenient for users who want to try NixOS without installing it on bare metal. If you want to use a pre-made VirtualBox appliance, it is available at <link
10+ xlink:href="https://nixos.org/nixos/download.html">the downloads page</link>. If you want to set up a VirtualBox guest manually, follow these instructions:
1611 </para>
1712
1813 <orderedlist>
@@ -43,21 +38,18 @@
4338 </listitem>
4439 <listitem>
4540 <para>
46− Click on Settings / System / Acceleration and enable "VT-x/AMD-V"
47− acceleration
41+ Click on Settings / System / Acceleration and enable "VT-x/AMD-V" acceleration
4842 </para>
4943 </listitem>
5044 <listitem>
5145 <para>
52− Save the settings, start the virtual machine, and continue installation
53− like normal
46+ Save the settings, start the virtual machine, and continue installation like normal
5447 </para>
5548 </listitem>
5649 </orderedlist>
5750
5851 <para>
59− There are a few modifications you should make in configuration.nix. Enable
60− booting:
52+ There are a few modifications you should make in configuration.nix. Enable booting:
6153 </para>
6254
6355<programlisting>
@@ -65,8 +57,7 @@
6557</programlisting>
6658
6759 <para>
68− Also remove the fsck that runs at startup. It will always fail to run,
69− stopping your boot until you press <literal>*</literal>.
60+ Also remove the fsck that runs at startup. It will always fail to run, stopping your boot until you press <literal>*</literal>.
7061 </para>
7162
7263<programlisting>
@@ -74,13 +65,7 @@
7465</programlisting>
7566
7667 <para>
77− Shared folders can be given a name and a path in the host system in the
78− VirtualBox settings (Machine / Settings / Shared Folders, then click on the
79− "Add" icon). Add the following to the
80− <literal>/etc/nixos/configuration.nix</literal> to auto-mount them. If you do
81− not add <literal>"nofail"</literal>, the system will no boot properly. The
82− same goes for disabling <literal>rngd</literal> which is normally used to get
83− randomness but this does not work in virtual machines.
68+ Shared folders can be given a name and a path in the host system in the VirtualBox settings (Machine / Settings / Shared Folders, then click on the "Add" icon). Add the following to the <literal>/etc/nixos/configuration.nix</literal> to auto-mount them. If you do not add <literal>"nofail"</literal>, the system will no boot properly. The same goes for disabling <literal>rngd</literal> which is normally used to get randomness but this does not work in virtual machines.
8469 </para>
8570
8671<programlisting>
nixos/doc/manual/installation/installing.xml+53−177
@@ -8,67 +8,46 @@
88 <title>Booting the system</title>
99
1010 <para>
11− NixOS can be installed on BIOS or UEFI systems. The procedure for a UEFI
12− installation is by and large the same as a BIOS installation. The
13− differences are mentioned in the steps that follow.
11+ NixOS can be installed on BIOS or UEFI systems. The procedure for a UEFI installation is by and large the same as a BIOS installation. The differences are mentioned in the steps that follow.
1412 </para>
1513
1614 <para>
17− The installation media can be burned to a CD, or now more commonly, "burned"
18− to a USB drive (see <xref linkend="sec-booting-from-usb"/>).
15+ The installation media can be burned to a CD, or now more commonly, "burned" to a USB drive (see <xref linkend="sec-booting-from-usb"/>).
1916 </para>
2017
2118 <para>
22− The installation media contains a basic NixOS installation. When it’s
23− finished booting, it should have detected most of your hardware.
19+ The installation media contains a basic NixOS installation. When it’s finished booting, it should have detected most of your hardware.
2420 </para>
2521
2622 <para>
27− The NixOS manual is available on virtual console 8 (press Alt+F8 to access)
28− or by running <command>nixos-help</command>.
23+ The NixOS manual is available on virtual console 8 (press Alt+F8 to access) or by running <command>nixos-help</command>.
2924 </para>
3025
3126 <para>
32− You are logged-in automatically as <literal>nixos</literal>.
33− The <literal>nixos</literal> user account has an empty password so you
34− can use <command>sudo</command> without a password.
27+ You are logged-in automatically as <literal>nixos</literal>. The <literal>nixos</literal> user account has an empty password so you can use <command>sudo</command> without a password.
3528 </para>
3629
3730 <para>
38− If you downloaded the graphical ISO image, you can run <command>systemctl
39− start display-manager</command> to start the desktop environment. If you want to continue on the
40− terminal, you can use <command>loadkeys</command> to switch to your
41− preferred keyboard layout. (We even provide neo2 via <command>loadkeys de
42− neo</command>!)
31+ If you downloaded the graphical ISO image, you can run <command>systemctl start display-manager</command> to start the desktop environment. If you want to continue on the terminal, you can use <command>loadkeys</command> to switch to your preferred keyboard layout. (We even provide neo2 via <command>loadkeys de neo</command>!)
4332 </para>
4433
4534 <section xml:id="sec-installation-booting-networking">
4635 <title>Networking in the installer</title>
4736
4837 <para>
49− The boot process should have brought up networking (check <command>ip
50− a</command>). Networking is necessary for the installer, since it will
51− download lots of stuff (such as source tarballs or Nixpkgs channel
52− binaries). It’s best if you have a DHCP server on your network. Otherwise
53− configure networking manually using <command>ifconfig</command>.
38+ The boot process should have brought up networking (check <command>ip a</command>). Networking is necessary for the installer, since it will download lots of stuff (such as source tarballs or Nixpkgs channel binaries). It’s best if you have a DHCP server on your network. Otherwise configure networking manually using <command>ifconfig</command>.
5439 </para>
5540
5641 <para>
57− To manually configure the network on the graphical installer, first disable
58− network-manager with <command>systemctl stop NetworkManager</command>.
42+ To manually configure the network on the graphical installer, first disable network-manager with <command>systemctl stop NetworkManager</command>.
5943 </para>
6044
6145 <para>
62− To manually configure the wifi on the minimal installer, run
63− <command>wpa_supplicant -B -i interface -c &lt;(wpa_passphrase 'SSID'
64− 'key')</command>.
46+ To manually configure the wifi on the minimal installer, run <command>wpa_supplicant -B -i interface -c &lt;(wpa_passphrase 'SSID' 'key')</command>.
6547 </para>
6648
6749 <para>
68− If you would like to continue the installation from a different machine you
69− need to activate the SSH daemon via <command>systemctl start
70− sshd</command>. You then must set a password for either <literal>root</literal> or
71− <literal>nixos</literal> with <command>passwd></command> to be able to login.
50+ If you would like to continue the installation from a different machine you need to activate the SSH daemon via <command>systemctl start sshd</command>. You then must set a password for either <literal>root</literal> or <literal>nixos</literal> with <command>passwd></command> to be able to login.
7251 </para>
7352 </section>
7453 </section>
@@ -76,32 +55,25 @@
7655 <title>Partitioning and formatting</title>
7756
7857 <para>
79− The NixOS installer doesn’t do any partitioning or formatting, so you need
80− to do that yourself.
58+ The NixOS installer doesn’t do any partitioning or formatting, so you need to do that yourself.
8159 </para>
8260
8361 <para>
84− The NixOS installer ships with multiple partitioning tools. The examples
85− below use <command>parted</command>, but also provides
86− <command>fdisk</command>, <command>gdisk</command>,
87− <command>cfdisk</command>, and <command>cgdisk</command>.
62+ The NixOS installer ships with multiple partitioning tools. The examples below use <command>parted</command>, but also provides <command>fdisk</command>, <command>gdisk</command>, <command>cfdisk</command>, and <command>cgdisk</command>.
8863 </para>
8964
9065 <para>
91− The recommended partition scheme differs depending if the computer uses
92− <emphasis>Legacy Boot</emphasis> or <emphasis>UEFI</emphasis>.
66+ The recommended partition scheme differs depending if the computer uses <emphasis>Legacy Boot</emphasis> or <emphasis>UEFI</emphasis>.
9367 </para>
9468
9569 <section xml:id="sec-installation-partitioning-UEFI">
9670 <title>UEFI (GPT)</title>
9771
9872 <para>
99− Here's an example partition scheme for UEFI, using
100− <filename>/dev/sda</filename> as the device.
73+ Here's an example partition scheme for UEFI, using <filename>/dev/sda</filename> as the device.
10174 <note>
10275 <para>
103− You can safely ignore <command>parted</command>'s informational message
104− about needing to update /etc/fstab.
76+ You can safely ignore <command>parted</command>'s informational message about needing to update /etc/fstab.
10577 </para>
10678 </note>
10779 </para>
@@ -116,31 +88,24 @@
11688 </listitem>
11789 <listitem>
11890 <para>
119− Add the <emphasis>root</emphasis> partition. This will fill the disk
120− except for the end part, where the swap will live, and the space left in
121− front (512MiB) which will be used by the boot partition.
91+ Add the <emphasis>root</emphasis> partition. This will fill the disk except for the end part, where the swap will live, and the space left in front (512MiB) which will be used by the boot partition.
12292<screen language="commands"><prompt># </prompt>parted /dev/sda -- mkpart primary 512MiB -8GiB</screen>
12393 </para>
12494 </listitem>
12595 <listitem>
12696 <para>
127− Next, add a <emphasis>swap</emphasis> partition. The size required will
128− vary according to needs, here a 8GiB one is created.
97+ Next, add a <emphasis>swap</emphasis> partition. The size required will vary according to needs, here a 8GiB one is created.
12998<screen language="commands"><prompt># </prompt>parted /dev/sda -- mkpart primary linux-swap -8GiB 100%</screen>
13099 <note>
131100 <para>
132− The swap partition size rules are no different than for other Linux
133− distributions.
101+ The swap partition size rules are no different than for other Linux distributions.
134102 </para>
135103 </note>
136104 </para>
137105 </listitem>
138106 <listitem>
139107 <para>
140− Finally, the <emphasis>boot</emphasis> partition. NixOS by default uses
141− the ESP (EFI system partition) as its <emphasis>/boot</emphasis>
142− partition. It uses the initially reserved 512MiB at the start of the
143− disk.
108+ Finally, the <emphasis>boot</emphasis> partition. NixOS by default uses the ESP (EFI system partition) as its <emphasis>/boot</emphasis> partition. It uses the initially reserved 512MiB at the start of the disk.
144109<screen language="commands"><prompt># </prompt>parted /dev/sda -- mkpart ESP fat32 1MiB 512MiB
145110<prompt># </prompt>parted /dev/sda -- set 3 boot on</screen>
146111 </para>
@@ -149,8 +114,7 @@
149114 </para>
150115
151116 <para>
152− Once complete, you can follow with
153− <xref linkend="sec-installation-partitioning-formatting"/>.
117+ Once complete, you can follow with <xref linkend="sec-installation-partitioning-formatting"/>.
154118 </para>
155119 </section>
156120
@@ -158,12 +122,10 @@
158122 <title>Legacy Boot (MBR)</title>
159123
160124 <para>
161− Here's an example partition scheme for Legacy Boot, using
162− <filename>/dev/sda</filename> as the device.
125+ Here's an example partition scheme for Legacy Boot, using <filename>/dev/sda</filename> as the device.
163126 <note>
164127 <para>
165− You can safely ignore <command>parted</command>'s informational message
166− about needing to update /etc/fstab.
128+ You can safely ignore <command>parted</command>'s informational message about needing to update /etc/fstab.
167129 </para>
168130 </note>
169131 </para>
@@ -178,20 +140,17 @@
178140 </listitem>
179141 <listitem>
180142 <para>
181− Add the <emphasis>root</emphasis> partition. This will fill the the disk
182− except for the end part, where the swap will live.
143+ Add the <emphasis>root</emphasis> partition. This will fill the the disk except for the end part, where the swap will live.
183144<screen language="commands"><prompt># </prompt>parted /dev/sda -- mkpart primary 1MiB -8GiB</screen>
184145 </para>
185146 </listitem>
186147 <listitem>
187148 <para>
188− Finally, add a <emphasis>swap</emphasis> partition. The size required
189− will vary according to needs, here a 8GiB one is created.
149+ Finally, add a <emphasis>swap</emphasis> partition. The size required will vary according to needs, here a 8GiB one is created.
190150<screen language="commands"><prompt># </prompt>parted /dev/sda -- mkpart primary linux-swap -8GiB 100%</screen>
191151 <note>
192152 <para>
193− The swap partition size rules are no different than for other Linux
194− distributions.
153+ The swap partition size rules are no different than for other Linux distributions.
195154 </para>
196155 </note>
197156 </para>
@@ -200,8 +159,7 @@
200159 </para>
201160
202161 <para>
203− Once complete, you can follow with
204− <xref linkend="sec-installation-partitioning-formatting"/>.
162+ Once complete, you can follow with <xref linkend="sec-installation-partitioning-formatting"/>.
205163 </para>
206164 </section>
207165
@@ -213,20 +171,14 @@
213171 <itemizedlist>
214172 <listitem>
215173 <para>
216− For initialising Ext4 partitions: <command>mkfs.ext4</command>. It is
217− recommended that you assign a unique symbolic label to the file system
218− using the option <option>-L <replaceable>label</replaceable></option>,
219− since this makes the file system configuration independent from device
220− changes. For example:
174+ For initialising Ext4 partitions: <command>mkfs.ext4</command>. It is recommended that you assign a unique symbolic label to the file system using the option <option>-L <replaceable>label</replaceable></option>, since this makes the file system configuration independent from device changes. For example:
221175<screen>
222176<prompt># </prompt>mkfs.ext4 -L nixos /dev/sda1</screen>
223177 </para>
224178 </listitem>
225179 <listitem>
226180 <para>
227− For creating swap partitions: <command>mkswap</command>. Again it’s
228− recommended to assign a label to the swap partition: <option>-L
229− <replaceable>label</replaceable></option>. For example:
181+ For creating swap partitions: <command>mkswap</command>. Again it’s recommended to assign a label to the swap partition: <option>-L <replaceable>label</replaceable></option>. For example:
230182<screen>
231183<prompt># </prompt>mkswap -L swap /dev/sda2</screen>
232184 </para>
@@ -239,9 +191,7 @@
239191 </term>
240192 <listitem>
241193 <para>
242− For creating boot partitions: <command>mkfs.fat</command>. Again
243− it’s recommended to assign a label to the boot partition:
244− <option>-n <replaceable>label</replaceable></option>. For example:
194+ For creating boot partitions: <command>mkfs.fat</command>. Again it’s recommended to assign a label to the boot partition: <option>-n <replaceable>label</replaceable></option>. For example:
245195<screen>
246196<prompt># </prompt>mkfs.fat -F 32 -n boot /dev/sda3</screen>
247197 </para>
@@ -251,9 +201,7 @@
251201 </listitem>
252202 <listitem>
253203 <para>
254− For creating LVM volumes, the LVM commands, e.g.,
255− <command>pvcreate</command>, <command>vgcreate</command>, and
256− <command>lvcreate</command>.
204+ For creating LVM volumes, the LVM commands, e.g., <command>pvcreate</command>, <command>vgcreate</command>, and <command>lvcreate</command>.
257205 </para>
258206 </listitem>
259207 <listitem>
@@ -271,8 +219,7 @@
271219 <orderedlist>
272220 <listitem>
273221 <para>
274− Mount the target file system on which NixOS should be installed on
275− <filename>/mnt</filename>, e.g.
222+ Mount the target file system on which NixOS should be installed on <filename>/mnt</filename>, e.g.
276223<screen>
277224<prompt># </prompt>mount /dev/disk/by-label/nixos /mnt
278225</screen>
@@ -298,44 +245,26 @@
298245 </listitem>
299246 <listitem>
300247 <para>
301− If your machine has a limited amount of memory, you may want to activate
302− swap devices now (<command>swapon
303− <replaceable>device</replaceable></command>). The installer (or rather,
304− the build actions that it may spawn) may need quite a bit of RAM,
305− depending on your configuration.
248+ If your machine has a limited amount of memory, you may want to activate swap devices now (<command>swapon <replaceable>device</replaceable></command>). The installer (or rather, the build actions that it may spawn) may need quite a bit of RAM, depending on your configuration.
306249<screen>
307250<prompt># </prompt>swapon /dev/sda2</screen>
308251 </para>
309252 </listitem>
310253 <listitem>
311254 <para>
312− You now need to create a file
313− <filename>/mnt/etc/nixos/configuration.nix</filename> that specifies the
314− intended configuration of the system. This is because NixOS has a
315− <emphasis>declarative</emphasis> configuration model: you create or edit a
316− description of the desired configuration of your system, and then NixOS
317− takes care of making it happen. The syntax of the NixOS configuration file
318− is described in <xref linkend="sec-configuration-syntax"/>, while a list
319− of available configuration options appears in
320− <xref
321− linkend="ch-options"/>. A minimal example is shown in
322− <xref
255+ You now need to create a file <filename>/mnt/etc/nixos/configuration.nix</filename> that specifies the intended configuration of the system. This is because NixOS has a <emphasis>declarative</emphasis> configuration model: you create or edit a description of the desired configuration of your system, and then NixOS takes care of making it happen. The syntax of the NixOS configuration file is described in <xref linkend="sec-configuration-syntax"/>, while a list of available configuration options appears in <xref
256+ linkend="ch-options"/>. A minimal example is shown in <xref
323257 linkend="ex-config"/>.
324258 </para>
325259 <para>
326− The command <command>nixos-generate-config</command> can generate an
327− initial configuration file for you:
260+ The command <command>nixos-generate-config</command> can generate an initial configuration file for you:
328261<screen>
329262<prompt># </prompt>nixos-generate-config --root /mnt</screen>
330− You should then edit <filename>/mnt/etc/nixos/configuration.nix</filename>
331− to suit your needs:
263+ You should then edit <filename>/mnt/etc/nixos/configuration.nix</filename> to suit your needs:
332264<screen>
333265<prompt># </prompt>nano /mnt/etc/nixos/configuration.nix
334266</screen>
335− If you’re using the graphical ISO image, other editors may be available
336− (such as <command>vim</command>). If you have network access, you can also
337− install other editors — for instance, you can install Emacs by running
338− <literal>nix-env -f '&lt;nixpkgs&gt;' -iA emacs</literal>.
267+ If you’re using the graphical ISO image, other editors may be available (such as <command>vim</command>). If you have network access, you can also install other editors — for instance, you can install Emacs by running <literal>nix-env -f '&lt;nixpkgs&gt;' -iA emacs</literal>.
339268 </para>
340269 <variablelist>
341270 <varlistentry>
@@ -344,9 +273,7 @@
344273 </term>
345274 <listitem>
346275 <para>
347− You <emphasis>must</emphasis> set the option
348− <xref linkend="opt-boot.loader.grub.device"/> to specify on which disk
349− the GRUB boot loader is to be installed. Without it, NixOS cannot boot.
276+ You <emphasis>must</emphasis> set the option <xref linkend="opt-boot.loader.grub.device"/> to specify on which disk the GRUB boot loader is to be installed. Without it, NixOS cannot boot.
350277 </para>
351278 </listitem>
352279 </varlistentry>
@@ -356,60 +283,26 @@
356283 </term>
357284 <listitem>
358285 <para>
359− You <emphasis>must</emphasis> set the option
360− <xref linkend="opt-boot.loader.systemd-boot.enable"/> to
361− <literal>true</literal>. <command>nixos-generate-config</command>
362− should do this automatically for new configurations when booted in UEFI
363− mode.
286+ You <emphasis>must</emphasis> set the option <xref linkend="opt-boot.loader.systemd-boot.enable"/> to <literal>true</literal>. <command>nixos-generate-config</command> should do this automatically for new configurations when booted in UEFI mode.
364287 </para>
365288 <para>
366− You may want to look at the options starting with
367− <option><link linkend="opt-boot.loader.efi.canTouchEfiVariables">boot.loader.efi</link></option>
368− and
369− <option><link linkend="opt-boot.loader.systemd-boot.enable">boot.loader.systemd</link></option>
370− as well.
289+ You may want to look at the options starting with <option><link linkend="opt-boot.loader.efi.canTouchEfiVariables">boot.loader.efi</link></option> and <option><link linkend="opt-boot.loader.systemd-boot.enable">boot.loader.systemd</link></option> as well.
371290 </para>
372291 </listitem>
373292 </varlistentry>
374293 </variablelist>
375294 <para>
376− If there are other operating systems running on the machine before
377− installing NixOS, the <xref linkend="opt-boot.loader.grub.useOSProber"/>
378− option can be set to <literal>true</literal> to automatically add them to
379− the grub menu.
295+ If there are other operating systems running on the machine before installing NixOS, the <xref linkend="opt-boot.loader.grub.useOSProber"/> option can be set to <literal>true</literal> to automatically add them to the grub menu.
380296 </para>
381297 <para>
382− If you need to configure networking for your machine the configuration
383− options are described in <xref linkend="sec-networking"/>.
298+ If you need to configure networking for your machine the configuration options are described in <xref linkend="sec-networking"/>.
384299 </para>
385300 <para>
386− Another critical option is <option>fileSystems</option>, specifying the
387− file systems that need to be mounted by NixOS. However, you typically
388− don’t need to set it yourself, because
389− <command>nixos-generate-config</command> sets it automatically in
390− <filename>/mnt/etc/nixos/hardware-configuration.nix</filename> from your
391− currently mounted file systems. (The configuration file
392− <filename>hardware-configuration.nix</filename> is included from
393− <filename>configuration.nix</filename> and will be overwritten by future
394− invocations of <command>nixos-generate-config</command>; thus, you
395− generally should not modify it.) Additionally, you may want to look at
396− <link xlink:href="https://github.com/NixOS/nixos-hardware">Hardware
397− configuration for known-hardware</link> at this point or after
398− installation.
399−
301+ Another critical option is <option>fileSystems</option>, specifying the file systems that need to be mounted by NixOS. However, you typically don’t need to set it yourself, because <command>nixos-generate-config</command> sets it automatically in <filename>/mnt/etc/nixos/hardware-configuration.nix</filename> from your currently mounted file systems. (The configuration file <filename>hardware-configuration.nix</filename> is included from <filename>configuration.nix</filename> and will be overwritten by future invocations of <command>nixos-generate-config</command>; thus, you generally should not modify it.) Additionally, you may want to look at <link xlink:href="https://github.com/NixOS/nixos-hardware">Hardware configuration for known-hardware</link> at this point or after installation.
400302 </para>
401303 <note>
402304 <para>
403− Depending on your hardware configuration or type of file system, you may
404− need to set the option <option>boot.initrd.kernelModules</option> to
405− include the kernel modules that are necessary for mounting the root file
406− system, otherwise the installed system will not be able to boot. (If this
407− happens, boot from the installation media again, mount the target file
408− system on <filename>/mnt</filename>, fix
409− <filename>/mnt/etc/nixos/configuration.nix</filename> and rerun
410− <filename>nixos-install</filename>.) In most cases,
411− <command>nixos-generate-config</command> will figure out the required
412− modules.
305+ Depending on your hardware configuration or type of file system, you may need to set the option <option>boot.initrd.kernelModules</option> to include the kernel modules that are necessary for mounting the root file system, otherwise the installed system will not be able to boot. (If this happens, boot from the installation media again, mount the target file system on <filename>/mnt</filename>, fix <filename>/mnt/etc/nixos/configuration.nix</filename> and rerun <filename>nixos-install</filename>.) In most cases, <command>nixos-generate-config</command> will figure out the required modules.
413306 </para>
414307 </note>
415308 </listitem>
@@ -418,24 +311,17 @@
418311 Do the installation:
419312<screen>
420313<prompt># </prompt>nixos-install</screen>
421− Cross fingers. If this fails due to a temporary problem (such as a network
422− issue while downloading binaries from the NixOS binary cache), you can
423− just re-run <command>nixos-install</command>. Otherwise, fix your
424− <filename>configuration.nix</filename> and then re-run
425− <command>nixos-install</command>.
314+ Cross fingers. If this fails due to a temporary problem (such as a network issue while downloading binaries from the NixOS binary cache), you can just re-run <command>nixos-install</command>. Otherwise, fix your <filename>configuration.nix</filename> and then re-run <command>nixos-install</command>.
426315 </para>
427316 <para>
428− As the last step, <command>nixos-install</command> will ask you to set the
429− password for the <literal>root</literal> user, e.g.
317+ As the last step, <command>nixos-install</command> will ask you to set the password for the <literal>root</literal> user, e.g.
430318<screen>
431319setting root password...
432320Enter new UNIX password: ***
433321Retype new UNIX password: ***</screen>
434322 <note>
435323 <para>
436− For unattended installations, it is possible to use
437− <command>nixos-install --no-root-passwd</command> in order to disable
438− the password prompt entirely.
324+ For unattended installations, it is possible to use <command>nixos-install --no-root-passwd</command> in order to disable the password prompt entirely.
439325 </para>
440326 </note>
441327 </para>
@@ -449,21 +335,14 @@ Retype new UNIX password: ***</screen>
449335 </listitem>
450336 <listitem>
451337 <para>
452− You should now be able to boot into the installed NixOS. The GRUB boot
453− menu shows a list of <emphasis>available configurations</emphasis>
454− (initially just one). Every time you change the NixOS configuration (see
455− <link
456− linkend="sec-changing-config">Changing Configuration</link>
457− ), a new item is added to the menu. This allows you to easily roll back to
458− a previous configuration if something goes wrong.
338+ You should now be able to boot into the installed NixOS. The GRUB boot menu shows a list of <emphasis>available configurations</emphasis> (initially just one). Every time you change the NixOS configuration (see <link
339+ linkend="sec-changing-config">Changing Configuration</link> ), a new item is added to the menu. This allows you to easily roll back to a previous configuration if something goes wrong.
459340 </para>
460341 <para>
461− You should log in and change the <literal>root</literal> password with
462− <command>passwd</command>.
342+ You should log in and change the <literal>root</literal> password with <command>passwd</command>.
463343 </para>
464344 <para>
465− You’ll probably want to create some user accounts as well, which can be
466− done with <command>useradd</command>:
345+ You’ll probably want to create some user accounts as well, which can be done with <command>useradd</command>:
467346<screen>
468347<prompt>$ </prompt>useradd -c 'Eelco Dolstra' -m eelco
469348<prompt>$ </prompt>passwd eelco</screen>
@@ -484,11 +363,8 @@ Retype new UNIX password: ***</screen>
484363 <title>Installation summary</title>
485364
486365 <para>
487− To summarise, <xref linkend="ex-install-sequence" /> shows a typical
488− sequence of commands for installing NixOS on an empty hard drive (here
489− <filename>/dev/sda</filename>). <xref linkend="ex-config"
490−/> shows a
491− corresponding configuration Nix expression.
366+ To summarise, <xref linkend="ex-install-sequence" /> shows a typical sequence of commands for installing NixOS on an empty hard drive (here <filename>/dev/sda</filename>). <xref linkend="ex-config"
367+/> shows a corresponding configuration Nix expression.
492368 </para>
493369
494370 <example xml:id="ex-partition-scheme-MBR">
nixos/doc/manual/installation/obtaining.xml+9−29
@@ -5,48 +5,28 @@
55 xml:id="sec-obtaining">
66 <title>Obtaining NixOS</title>
77 <para>
8− NixOS ISO images can be downloaded from the
9− <link
10−xlink:href="http://nixos.org/nixos/download.html">NixOS download
11− page</link>. There are a number of installation options. If you happen to
12− have an optical drive and a spare CD, burning the image to CD and booting
13− from that is probably the easiest option. Most people will need to prepare a
14− USB stick to boot from. <xref linkend="sec-booting-from-usb"/> describes the
15− preferred method to prepare a USB stick. A number of alternative methods are
16− presented in the
17− <link
18−xlink:href="https://nixos.wiki/wiki/NixOS_Installation_Guide#Making_the_installation_media">NixOS
19− Wiki</link>.
8+ NixOS ISO images can be downloaded from the <link
9+xlink:href="http://nixos.org/nixos/download.html">NixOS download page</link>. There are a number of installation options. If you happen to have an optical drive and a spare CD, burning the image to CD and booting from that is probably the easiest option. Most people will need to prepare a USB stick to boot from. <xref linkend="sec-booting-from-usb"/> describes the preferred method to prepare a USB stick. A number of alternative methods are presented in the <link
10+xlink:href="https://nixos.wiki/wiki/NixOS_Installation_Guide#Making_the_installation_media">NixOS Wiki</link>.
2011 </para>
2112 <para>
22− As an alternative to installing NixOS yourself, you can get a running NixOS
23− system through several other means:
13+ As an alternative to installing NixOS yourself, you can get a running NixOS system through several other means:
2414 <itemizedlist>
2515 <listitem>
2616 <para>
27− Using virtual appliances in Open Virtualization Format (OVF) that can be
28− imported into VirtualBox. These are available from the
29− <link xlink:href="http://nixos.org/nixos/download.html">NixOS download
30− page</link>.
17+ Using virtual appliances in Open Virtualization Format (OVF) that can be imported into VirtualBox. These are available from the <link xlink:href="http://nixos.org/nixos/download.html">NixOS download page</link>.
3118 </para>
3219 </listitem>
3320 <listitem>
3421 <para>
35− Using AMIs for Amazon’s EC2. To find one for your region and instance
36− type, please refer to the
37− <link
38− xlink:href="https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/virtualisation/ec2-amis.nix">list
39− of most recent AMIs</link>.
22+ Using AMIs for Amazon’s EC2. To find one for your region and instance type, please refer to the <link
23+ xlink:href="https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/virtualisation/ec2-amis.nix">list of most recent AMIs</link>.
4024 </para>
4125 </listitem>
4226 <listitem>
4327 <para>
44− Using NixOps, the NixOS-based cloud deployment tool, which allows you to
45− provision VirtualBox and EC2 NixOS instances from declarative
46− specifications. Check out the
47− <link
48− xlink:href="https://nixos.org/nixops">NixOps homepage</link> for
49− details.
28+ Using NixOps, the NixOS-based cloud deployment tool, which allows you to provision VirtualBox and EC2 NixOS instances from declarative specifications. Check out the <link
29+ xlink:href="https://nixos.org/nixops">NixOps homepage</link> for details.
5030 </para>
5131 </listitem>
5232 </itemizedlist>
nixos/doc/manual/installation/upgrading.xml+17−65
@@ -4,68 +4,33 @@
44 xml:id="sec-upgrading">
55 <title>Upgrading NixOS</title>
66 <para>
7− The best way to keep your NixOS installation up to date is to use one of the
8− NixOS <emphasis>channels</emphasis>. A channel is a Nix mechanism for
9− distributing Nix expressions and associated binaries. The NixOS channels are
10− updated automatically from NixOS’s Git repository after certain tests have
11− passed and all packages have been built. These channels are:
7+ The best way to keep your NixOS installation up to date is to use one of the NixOS <emphasis>channels</emphasis>. A channel is a Nix mechanism for distributing Nix expressions and associated binaries. The NixOS channels are updated automatically from NixOS’s Git repository after certain tests have passed and all packages have been built. These channels are:
128 <itemizedlist>
139 <listitem>
1410 <para>
15− <emphasis>Stable channels</emphasis>, such as
16− <literal
17− xlink:href="https://nixos.org/channels/nixos-19.03">nixos-19.03</literal>.
18− These only get conservative bug fixes and package upgrades. For instance,
19− a channel update may cause the Linux kernel on your system to be upgraded
20− from 4.19.34 to 4.19.38 (a minor bug fix), but not from
21− 4.19.<replaceable>x</replaceable> to 4.20.<replaceable>x</replaceable> (a
22− major change that has the potential to break things). Stable channels are
23− generally maintained until the next stable branch is created.
11+ <emphasis>Stable channels</emphasis>, such as <literal
12+ xlink:href="https://nixos.org/channels/nixos-19.03">nixos-19.03</literal>. These only get conservative bug fixes and package upgrades. For instance, a channel update may cause the Linux kernel on your system to be upgraded from 4.19.34 to 4.19.38 (a minor bug fix), but not from 4.19.<replaceable>x</replaceable> to 4.20.<replaceable>x</replaceable> (a major change that has the potential to break things). Stable channels are generally maintained until the next stable branch is created.
2413 </para>
2514 <para></para>
2615 </listitem>
2716 <listitem>
2817 <para>
29− The <emphasis>unstable channel</emphasis>,
30− <literal
31− xlink:href="https://nixos.org/channels/nixos-unstable">nixos-unstable</literal>.
32− This corresponds to NixOS’s main development branch, and may thus see
33− radical changes between channel updates. It’s not recommended for
34− production systems.
18+ The <emphasis>unstable channel</emphasis>, <literal
19+ xlink:href="https://nixos.org/channels/nixos-unstable">nixos-unstable</literal>. This corresponds to NixOS’s main development branch, and may thus see radical changes between channel updates. It’s not recommended for production systems.
3520 </para>
3621 </listitem>
3722 <listitem>
3823 <para>
39− <emphasis>Small channels</emphasis>, such as
40− <literal
41− xlink:href="https://nixos.org/channels/nixos-19.03-small">nixos-19.03-small</literal>
42− or
43− <literal
44− xlink:href="https://nixos.org/channels/nixos-unstable-small">nixos-unstable-small</literal>.
45− These are identical to the stable and unstable channels described above,
46− except that they contain fewer binary packages. This means they get
47− updated faster than the regular channels (for instance, when a critical
48− security patch is committed to NixOS’s source tree), but may require
49− more packages to be built from source than usual. They’re mostly
50− intended for server environments and as such contain few GUI applications.
24+ <emphasis>Small channels</emphasis>, such as <literal
25+ xlink:href="https://nixos.org/channels/nixos-19.03-small">nixos-19.03-small</literal> or <literal
26+ xlink:href="https://nixos.org/channels/nixos-unstable-small">nixos-unstable-small</literal>. These are identical to the stable and unstable channels described above, except that they contain fewer binary packages. This means they get updated faster than the regular channels (for instance, when a critical security patch is committed to NixOS’s source tree), but may require more packages to be built from source than usual. They’re mostly intended for server environments and as such contain few GUI applications.
5127 </para>
5228 </listitem>
5329 </itemizedlist>
54− To see what channels are available, go to
55− <link xlink:href="https://nixos.org/channels"/>. (Note that the URIs of the
56− various channels redirect to a directory that contains the channel’s latest
57− version and includes ISO images and VirtualBox appliances.) Please note that
58− during the release process, channels that are not yet released will be
59− present here as well. See the Getting NixOS page
60− <link xlink:href="https://nixos.org/nixos/download.html"/> to find the newest
61− supported stable release.
30+ To see what channels are available, go to <link xlink:href="https://nixos.org/channels"/>. (Note that the URIs of the various channels redirect to a directory that contains the channel’s latest version and includes ISO images and VirtualBox appliances.) Please note that during the release process, channels that are not yet released will be present here as well. See the Getting NixOS page <link xlink:href="https://nixos.org/nixos/download.html"/> to find the newest supported stable release.
6231 </para>
6332 <para>
64− When you first install NixOS, you’re automatically subscribed to the NixOS
65− channel that corresponds to your installation source. For instance, if you
66− installed from a 19.03 ISO, you will be subscribed to the
67− <literal>nixos-19.03</literal> channel. To see which NixOS channel you’re
68− subscribed to, run the following as root:
33+ When you first install NixOS, you’re automatically subscribed to the NixOS channel that corresponds to your installation source. For instance, if you installed from a 19.03 ISO, you will be subscribed to the <literal>nixos-19.03</literal> channel. To see which NixOS channel you’re subscribed to, run the following as root:
6934<screen>
7035# nix-channel --list | grep nixos
7136nixos https://nixos.org/channels/nixos-unstable
@@ -74,8 +39,7 @@ nixos https://nixos.org/channels/nixos-unstable
7439<screen>
7540# nix-channel --add https://nixos.org/channels/<replaceable>channel-name</replaceable> nixos
7641</screen>
77− (Be sure to include the <literal>nixos</literal> parameter at the end.) For
78− instance, to use the NixOS 19.03 stable channel:
42+ (Be sure to include the <literal>nixos</literal> parameter at the end.) For instance, to use the NixOS 19.03 stable channel:
7943<screen>
8044# nix-channel --add https://nixos.org/channels/nixos-19.03 nixos
8145</screen>
@@ -89,43 +53,31 @@ nixos https://nixos.org/channels/nixos-unstable
8953</screen>
9054 </para>
9155 <para>
92− You can then upgrade NixOS to the latest version in your chosen channel by
93− running
56+ You can then upgrade NixOS to the latest version in your chosen channel by running
9457<screen>
9558# nixos-rebuild switch --upgrade
9659</screen>
97− which is equivalent to the more verbose <literal>nix-channel --update nixos;
98− nixos-rebuild switch</literal>.
60+ which is equivalent to the more verbose <literal>nix-channel --update nixos; nixos-rebuild switch</literal>.
9961 </para>
10062 <note>
10163 <para>
102− Channels are set per user. This means that running <literal> nix-channel
103− --add</literal> as a non root user (or without sudo) will not affect
104− configuration in <literal>/etc/nixos/configuration.nix</literal>
64+ Channels are set per user. This means that running <literal> nix-channel --add</literal> as a non root user (or without sudo) will not affect configuration in <literal>/etc/nixos/configuration.nix</literal>
10565 </para>
10666 </note>
10767 <warning>
10868 <para>
109− It is generally safe to switch back and forth between channels. The only
110− exception is that a newer NixOS may also have a newer Nix version, which may
111− involve an upgrade of Nix’s database schema. This cannot be undone easily,
112− so in that case you will not be able to go back to your original channel.
69+ It is generally safe to switch back and forth between channels. The only exception is that a newer NixOS may also have a newer Nix version, which may involve an upgrade of Nix’s database schema. This cannot be undone easily, so in that case you will not be able to go back to your original channel.
11370 </para>
11471 </warning>
11572 <section xml:id="sec-upgrading-automatic">
11673 <title>Automatic Upgrades</title>
11774
11875 <para>
119− You can keep a NixOS system up-to-date automatically by adding the following
120− to <filename>configuration.nix</filename>:
76+ You can keep a NixOS system up-to-date automatically by adding the following to <filename>configuration.nix</filename>:
12177<programlisting>
12278<xref linkend="opt-system.autoUpgrade.enable"/> = true;
12379</programlisting>
124− This enables a periodically executed systemd service named
125− <literal>nixos-upgrade.service</literal>. It runs <command>nixos-rebuild
126− switch --upgrade</command> to upgrade NixOS to the latest version in the
127− current channel. (To see when the service runs, see <command>systemctl
128− list-timers</command>.) You can also specify a channel explicitly, e.g.
80+ This enables a periodically executed systemd service named <literal>nixos-upgrade.service</literal>. It runs <command>nixos-rebuild switch --upgrade</command> to upgrade NixOS to the latest version in the current channel. (To see when the service runs, see <command>systemctl list-timers</command>.) You can also specify a channel explicitly, e.g.
12981<programlisting>
13082<xref linkend="opt-system.autoUpgrade.channel"/> = https://nixos.org/channels/nixos-19.03;
13183</programlisting>
nixos/doc/manual/man-configuration.xml+1−4
@@ -14,10 +14,7 @@
1414 <refsection>
1515 <title>Description</title>
1616 <para>
17− The file <filename>/etc/nixos/configuration.nix</filename> contains the
18− declarative specification of your NixOS system configuration. The command
19− <command>nixos-rebuild</command> takes this file and realises the system
20− configuration specified therein.
17+ The file <filename>/etc/nixos/configuration.nix</filename> contains the declarative specification of your NixOS system configuration. The command <command>nixos-rebuild</command> takes this file and realises the system configuration specified therein.
2118 </para>
2219 </refsection>
2320 <refsection>
nixos/doc/manual/man-nixos-build-vms.xml+12−29
@@ -24,14 +24,12 @@
2424
2525 <arg>
2626 <option>--help</option>
27− </arg>
28−
29− <arg>
30− <option>--option</option>
31− <replaceable>name</replaceable>
32− <replaceable>value</replaceable>
33− </arg>
34−
27+ </arg>
28+
29+ <arg>
30+ <option>--option</option> <replaceable>name</replaceable> <replaceable>value</replaceable>
31+ </arg>
32+
3533 <arg choice="plain">
3634 <replaceable>network.nix</replaceable>
3735 </arg>
@@ -40,11 +38,7 @@
4038 <refsection>
4139 <title>Description</title>
4240 <para>
43− This command builds a network of QEMU-KVM virtual machines of a Nix
44− expression specifying a network of NixOS machines. The virtual network can
45− be started by executing the <filename>bin/run-vms</filename> shell script
46− that is generated by this command. By default, a <filename>result</filename>
47− symlink is produced that points to the generated virtual network.
41+ This command builds a network of QEMU-KVM virtual machines of a Nix expression specifying a network of NixOS machines. The virtual network can be started by executing the <filename>bin/run-vms</filename> shell script that is generated by this command. By default, a <filename>result</filename> symlink is produced that points to the generated virtual network.
4842 </para>
4943 <para>
5044 A network Nix expression has the following structure:
@@ -71,18 +65,7 @@
7165 };
7266}
7367</screen>
74− Each attribute in the expression represents a machine in the network (e.g.
75− <varname>test1</varname> and <varname>test2</varname>) referring to a
76− function defining a NixOS configuration. In each NixOS configuration, two
77− attributes have a special meaning. The
78− <varname>deployment.targetHost</varname> specifies the address (domain name
79− or IP address) of the system which is used by <command>ssh</command> to
80− perform remote deployment operations. The
81− <varname>nixpkgs.localSystem.system</varname> attribute can be used to
82− specify an architecture for the target machine, such as
83− <varname>i686-linux</varname> which builds a 32-bit NixOS configuration.
84− Omitting this property will build the configuration for the same
85− architecture as the host system.
68+ Each attribute in the expression represents a machine in the network (e.g. <varname>test1</varname> and <varname>test2</varname>) referring to a function defining a NixOS configuration. In each NixOS configuration, two attributes have a special meaning. The <varname>deployment.targetHost</varname> specifies the address (domain name or IP address) of the system which is used by <command>ssh</command> to perform remote deployment operations. The <varname>nixpkgs.localSystem.system</varname> attribute can be used to specify an architecture for the target machine, such as <varname>i686-linux</varname> which builds a 32-bit NixOS configuration. Omitting this property will build the configuration for the same architecture as the host system.
8669 </para>
8770 </refsection>
8871 <refsection>
@@ -126,10 +109,10 @@
126109 <option>--option</option> <replaceable>name</replaceable> <replaceable>value</replaceable>
127110 </term>
128111 <listitem>
129− <para>Set the Nix configuration option
130− <replaceable>name</replaceable> to <replaceable>value</replaceable>.
131− This overrides settings in the Nix configuration file (see
132− <citerefentry><refentrytitle>nix.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>).
112+ <para>
113+ Set the Nix configuration option <replaceable>name</replaceable> to <replaceable>value</replaceable>. This overrides settings in the Nix configuration file (see <citerefentry>
114+ <refentrytitle>nix.conf</refentrytitle>
115+ <manvolnum>5</manvolnum></citerefentry>).
133116 </para>
134117 </listitem>
135118 </varlistentry>
nixos/doc/manual/man-nixos-enter.xml+7−15
@@ -34,7 +34,7 @@
3434 </arg>
3535 <replaceable>shell-command</replaceable>
3636 </arg>
37−
37+
3838 <arg>
3939 <arg choice='plain'>
4040 <option>--silent</option>
@@ -58,9 +58,7 @@
5858 <refsection>
5959 <title>Description</title>
6060 <para>
61− This command runs a command in a NixOS chroot environment, that is, in a
62− filesystem hierarchy previously prepared using
63− <command>nixos-install</command>.
61+ This command runs a command in a NixOS chroot environment, that is, in a filesystem hierarchy previously prepared using <command>nixos-install</command>.
6462 </para>
6563 </refsection>
6664 <refsection>
@@ -75,8 +73,7 @@
7573 </term>
7674 <listitem>
7775 <para>
78− The path to the NixOS system you want to enter. It defaults to
79− <filename>/mnt</filename>.
76+ The path to the NixOS system you want to enter. It defaults to <filename>/mnt</filename>.
8077 </para>
8178 </listitem>
8279 </varlistentry>
@@ -86,10 +83,7 @@
8683 </term>
8784 <listitem>
8885 <para>
89− The NixOS system configuration to use. It defaults to
90− <filename>/nix/var/nix/profiles/system</filename>. You can enter a
91− previous NixOS configuration by specifying a path such as
92− <filename>/nix/var/nix/profiles/system-106-link</filename>.
86+ The NixOS system configuration to use. It defaults to <filename>/nix/var/nix/profiles/system</filename>. You can enter a previous NixOS configuration by specifying a path such as <filename>/nix/var/nix/profiles/system-106-link</filename>.
9387 </para>
9488 </listitem>
9589 </varlistentry>
@@ -112,7 +106,7 @@
112106 </term>
113107 <listitem>
114108 <para>
115− Suppresses all output from the activation script of the target system.
109+ Suppresses all output from the activation script of the target system.
116110 </para>
117111 </listitem>
118112 </varlistentry>
@@ -122,8 +116,7 @@
122116 </term>
123117 <listitem>
124118 <para>
125− Interpret the remaining arguments as the program name and arguments to be
126− invoked. The program is not executed in a shell.
119+ Interpret the remaining arguments as the program name and arguments to be invoked. The program is not executed in a shell.
127120 </para>
128121 </listitem>
129122 </varlistentry>
@@ -132,8 +125,7 @@
132125 <refsection>
133126 <title>Examples</title>
134127 <para>
135− Start an interactive shell in the NixOS installation in
136− <filename>/mnt</filename>:
128+ Start an interactive shell in the NixOS installation in <filename>/mnt</filename>:
137129 </para>
138130<screen>
139131# nixos-enter /mnt
nixos/doc/manual/man-nixos-generate-config.xml+15−49
@@ -13,18 +13,18 @@
1313 </refnamediv>
1414 <refsynopsisdiv>
1515 <cmdsynopsis>
16− <command>nixos-generate-config</command>
16+ <command>nixos-generate-config</command>
1717 <arg>
1818 <option>--force</option>
1919 </arg>
20−
20+
2121 <arg>
2222 <arg choice='plain'>
2323 <option>--root</option>
2424 </arg>
2525 <replaceable>root</replaceable>
2626 </arg>
27−
27+
2828 <arg>
2929 <arg choice='plain'>
3030 <option>--dir</option>
@@ -44,20 +44,10 @@
4444 </term>
4545 <listitem>
4646 <para>
47− This module sets NixOS configuration options based on your current
48− hardware configuration. In particular, it sets the
49− <option>fileSystem</option> option to reflect all currently mounted file
50− systems, the <option>swapDevices</option> option to reflect active swap
51− devices, and the <option>boot.initrd.*</option> options to ensure that
52− the initial ramdisk contains any kernel modules necessary for mounting
53− the root file system.
47+ This module sets NixOS configuration options based on your current hardware configuration. In particular, it sets the <option>fileSystem</option> option to reflect all currently mounted file systems, the <option>swapDevices</option> option to reflect active swap devices, and the <option>boot.initrd.*</option> options to ensure that the initial ramdisk contains any kernel modules necessary for mounting the root file system.
5448 </para>
5549 <para>
56− If this file already exists, it is overwritten. Thus, you should not
57− modify it manually. Rather, you should include it from your
58− <filename>/etc/nixos/configuration.nix</filename>, and re-run
59− <command>nixos-generate-config</command> to update it whenever your
60− hardware configuration changes.
50+ If this file already exists, it is overwritten. Thus, you should not modify it manually. Rather, you should include it from your <filename>/etc/nixos/configuration.nix</filename>, and re-run <command>nixos-generate-config</command> to update it whenever your hardware configuration changes.
6151 </para>
6252 </listitem>
6353 </varlistentry>
@@ -67,10 +57,7 @@
6757 </term>
6858 <listitem>
6959 <para>
70− This is the main NixOS system configuration module. If it already
71− exists, it’s left unchanged. Otherwise,
72− <command>nixos-generate-config</command> will write a template for you
73− to customise.
60+ This is the main NixOS system configuration module. If it already exists, it’s left unchanged. Otherwise, <command>nixos-generate-config</command> will write a template for you to customise.
7461 </para>
7562 </listitem>
7663 </varlistentry>
@@ -89,12 +76,7 @@
8976 </term>
9077 <listitem>
9178 <para>
92− If this option is given, treat the directory
93− <replaceable>root</replaceable> as the root of the file system. This
94− means that configuration files will be written to
95− <filename><replaceable>root</replaceable>/etc/nixos</filename>, and that
96− any file systems outside of <replaceable>root</replaceable> are ignored
97− for the purpose of generating the <option>fileSystems</option> option.
79+ If this option is given, treat the directory <replaceable>root</replaceable> as the root of the file system. This means that configuration files will be written to <filename><replaceable>root</replaceable>/etc/nixos</filename>, and that any file systems outside of <replaceable>root</replaceable> are ignored for the purpose of generating the <option>fileSystems</option> option.
9880 </para>
9981 </listitem>
10082 </varlistentry>
@@ -104,9 +86,7 @@
10486 </term>
10587 <listitem>
10688 <para>
107− If this option is given, write the configuration files to the directory
108− <replaceable>dir</replaceable> instead of
109− <filename>/etc/nixos</filename>.
89+ If this option is given, write the configuration files to the directory <replaceable>dir</replaceable> instead of <filename>/etc/nixos</filename>.
11090 </para>
11191 </listitem>
11292 </varlistentry>
@@ -116,8 +96,7 @@
11696 </term>
11797 <listitem>
11898 <para>
119− Overwrite <filename>/etc/nixos/configuration.nix</filename> if it already
120− exists.
99+ Overwrite <filename>/etc/nixos/configuration.nix</filename> if it already exists.
121100 </para>
122101 </listitem>
123102 </varlistentry>
@@ -127,8 +106,7 @@
127106 </term>
128107 <listitem>
129108 <para>
130− Omit everything concerning file systems and swap devices from the
131− hardware configuration.
109+ Omit everything concerning file systems and swap devices from the hardware configuration.
132110 </para>
133111 </listitem>
134112 </varlistentry>
@@ -138,9 +116,7 @@
138116 </term>
139117 <listitem>
140118 <para>
141− Don't generate <filename>configuration.nix</filename> or
142− <filename>hardware-configuration.nix</filename> and print the hardware
143− configuration to stdout only.
119+ Don't generate <filename>configuration.nix</filename> or <filename>hardware-configuration.nix</filename> and print the hardware configuration to stdout only.
144120 </para>
145121 </listitem>
146122 </varlistentry>
@@ -149,16 +125,11 @@
149125 <refsection>
150126 <title>Examples</title>
151127 <para>
152− This command is typically used during NixOS installation to write initial
153− configuration modules. For example, if you created and mounted the target
154− file systems on <filename>/mnt</filename> and
155− <filename>/mnt/boot</filename>, you would run:
128+ This command is typically used during NixOS installation to write initial configuration modules. For example, if you created and mounted the target file systems on <filename>/mnt</filename> and <filename>/mnt/boot</filename>, you would run:
156129<screen>
157130<prompt>$ </prompt>nixos-generate-config --root /mnt
158131</screen>
159− The resulting file
160− <filename>/mnt/etc/nixos/hardware-configuration.nix</filename> might look
161− like this:
132+ The resulting file <filename>/mnt/etc/nixos/hardware-configuration.nix</filename> might look like this:
162133<programlisting>
163134# Do not modify this file! It was generated by ‘nixos-generate-config’
164135# and may be overwritten by future invocations. Please make changes
@@ -193,10 +164,7 @@
193164 nix.maxJobs = 8;
194165}
195166</programlisting>
196− It will also create a basic
197− <filename>/mnt/etc/nixos/configuration.nix</filename>, which you should edit
198− to customise the logical configuration of your system. This file includes
199− the result of the hardware scan as follows:
167+ It will also create a basic <filename>/mnt/etc/nixos/configuration.nix</filename>, which you should edit to customise the logical configuration of your system. This file includes the result of the hardware scan as follows:
200168<programlisting>
201169 imports = [ ./hardware-configuration.nix ];
202170</programlisting>
@@ -206,9 +174,7 @@
206174<screen>
207175<prompt>$ </prompt>nixos-generate-config
208176</screen>
209− to update <filename>/etc/nixos/hardware-configuration.nix</filename>. Your
210− <filename>/etc/nixos/configuration.nix</filename> will
211− <emphasis>not</emphasis> be overwritten.
177+ to update <filename>/etc/nixos/hardware-configuration.nix</filename>. Your <filename>/etc/nixos/configuration.nix</filename> will <emphasis>not</emphasis> be overwritten.
212178 </para>
213179 </refsection>
214180</refentry>
nixos/doc/manual/man-nixos-install.xml+28−67
@@ -13,72 +13,72 @@
1313 </refnamediv>
1414 <refsynopsisdiv>
1515 <cmdsynopsis>
16− <command>nixos-install</command>
16+ <command>nixos-install</command>
1717 <arg>
1818 <arg choice='plain'>
1919 <option>-I</option>
2020 </arg>
2121 <replaceable>path</replaceable>
2222 </arg>
23−
23+
2424 <arg>
2525 <arg choice='plain'>
2626 <option>--root</option>
2727 </arg>
2828 <replaceable>root</replaceable>
2929 </arg>
30−
30+
3131 <arg>
3232 <arg choice='plain'>
3333 <option>--system</option>
3434 </arg>
3535 <replaceable>path</replaceable>
3636 </arg>
37−
37+
3838 <arg>
3939 <arg choice='plain'>
4040 <option>--no-channel-copy</option>
4141 </arg>
4242 </arg>
43−
43+
4444 <arg>
4545 <arg choice='plain'>
4646 <option>--no-root-passwd</option>
4747 </arg>
4848 </arg>
49−
49+
5050 <arg>
5151 <arg choice='plain'>
5252 <option>--no-bootloader</option>
5353 </arg>
5454 </arg>
55−
55+
5656 <arg>
57− <group choice='req'>
57+ <group choice='req'>
5858 <arg choice='plain'>
5959 <option>--max-jobs</option>
6060 </arg>
61−
61+
6262 <arg choice='plain'>
6363 <option>-j</option>
6464 </arg>
6565 </group> <replaceable>number</replaceable>
6666 </arg>
67−
67+
6868 <arg>
6969 <option>--cores</option> <replaceable>number</replaceable>
7070 </arg>
71−
71+
7272 <arg>
7373 <option>--option</option> <replaceable>name</replaceable> <replaceable>value</replaceable>
7474 </arg>
75−
75+
7676 <arg>
7777 <arg choice='plain'>
7878 <option>--show-trace</option>
7979 </arg>
8080 </arg>
81−
81+
8282 <arg>
8383 <arg choice='plain'>
8484 <option>--help</option>
@@ -89,43 +89,32 @@
8989 <refsection>
9090 <title>Description</title>
9191 <para>
92− This command installs NixOS in the file system mounted on
93− <filename>/mnt</filename>, based on the NixOS configuration specified in
94− <filename>/mnt/etc/nixos/configuration.nix</filename>. It performs the
95− following steps:
92+ This command installs NixOS in the file system mounted on <filename>/mnt</filename>, based on the NixOS configuration specified in <filename>/mnt/etc/nixos/configuration.nix</filename>. It performs the following steps:
9693 <itemizedlist>
9794 <listitem>
9895 <para>
99− It copies Nix and its dependencies to
100− <filename>/mnt/nix/store</filename>.
96+ It copies Nix and its dependencies to <filename>/mnt/nix/store</filename>.
10197 </para>
10298 </listitem>
10399 <listitem>
104100 <para>
105− It runs Nix in <filename>/mnt</filename> to build the NixOS configuration
106− specified in <filename>/mnt/etc/nixos/configuration.nix</filename>.
101+ It runs Nix in <filename>/mnt</filename> to build the NixOS configuration specified in <filename>/mnt/etc/nixos/configuration.nix</filename>.
107102 </para>
108103 </listitem>
109104 <listitem>
110105 <para>
111− It installs the GRUB boot loader on the device specified in the option
112− <option>boot.loader.grub.device</option> (unless
113− <option>--no-bootloader</option> is specified), and generates a GRUB
114− configuration file that boots into the NixOS configuration just
115− installed.
106+ It installs the GRUB boot loader on the device specified in the option <option>boot.loader.grub.device</option> (unless <option>--no-bootloader</option> is specified), and generates a GRUB configuration file that boots into the NixOS configuration just installed.
116107 </para>
117108 </listitem>
118109 <listitem>
119110 <para>
120− It prompts you for a password for the root account (unless
121− <option>--no-root-passwd</option> is specified).
111+ It prompts you for a password for the root account (unless <option>--no-root-passwd</option> is specified).
122112 </para>
123113 </listitem>
124114 </itemizedlist>
125115 </para>
126116 <para>
127− This command is idempotent: if it is interrupted or fails due to a temporary
128− problem (e.g. a network issue), you can safely re-run it.
117+ This command is idempotent: if it is interrupted or fails due to a temporary problem (e.g. a network issue), you can safely re-run it.
129118 </para>
130119 </refsection>
131120 <refsection>
@@ -140,9 +129,7 @@
140129 </term>
141130 <listitem>
142131 <para>
143− Defaults to <filename>/mnt</filename>. If this option is given, treat the
144− directory <replaceable>root</replaceable> as the root of the NixOS
145− installation.
132+ Defaults to <filename>/mnt</filename>. If this option is given, treat the directory <replaceable>root</replaceable> as the root of the NixOS installation.
146133 </para>
147134 </listitem>
148135 </varlistentry>
@@ -152,16 +139,10 @@
152139 </term>
153140 <listitem>
154141 <para>
155− If this option is provided, <command>nixos-install</command> will install
156− the specified closure rather than attempt to build one from
157− <filename>/mnt/etc/nixos/configuration.nix</filename>.
142+ If this option is provided, <command>nixos-install</command> will install the specified closure rather than attempt to build one from <filename>/mnt/etc/nixos/configuration.nix</filename>.
158143 </para>
159144 <para>
160− The closure must be an appropriately configured NixOS system, with boot
161− loader and partition configuration that fits the target host. Such a
162− closure is typically obtained with a command such as <command>nix-build
163− -I nixos-config=./configuration.nix '&lt;nixos&gt;' -A system
164− --no-out-link</command>
145+ The closure must be an appropriately configured NixOS system, with boot loader and partition configuration that fits the target host. Such a closure is typically obtained with a command such as <command>nix-build -I nixos-config=./configuration.nix '&lt;nixos&gt;' -A system --no-out-link</command>
165146 </para>
166147 </listitem>
167148 </varlistentry>
@@ -171,10 +152,7 @@
171152 </term>
172153 <listitem>
173154 <para>
174− Add a path to the Nix expression search path. This option may be given
175− multiple times. See the NIX_PATH environment variable for information on
176− the semantics of the Nix search path. Paths added through
177− <replaceable>-I</replaceable> take precedence over NIX_PATH.
155+ Add a path to the Nix expression search path. This option may be given multiple times. See the NIX_PATH environment variable for information on the semantics of the Nix search path. Paths added through <replaceable>-I</replaceable> take precedence over NIX_PATH.
178156 </para>
179157 </listitem>
180158 </varlistentry>
@@ -187,9 +165,7 @@
187165 </term>
188166 <listitem>
189167 <para>
190− Sets the maximum number of build jobs that Nix will perform in parallel
191− to the specified number. The default is <literal>1</literal>. A higher
192− value is useful on SMP systems or to exploit I/O latency.
168+ Sets the maximum number of build jobs that Nix will perform in parallel to the specified number. The default is <literal>1</literal>. A higher value is useful on SMP systems or to exploit I/O latency.
193169 </para>
194170 </listitem>
195171 </varlistentry>
@@ -199,15 +175,7 @@
199175 </term>
200176 <listitem>
201177 <para>
202− Sets the value of the <envar>NIX_BUILD_CORES</envar> environment variable
203− in the invocation of builders. Builders can use this variable at their
204− discretion to control the maximum amount of parallelism. For instance, in
205− Nixpkgs, if the derivation attribute
206− <varname>enableParallelBuilding</varname> is set to
207− <literal>true</literal>, the builder passes the
208− <option>-j<replaceable>N</replaceable></option> flag to GNU Make. The
209− value <literal>0</literal> means that the builder should use all
210− available CPU cores in the system.
178+ Sets the value of the <envar>NIX_BUILD_CORES</envar> environment variable in the invocation of builders. Builders can use this variable at their discretion to control the maximum amount of parallelism. For instance, in Nixpkgs, if the derivation attribute <varname>enableParallelBuilding</varname> is set to <literal>true</literal>, the builder passes the <option>-j<replaceable>N</replaceable></option> flag to GNU Make. The value <literal>0</literal> means that the builder should use all available CPU cores in the system.
211179 </para>
212180 </listitem>
213181 </varlistentry>
@@ -217,8 +185,7 @@
217185 </term>
218186 <listitem>
219187 <para>
220− Set the Nix configuration option <replaceable>name</replaceable> to
221− <replaceable>value</replaceable>.
188+ Set the Nix configuration option <replaceable>name</replaceable> to <replaceable>value</replaceable>.
222189 </para>
223190 </listitem>
224191 </varlistentry>
@@ -228,8 +195,7 @@
228195 </term>
229196 <listitem>
230197 <para>
231− Causes Nix to print out a stack trace in case of Nix expression
232− evaluation errors.
198+ Causes Nix to print out a stack trace in case of Nix expression evaluation errors.
233199 </para>
234200 </listitem>
235201 </varlistentry>
@@ -248,12 +214,7 @@
248214 <refsection>
249215 <title>Examples</title>
250216 <para>
251− A typical NixOS installation is done by creating and mounting a file system
252− on <filename>/mnt</filename>, generating a NixOS configuration in
253− <filename>/mnt/etc/nixos/configuration.nix</filename>, and running
254− <command>nixos-install</command>. For instance, if we want to install NixOS
255− on an <literal>ext4</literal> file system created in
256− <filename>/dev/sda1</filename>:
217+ A typical NixOS installation is done by creating and mounting a file system on <filename>/mnt</filename>, generating a NixOS configuration in <filename>/mnt/etc/nixos/configuration.nix</filename>, and running <command>nixos-install</command>. For instance, if we want to install NixOS on an <literal>ext4</literal> file system created in <filename>/dev/sda1</filename>:
257218<screen>
258219<prompt>$ </prompt>mkfs.ext4 /dev/sda1
259220<prompt>$ </prompt>mount /dev/sda1 /mnt
nixos/doc/manual/man-nixos-option.xml+10−17
@@ -13,19 +13,19 @@
1313 </refnamediv>
1414 <refsynopsisdiv>
1515 <cmdsynopsis>
16− <command>nixos-option</command>
16+ <command>nixos-option</command>
1717 <arg>
1818 <option>-I</option> <replaceable>path</replaceable>
1919 </arg>
20−
20+
2121 <arg>
2222 <option>--verbose</option>
2323 </arg>
24−
24+
2525 <arg>
2626 <option>--xml</option>
2727 </arg>
28−
28+
2929 <arg choice="plain">
3030 <replaceable>option.name</replaceable>
3131 </arg>
@@ -34,13 +34,10 @@
3434 <refsection>
3535 <title>Description</title>
3636 <para>
37− This command evaluates the configuration specified in
38− <filename>/etc/nixos/configuration.nix</filename> and returns the properties
39− of the option name given as argument.
37+ This command evaluates the configuration specified in <filename>/etc/nixos/configuration.nix</filename> and returns the properties of the option name given as argument.
4038 </para>
4139 <para>
42− When the option name is not an option, the command prints the list of
43− attributes contained in the attribute set.
40+ When the option name is not an option, the command prints the list of attributes contained in the attribute set.
4441 </para>
4542 </refsection>
4643 <refsection>
@@ -55,8 +52,7 @@
5552 </term>
5653 <listitem>
5754 <para>
58− This option is passed to the underlying
59− <command>nix-instantiate</command> invocation.
55+ This option is passed to the underlying <command>nix-instantiate</command> invocation.
6056 </para>
6157 </listitem>
6258 </varlistentry>
@@ -66,8 +62,7 @@
6662 </term>
6763 <listitem>
6864 <para>
69− This option enables verbose mode, which currently is just the Bash
70− <command>set</command> <option>-x</option> debug mode.
65+ This option enables verbose mode, which currently is just the Bash <command>set</command> <option>-x</option> debug mode.
7166 </para>
7267 </listitem>
7368 </varlistentry>
@@ -92,8 +87,7 @@
9287 </term>
9388 <listitem>
9489 <para>
95− Path to the main NixOS configuration module. Defaults to
96− <filename>/etc/nixos/configuration.nix</filename>.
90+ Path to the main NixOS configuration module. Defaults to <filename>/etc/nixos/configuration.nix</filename>.
9791 </para>
9892 </listitem>
9993 </varlistentry>
@@ -130,8 +124,7 @@ Defined by:
130124 <refsection>
131125 <title>Bugs</title>
132126 <para>
133− The author listed in the following section is wrong. If there is any other
134− bug, please report to Nicolas Pierron.
127+ The author listed in the following section is wrong. If there is any other bug, please report to Nicolas Pierron.
135128 </para>
136129 </refsection>
137130</refentry>
nixos/doc/manual/man-nixos-rebuild.xml+90−219
@@ -7,47 +7,45 @@
77 <refmiscinfo class="source">NixOS</refmiscinfo>
88<!-- <refmiscinfo class="version"><xi:include href="version.txt" parse="text"/></refmiscinfo> -->
99 </refmeta>
10−
1110 <refnamediv>
1211 <refname><command>nixos-rebuild</command>
1312 </refname><refpurpose>reconfigure a NixOS machine</refpurpose>
1413 </refnamediv>
15−
1614 <refsynopsisdiv>
1715 <cmdsynopsis>
18− <command>nixos-rebuild</command><group choice='req'>
16+ <command>nixos-rebuild</command><group choice='req'>
1917 <arg choice='plain'>
2018 <option>switch</option>
2119 </arg>
22−
20+
2321 <arg choice='plain'>
2422 <option>boot</option>
2523 </arg>
26−
24+
2725 <arg choice='plain'>
2826 <option>test</option>
2927 </arg>
30−
28+
3129 <arg choice='plain'>
3230 <option>build</option>
3331 </arg>
34−
32+
3533 <arg choice='plain'>
3634 <option>dry-build</option>
3735 </arg>
38−
36+
3937 <arg choice='plain'>
4038 <option>dry-activate</option>
4139 </arg>
42−
40+
4341 <arg choice='plain'>
4442 <option>edit</option>
4543 </arg>
46−
44+
4745 <arg choice='plain'>
4846 <option>build-vm</option>
4947 </arg>
50−
48+
5149 <arg choice='plain'>
5250 <option>build-vm-with-bootloader</option>
5351 </arg>
@@ -56,34 +54,33 @@
5654 <arg>
5755 <option>--upgrade</option>
5856 </arg>
59−
57+
6058 <arg>
6159 <option>--install-bootloader</option>
6260 </arg>
63−
61+
6462 <arg>
6563 <option>--no-build-nix</option>
6664 </arg>
67−
65+
6866 <arg>
6967 <option>--fast</option>
7068 </arg>
71−
69+
7270 <arg>
7371 <option>--rollback</option>
7472 </arg>
75−
73+
7674 <arg>
7775 <option>--builders</option> <replaceable>builder-spec</replaceable>
7876 </arg>
79−
8077 <sbr />
8178 <arg>
82− <group choice='req'>
79+ <group choice='req'>
8380 <arg choice='plain'>
8481 <option>--profile-name</option>
8582 </arg>
86−
83+
8784 <arg choice='plain'>
8885 <option>-p</option>
8986 </arg>
@@ -93,56 +90,67 @@
9390 <arg>
9491 <option>--show-trace</option>
9592 </arg>
93+
9694 <arg>
97− <option>-I</option>
98− <replaceable>path</replaceable>
95+ <option>-I</option> <replaceable>path</replaceable>
9996 </arg>
97+
10098 <arg>
101− <group choice='req'>
102− <arg choice='plain'><option>--verbose</option></arg>
103− <arg choice='plain'><option>-v</option></arg>
104− </group>
99+ <group choice='req'>
100+ <arg choice='plain'>
101+ <option>--verbose</option>
102+ </arg>
103+
104+ <arg choice='plain'>
105+ <option>-v</option>
106+ </arg>
107+ </group>
105108 </arg>
109+
106110 <arg>
107− <group choice='req'>
108− <arg choice='plain'><option>--max-jobs</option></arg>
109− <arg choice='plain'><option>-j</option></arg>
110− </group>
111− <replaceable>number</replaceable>
111+ <group choice='req'>
112+ <arg choice='plain'>
113+ <option>--max-jobs</option>
114+ </arg>
115+
116+ <arg choice='plain'>
117+ <option>-j</option>
118+ </arg>
119+ </group> <replaceable>number</replaceable>
112120 </arg>
121+
113122 <arg>
114− <group choice='req'>
115− <arg choice='plain'><option>--keep-failed</option></arg>
116− <arg choice='plain'><option>-K</option></arg>
117− </group>
123+ <group choice='req'>
124+ <arg choice='plain'>
125+ <option>--keep-failed</option>
126+ </arg>
127+
128+ <arg choice='plain'>
129+ <option>-K</option>
130+ </arg>
131+ </group>
118132 </arg>
133+
119134 <arg>
120− <group choice='req'>
121− <arg choice='plain'><option>--keep-going</option></arg>
122− <arg choice='plain'><option>-k</option></arg>
123− </group>
135+ <group choice='req'>
136+ <arg choice='plain'>
137+ <option>--keep-going</option>
138+ </arg>
139+
140+ <arg choice='plain'>
141+ <option>-k</option>
142+ </arg>
143+ </group>
124144 </arg>
125145 </cmdsynopsis>
126146 </refsynopsisdiv>
127−
128147 <refsection>
129148 <title>Description</title>
130−
131149 <para>
132− This command updates the system so that it corresponds to the configuration
133− specified in <filename>/etc/nixos/configuration.nix</filename>. Thus, every
134− time you modify <filename>/etc/nixos/configuration.nix</filename> or any
135− NixOS module, you must run <command>nixos-rebuild</command> to make the
136− changes take effect. It builds the new system in
137− <filename>/nix/store</filename>, runs its activation script, and stop and
138− (re)starts any system services if needed. Please note that user services need
139− to be started manually as they aren't detected by the activation script at the moment.
150+ This command updates the system so that it corresponds to the configuration specified in <filename>/etc/nixos/configuration.nix</filename>. Thus, every time you modify <filename>/etc/nixos/configuration.nix</filename> or any NixOS module, you must run <command>nixos-rebuild</command> to make the changes take effect. It builds the new system in <filename>/nix/store</filename>, runs its activation script, and stop and (re)starts any system services if needed. Please note that user services need to be started manually as they aren't detected by the activation script at the moment.
140151 </para>
141−
142152 <para>
143− This command has one required argument, which specifies the desired
144− operation. It must be one of the following:
145−
153+ This command has one required argument, which specifies the desired operation. It must be one of the following:
146154 <variablelist>
147155 <varlistentry>
148156 <term>
@@ -150,91 +158,64 @@
150158 </term>
151159 <listitem>
152160 <para>
153− Build and activate the new configuration, and make it the boot default.
154− That is, the configuration is added to the GRUB boot menu as the default
155− menu entry, so that subsequent reboots will boot the system into the new
156− configuration. Previous configurations activated with
157− <command>nixos-rebuild switch</command> or <command>nixos-rebuild
158− boot</command> remain available in the GRUB menu.
161+ Build and activate the new configuration, and make it the boot default. That is, the configuration is added to the GRUB boot menu as the default menu entry, so that subsequent reboots will boot the system into the new configuration. Previous configurations activated with <command>nixos-rebuild switch</command> or <command>nixos-rebuild boot</command> remain available in the GRUB menu.
159162 </para>
160163 </listitem>
161164 </varlistentry>
162−
163165 <varlistentry>
164166 <term>
165167 <option>boot</option>
166168 </term>
167169 <listitem>
168170 <para>
169− Build the new configuration and make it the boot default (as with
170− <command>nixos-rebuild switch</command>), but do not activate it. That
171− is, the system continues to run the previous configuration until the
172− next reboot.
171+ Build the new configuration and make it the boot default (as with <command>nixos-rebuild switch</command>), but do not activate it. That is, the system continues to run the previous configuration until the next reboot.
173172 </para>
174173 </listitem>
175174 </varlistentry>
176−
177175 <varlistentry>
178176 <term>
179177 <option>test</option>
180178 </term>
181179 <listitem>
182180 <para>
183− Build and activate the new configuration, but do not add it to the GRUB
184− boot menu. Thus, if you reboot the system (or if it crashes), you will
185− automatically revert to the default configuration (i.e. the
186− configuration resulting from the last call to <command>nixos-rebuild
187− switch</command> or <command>nixos-rebuild boot</command>).
181+ Build and activate the new configuration, but do not add it to the GRUB boot menu. Thus, if you reboot the system (or if it crashes), you will automatically revert to the default configuration (i.e. the configuration resulting from the last call to <command>nixos-rebuild switch</command> or <command>nixos-rebuild boot</command>).
188182 </para>
189183 </listitem>
190184 </varlistentry>
191−
192185 <varlistentry>
193186 <term>
194187 <option>build</option>
195188 </term>
196189 <listitem>
197190 <para>
198− Build the new configuration, but neither activate it nor add it to the
199− GRUB boot menu. It leaves a symlink named <filename>result</filename> in
200− the current directory, which points to the output of the top-level
201− “system” derivation. This is essentially the same as doing
191+ Build the new configuration, but neither activate it nor add it to the GRUB boot menu. It leaves a symlink named <filename>result</filename> in the current directory, which points to the output of the top-level “system” derivation. This is essentially the same as doing
202192<screen>
203193<prompt>$ </prompt>nix-build /path/to/nixpkgs/nixos -A system
204194</screen>
205− Note that you do not need to be <literal>root</literal> to run
206− <command>nixos-rebuild build</command>.
195+ Note that you do not need to be <literal>root</literal> to run <command>nixos-rebuild build</command>.
207196 </para>
208197 </listitem>
209198 </varlistentry>
210−
211199 <varlistentry>
212200 <term>
213201 <option>dry-build</option>
214202 </term>
215203 <listitem>
216204 <para>
217− Show what store paths would be built or downloaded by any of the
218− operations above, but otherwise do nothing.
205+ Show what store paths would be built or downloaded by any of the operations above, but otherwise do nothing.
219206 </para>
220207 </listitem>
221208 </varlistentry>
222−
223209 <varlistentry>
224210 <term>
225211 <option>dry-activate</option>
226212 </term>
227213 <listitem>
228214 <para>
229− Build the new configuration, but instead of activating it, show what
230− changes would be performed by the activation (i.e. by
231− <command>nixos-rebuild test</command>). For instance, this command will
232− print which systemd units would be restarted. The list of changes is not
233− guaranteed to be complete.
215+ Build the new configuration, but instead of activating it, show what changes would be performed by the activation (i.e. by <command>nixos-rebuild test</command>). For instance, this command will print which systemd units would be restarted. The list of changes is not guaranteed to be complete.
234216 </para>
235217 </listitem>
236218 </varlistentry>
237−
238219 <varlistentry>
239220 <term>
240221 <option>edit</option>
@@ -245,80 +226,49 @@
245226 </para>
246227 </listitem>
247228 </varlistentry>
248−
249229 <varlistentry>
250230 <term>
251231 <option>build-vm</option>
252232 </term>
253233 <listitem>
254234 <para>
255− Build a script that starts a NixOS virtual machine with the desired
256− configuration. It leaves a symlink <filename>result</filename> in the
257− current directory that points (under
258− <filename>result/bin/run-<replaceable>hostname</replaceable>-vm</filename>)
259− at the script that starts the VM. Thus, to test a NixOS configuration in
260− a virtual machine, you should do the following:
235+ Build a script that starts a NixOS virtual machine with the desired configuration. It leaves a symlink <filename>result</filename> in the current directory that points (under <filename>result/bin/run-<replaceable>hostname</replaceable>-vm</filename>) at the script that starts the VM. Thus, to test a NixOS configuration in a virtual machine, you should do the following:
261236<screen>
262237<prompt>$ </prompt>nixos-rebuild build-vm
263238<prompt>$ </prompt>./result/bin/run-*-vm
264239</screen>
265240 </para>
266−
267241 <para>
268− The VM is implemented using the <literal>qemu</literal> package. For
269− best performance, you should load the <literal>kvm-intel</literal> or
270− <literal>kvm-amd</literal> kernel modules to get hardware
271− virtualisation.
242+ The VM is implemented using the <literal>qemu</literal> package. For best performance, you should load the <literal>kvm-intel</literal> or <literal>kvm-amd</literal> kernel modules to get hardware virtualisation.
272243 </para>
273−
274244 <para>
275− The VM mounts the Nix store of the host through the 9P file system. The
276− host Nix store is read-only, so Nix commands that modify the Nix store
277− will not work in the VM. This includes commands such as
278− <command>nixos-rebuild</command>; to change the VM’s configuration,
279− you must halt the VM and re-run the commands above.
245+ The VM mounts the Nix store of the host through the 9P file system. The host Nix store is read-only, so Nix commands that modify the Nix store will not work in the VM. This includes commands such as <command>nixos-rebuild</command>; to change the VM’s configuration, you must halt the VM and re-run the commands above.
280246 </para>
281−
282247 <para>
283− The VM has its own <literal>ext3</literal> root file system, which is
284− automatically created when the VM is first started, and is persistent
285− across reboots of the VM. It is stored in
286− <literal>./<replaceable>hostname</replaceable>.qcow2</literal>.
248+ The VM has its own <literal>ext3</literal> root file system, which is automatically created when the VM is first started, and is persistent across reboots of the VM. It is stored in <literal>./<replaceable>hostname</replaceable>.qcow2</literal>.
287249<!-- The entire file system hierarchy of the host is available in
288250 the VM under <filename>/hostfs</filename>.-->
289251 </para>
290252 </listitem>
291253 </varlistentry>
292−
293254 <varlistentry>
294255 <term>
295256 <option>build-vm-with-bootloader</option>
296257 </term>
297258 <listitem>
298259 <para>
299− Like <option>build-vm</option>, but boots using the regular boot loader
300− of your configuration (e.g., GRUB 1 or 2), rather than booting directly
301− into the kernel and initial ramdisk of the system. This allows you to
302− test whether the boot loader works correctly. However, it does not
303− guarantee that your NixOS configuration will boot successfully on the
304− host hardware (i.e., after running <command>nixos-rebuild
305− switch</command>), because the hardware and boot loader configuration in
306− the VM are different. The boot loader is installed on an automatically
307− generated virtual disk containing a <filename>/boot</filename>
308− partition, which is mounted read-only in the VM.
260+ Like <option>build-vm</option>, but boots using the regular boot loader of your configuration (e.g., GRUB 1 or 2), rather than booting directly into the kernel and initial ramdisk of the system. This allows you to test whether the boot loader works correctly. However, it does not guarantee that your NixOS configuration will boot successfully on the host hardware (i.e., after running <command>nixos-rebuild switch</command>), because the hardware and boot loader configuration in the VM are different. The boot loader is installed on an automatically generated virtual disk containing a <filename>/boot</filename> partition, which is mounted read-only in the VM.
309261 </para>
310262 </listitem>
311263 </varlistentry>
312264 </variablelist>
313265 </para>
314266 </refsection>
315−
316267 <refsection>
317268 <title>Options</title>
318269 <para>
319270 This command accepts the following options:
320271 </para>
321−
322272 <variablelist>
323273 <varlistentry>
324274 <term>
@@ -330,84 +280,56 @@
330280 </para>
331281 </listitem>
332282 </varlistentry>
333−
334283 <varlistentry>
335284 <term>
336285 <option>--install-bootloader</option>
337286 </term>
338287 <listitem>
339288 <para>
340− Causes the boot loader to be (re)installed on the device specified by the
341− relevant configuration options.
289+ Causes the boot loader to be (re)installed on the device specified by the relevant configuration options.
342290 </para>
343291 </listitem>
344292 </varlistentry>
345−
346293 <varlistentry>
347294 <term>
348295 <option>--no-build-nix</option>
349296 </term>
350297 <listitem>
351298 <para>
352− Normally, <command>nixos-rebuild</command> first builds the
353− <varname>nixUnstable</varname> attribute in Nixpkgs, and uses the
354− resulting instance of the Nix package manager to build the new system
355− configuration. This is necessary if the NixOS modules use features not
356− provided by the currently installed version of Nix. This option disables
357− building a new Nix.
299+ Normally, <command>nixos-rebuild</command> first builds the <varname>nixUnstable</varname> attribute in Nixpkgs, and uses the resulting instance of the Nix package manager to build the new system configuration. This is necessary if the NixOS modules use features not provided by the currently installed version of Nix. This option disables building a new Nix.
358300 </para>
359301 </listitem>
360302 </varlistentry>
361−
362303 <varlistentry>
363304 <term>
364305 <option>--fast</option>
365306 </term>
366307 <listitem>
367308 <para>
368− Equivalent to <option>--no-build-nix</option>
369− <option>--show-trace</option>. This option is useful if you call
370− <command>nixos-rebuild</command> frequently (e.g. if you’re hacking on
371− a NixOS module).
309+ Equivalent to <option>--no-build-nix</option> <option>--show-trace</option>. This option is useful if you call <command>nixos-rebuild</command> frequently (e.g. if you’re hacking on a NixOS module).
372310 </para>
373311 </listitem>
374312 </varlistentry>
375−
376313 <varlistentry>
377314 <term>
378315 <option>--rollback</option>
379316 </term>
380317 <listitem>
381318 <para>
382− Instead of building a new configuration as specified by
383− <filename>/etc/nixos/configuration.nix</filename>, roll back to the
384− previous configuration. (The previous configuration is defined as the one
385− before the “current” generation of the Nix profile
386− <filename>/nix/var/nix/profiles/system</filename>.)
319+ Instead of building a new configuration as specified by <filename>/etc/nixos/configuration.nix</filename>, roll back to the previous configuration. (The previous configuration is defined as the one before the “current” generation of the Nix profile <filename>/nix/var/nix/profiles/system</filename>.)
387320 </para>
388321 </listitem>
389322 </varlistentry>
390−
391323 <varlistentry>
392324 <term>
393325 <option>--builders</option> <replaceable>builder-spec</replaceable>
394326 </term>
395327 <listitem>
396328 <para>
397− Allow ad-hoc remote builders for building the new system. This requires
398− the user executing <command>nixos-rebuild</command> (usually root) to be
399− configured as a trusted user in the Nix daemon. This can be achieved by
400− using the <literal>nix.trustedUsers</literal> NixOS option. Examples
401− values for that option are described in the <literal>Remote builds
402− chapter</literal> in the Nix manual, (i.e. <command>--builders
403− "ssh://bigbrother x86_64-linux"</command>). By specifying an empty string
404− existing builders specified in <filename>/etc/nix/machines</filename> can
405− be ignored: <command>--builders ""</command> for example when they are
406− not reachable due to network connectivity.
329+ Allow ad-hoc remote builders for building the new system. This requires the user executing <command>nixos-rebuild</command> (usually root) to be configured as a trusted user in the Nix daemon. This can be achieved by using the <literal>nix.trustedUsers</literal> NixOS option. Examples values for that option are described in the <literal>Remote builds chapter</literal> in the Nix manual, (i.e. <command>--builders "ssh://bigbrother x86_64-linux"</command>). By specifying an empty string existing builders specified in <filename>/etc/nix/machines</filename> can be ignored: <command>--builders ""</command> for example when they are not reachable due to network connectivity.
407330 </para>
408331 </listitem>
409332 </varlistentry>
410−
411333 <varlistentry>
412334 <term>
413335 <option>--profile-name</option>
@@ -417,97 +339,56 @@
417339 </term>
418340 <listitem>
419341 <para>
420− Instead of using the Nix profile
421− <filename>/nix/var/nix/profiles/system</filename> to keep track of the
422− current and previous system configurations, use
423− <filename>/nix/var/nix/profiles/system-profiles/<replaceable>name</replaceable></filename>.
424− When you use GRUB 2, for every system profile created with this flag,
425− NixOS will create a submenu named “NixOS - Profile
426− '<replaceable>name</replaceable>'” in GRUB’s boot menu, containing
427− the current and previous configurations of this profile.
342+ Instead of using the Nix profile <filename>/nix/var/nix/profiles/system</filename> to keep track of the current and previous system configurations, use <filename>/nix/var/nix/profiles/system-profiles/<replaceable>name</replaceable></filename>. When you use GRUB 2, for every system profile created with this flag, NixOS will create a submenu named “NixOS - Profile '<replaceable>name</replaceable>'” in GRUB’s boot menu, containing the current and previous configurations of this profile.
428343 </para>
429344 <para>
430− For instance, if you want to test a configuration file named
431− <filename>test.nix</filename> without affecting the default system
432− profile, you would do:
345+ For instance, if you want to test a configuration file named <filename>test.nix</filename> without affecting the default system profile, you would do:
433346<screen>
434347<prompt>$ </prompt>nixos-rebuild switch -p test -I nixos-config=./test.nix
435348</screen>
436− The new configuration will appear in the GRUB 2 submenu “NixOS -
437− Profile 'test'”.
349+ The new configuration will appear in the GRUB 2 submenu “NixOS - Profile 'test'”.
438350 </para>
439351 </listitem>
440352 </varlistentry>
441−
442353 <varlistentry>
443354 <term>
444355 <option>--build-host</option>
445356 </term>
446357 <listitem>
447358 <para>
448− Instead of building the new configuration locally, use the specified host
449− to perform the build. The host needs to be accessible with ssh, and must
450− be able to perform Nix builds. If the option
451− <option>--target-host</option> is not set, the build will be copied back
452− to the local machine when done.
359+ Instead of building the new configuration locally, use the specified host to perform the build. The host needs to be accessible with ssh, and must be able to perform Nix builds. If the option <option>--target-host</option> is not set, the build will be copied back to the local machine when done.
453360 </para>
454361 <para>
455− Note that, if <option>--no-build-nix</option> is not specified, Nix will
456− be built both locally and remotely. This is because the configuration
457− will always be evaluated locally even though the building might be
458− performed remotely.
362+ Note that, if <option>--no-build-nix</option> is not specified, Nix will be built both locally and remotely. This is because the configuration will always be evaluated locally even though the building might be performed remotely.
459363 </para>
460364 <para>
461− You can include a remote user name in the host name
462− (<replaceable>user@host</replaceable>). You can also set ssh options by
463− defining the <envar>NIX_SSHOPTS</envar> environment variable.
365+ You can include a remote user name in the host name (<replaceable>user@host</replaceable>). You can also set ssh options by defining the <envar>NIX_SSHOPTS</envar> environment variable.
464366 </para>
465367 </listitem>
466368 </varlistentry>
467−
468369 <varlistentry>
469370 <term>
470371 <option>--target-host</option>
471372 </term>
472373 <listitem>
473374 <para>
474− Specifies the NixOS target host. By setting this to something other than
475− <replaceable>localhost</replaceable>, the system activation will happen
476− on the remote host instead of the local machine. The remote host needs to
477− be accessible over ssh, and for the commands <option>switch</option>,
478− <option>boot</option> and <option>test</option> you need root access.
375+ Specifies the NixOS target host. By setting this to something other than <replaceable>localhost</replaceable>, the system activation will happen on the remote host instead of the local machine. The remote host needs to be accessible over ssh, and for the commands <option>switch</option>, <option>boot</option> and <option>test</option> you need root access.
479376 </para>
480−
481377 <para>
482− If <option>--build-host</option> is not explicitly specified,
483− <option>--build-host</option> will implicitly be set to the same value as
484− <option>--target-host</option>. So, if you only specify
485− <option>--target-host</option> both building and activation will take
486− place remotely (and no build artifacts will be copied to the local
487− machine).
378+ If <option>--build-host</option> is not explicitly specified, <option>--build-host</option> will implicitly be set to the same value as <option>--target-host</option>. So, if you only specify <option>--target-host</option> both building and activation will take place remotely (and no build artifacts will be copied to the local machine).
488379 </para>
489−
490380 <para>
491− You can include a remote user name in the host name
492− (<replaceable>user@host</replaceable>). You can also set ssh options by
493− defining the <envar>NIX_SSHOPTS</envar> environment variable.
381+ You can include a remote user name in the host name (<replaceable>user@host</replaceable>). You can also set ssh options by defining the <envar>NIX_SSHOPTS</envar> environment variable.
494382 </para>
495383 </listitem>
496384 </varlistentry>
497385 </variablelist>
498−
499386 <para>
500− In addition, <command>nixos-rebuild</command> accepts various Nix-related
501− flags, including <option>--max-jobs</option> / <option>-j</option>,
502− <option>--show-trace</option>, <option>--keep-failed</option>,
503− <option>--keep-going</option> and <option>--verbose</option> /
504− <option>-v</option>. See the Nix manual for details.
387+ In addition, <command>nixos-rebuild</command> accepts various Nix-related flags, including <option>--max-jobs</option> / <option>-j</option>, <option>--show-trace</option>, <option>--keep-failed</option>, <option>--keep-going</option> and <option>--verbose</option> / <option>-v</option>. See the Nix manual for details.
505388 </para>
506389 </refsection>
507−
508390 <refsection>
509391 <title>Environment</title>
510−
511392 <variablelist>
512393 <varlistentry>
513394 <term>
@@ -515,31 +396,25 @@
515396 </term>
516397 <listitem>
517398 <para>
518− Path to the main NixOS configuration module. Defaults to
519− <filename>/etc/nixos/configuration.nix</filename>.
399+ Path to the main NixOS configuration module. Defaults to <filename>/etc/nixos/configuration.nix</filename>.
520400 </para>
521401 </listitem>
522402 </varlistentry>
523−
524403 <varlistentry>
525404 <term>
526405 <envar>NIX_SSHOPTS</envar>
527406 </term>
528407 <listitem>
529408 <para>
530− Additional options to be passed to <command>ssh</command> on the command
531− line.
409+ Additional options to be passed to <command>ssh</command> on the command line.
532410 </para>
533411 </listitem>
534412 </varlistentry>
535413 </variablelist>
536414 </refsection>
537−
538415 <refsection>
539416 <title>Files</title>
540−
541417 <variablelist>
542−
543418 <varlistentry>
544419 <term>
545420 <filename>/run/current-system</filename>
@@ -550,22 +425,18 @@
550425 </para>
551426 </listitem>
552427 </varlistentry>
553−
554428 <varlistentry>
555429 <term>
556430 <filename>/nix/var/nix/profiles/system</filename>
557431 </term>
558432 <listitem>
559433 <para>
560− The Nix profile that contains the current and previous system
561− configurations. Used to generate the GRUB boot menu.
434+ The Nix profile that contains the current and previous system configurations. Used to generate the GRUB boot menu.
562435 </para>
563436 </listitem>
564437 </varlistentry>
565−
566438 </variablelist>
567439 </refsection>
568−
569440 <refsection>
570441 <title>Bugs</title>
571442 <para>
nixos/doc/manual/man-nixos-version.xml+6−17
@@ -25,8 +25,7 @@
2525 <refsection>
2626 <title>Description</title>
2727 <para>
28− This command shows the version of the currently active NixOS configuration.
29− For example:
28+ This command shows the version of the currently active NixOS configuration. For example:
3029<screen>$ nixos-version
313016.03.1011.6317da4 (Emu)
3231</screen>
@@ -38,8 +37,7 @@
3837 </term>
3938 <listitem>
4039 <para>
41− The NixOS release, indicating the year and month in which it was
42− released (e.g. March 2016).
40+ The NixOS release, indicating the year and month in which it was released (e.g. March 2016).
4341 </para>
4442 </listitem>
4543 </varlistentry>
@@ -49,12 +47,7 @@
4947 </term>
5048 <listitem>
5149 <para>
52− The number of commits in the Nixpkgs Git repository between the start of
53− the release branch and the commit from which this version was built.
54− This ensures that NixOS versions are monotonically increasing. It is
55− <literal>git</literal> when the current NixOS configuration was built
56− from a checkout of the Nixpkgs Git repository rather than from a NixOS
57− channel.
50+ The number of commits in the Nixpkgs Git repository between the start of the release branch and the commit from which this version was built. This ensures that NixOS versions are monotonically increasing. It is <literal>git</literal> when the current NixOS configuration was built from a checkout of the Nixpkgs Git repository rather than from a NixOS channel.
5851 </para>
5952 </listitem>
6053 </varlistentry>
@@ -64,8 +57,7 @@
6457 </term>
6558 <listitem>
6659 <para>
67− The first 7 characters of the commit in the Nixpkgs Git repository from
68− which this version was built.
60+ The first 7 characters of the commit in the Nixpkgs Git repository from which this version was built.
6961 </para>
7062 </listitem>
7163 </varlistentry>
@@ -75,9 +67,7 @@
7567 </term>
7668 <listitem>
7769 <para>
78− The code name of the NixOS release. The first letter of the code name
79− indicates that this is the N'th stable NixOS release; for example, Emu
80− is the fifth release.
70+ The code name of the NixOS release. The first letter of the code name indicates that this is the N'th stable NixOS release; for example, Emu is the fifth release.
8171 </para>
8272 </listitem>
8373 </varlistentry>
@@ -99,8 +89,7 @@
9989 </term>
10090 <listitem>
10191 <para>
102− Show the full SHA1 hash of the Git commit from which this configuration
103− was built, e.g.
92+ Show the full SHA1 hash of the Git commit from which this configuration was built, e.g.
10493<screen>$ nixos-version --hash
105946317da40006f6bc2480c6781999c52d88dde2acf
10695</screen>
nixos/doc/manual/manual.xml+6−15
@@ -11,26 +11,17 @@
1111 <preface xml:id="preface">
1212 <title>Preface</title>
1313 <para>
14− This manual describes how to install, use and extend NixOS, a Linux
15− distribution based on the purely functional package management system Nix.
14+ This manual describes how to install, use and extend NixOS, a Linux distribution based on the purely functional package management system Nix.
1615 </para>
1716 <para>
18− If you encounter problems, please report them on the
19− <literal
20− xlink:href="https://discourse.nixos.org">Discourse</literal> or
21− on the <link
22− xlink:href="irc://irc.freenode.net/#nixos">
23− <literal>#nixos</literal> channel on Freenode</link>. Bugs should be
24− reported in
25− <link
26− xlink:href="https://github.com/NixOS/nixpkgs/issues">NixOS’
27− GitHub issue tracker</link>.
17+ If you encounter problems, please report them on the <literal
18+ xlink:href="https://discourse.nixos.org">Discourse</literal> or on the <link
19+ xlink:href="irc://irc.freenode.net/#nixos"> <literal>#nixos</literal> channel on Freenode</link>. Bugs should be reported in <link
20+ xlink:href="https://github.com/NixOS/nixpkgs/issues">NixOS’ GitHub issue tracker</link>.
2821 </para>
2922 <note>
3023 <para>
31− Commands prefixed with <literal>#</literal> have to be run as root, either
32− requiring to login as root user or temporarily switching to it using
33− <literal>sudo</literal> for example.
24+ Commands prefixed with <literal>#</literal> have to be run as root, either requiring to login as root user or temporarily switching to it using <literal>sudo</literal> for example.
3425 </para>
3526 </note>
3627 </preface>
nixos/doc/manual/release-notes/release-notes.xml+1−2
@@ -5,8 +5,7 @@
55 xml:id="ch-release-notes">
66 <title>Release Notes</title>
77 <para>
8− This section lists the release notes for each stable version of NixOS and
9− current unstable revision.
8+ This section lists the release notes for each stable version of NixOS and current unstable revision.
109 </para>
1110 <xi:include href="rl-2003.xml" />
1211 <xi:include href="rl-1909.xml" />
nixos/doc/manual/release-notes/rl-1404.xml+17−66
@@ -6,23 +6,16 @@
66 <title>Release 14.04 (“Baboon”, 2014/04/30)</title>
77
88 <para>
9− This is the second stable release branch of NixOS. In addition to numerous
10− new and upgraded packages and modules, this release has the following
11− highlights:
9+ This is the second stable release branch of NixOS. In addition to numerous new and upgraded packages and modules, this release has the following highlights:
1210 <itemizedlist>
1311 <listitem>
1412 <para>
15− Installation on UEFI systems is now supported. See
16− <xref linkend="sec-installation"/> for details.
13+ Installation on UEFI systems is now supported. See <xref linkend="sec-installation"/> for details.
1714 </para>
1815 </listitem>
1916 <listitem>
2017 <para>
21− Systemd has been updated to version 212, which has
22− <link xlink:href="http://cgit.freedesktop.org/systemd/systemd/plain/NEWS?id=v212">numerous
23− improvements</link>. NixOS now automatically starts systemd user instances
24− when you log in. You can define global user units through the
25− <option>systemd.unit.*</option> options.
18+ Systemd has been updated to version 212, which has <link xlink:href="http://cgit.freedesktop.org/systemd/systemd/plain/NEWS?id=v212">numerous improvements</link>. NixOS now automatically starts systemd user instances when you log in. You can define global user units through the <option>systemd.unit.*</option> options.
2619 </para>
2720 </listitem>
2821 <listitem>
@@ -47,47 +40,28 @@
4740 </listitem>
4841 <listitem>
4942 <para>
50− Nix has been updated to 1.7
51− (<link
43+ Nix has been updated to 1.7 (<link
5244 xlink:href="http://nixos.org/nix/manual/#ssec-relnotes-1.7">details</link>).
5345 </para>
5446 </listitem>
5547 <listitem>
5648 <para>
57− NixOS now supports fully declarative management of users and groups. If
58− you set <option>users.mutableUsers</option> to <literal>false</literal>,
59− then the contents of <filename>/etc/passwd</filename> and
60− <filename>/etc/group</filename> will be
61− <link
62− xlink:href="https://www.usenix.org/legacy/event/lisa02/tech/full_papers/traugott/traugott_html/">congruent</link>
63− to your NixOS configuration. For instance, if you remove a user from
64− <option>users.extraUsers</option> and run
65− <command>nixos-rebuild</command>, the user account will cease to exist.
66− Also, imperative commands for managing users and groups, such as
67− <command>useradd</command>, are no longer available. If
68− <option>users.mutableUsers</option> is <literal>true</literal> (the
69− default), then behaviour is unchanged from NixOS 13.10.
49+ NixOS now supports fully declarative management of users and groups. If you set <option>users.mutableUsers</option> to <literal>false</literal>, then the contents of <filename>/etc/passwd</filename> and <filename>/etc/group</filename> will be <link
50+ xlink:href="https://www.usenix.org/legacy/event/lisa02/tech/full_papers/traugott/traugott_html/">congruent</link> to your NixOS configuration. For instance, if you remove a user from <option>users.extraUsers</option> and run <command>nixos-rebuild</command>, the user account will cease to exist. Also, imperative commands for managing users and groups, such as <command>useradd</command>, are no longer available. If <option>users.mutableUsers</option> is <literal>true</literal> (the default), then behaviour is unchanged from NixOS 13.10.
7051 </para>
7152 </listitem>
7253 <listitem>
7354 <para>
74− NixOS now has basic container support, meaning you can easily run a NixOS
75− instance as a container in a NixOS host system. These containers are
76− suitable for testing and experimentation but not production use, since
77− they’re not fully isolated from the host. See
78− <xref linkend="ch-containers"/> for details.
55+ NixOS now has basic container support, meaning you can easily run a NixOS instance as a container in a NixOS host system. These containers are suitable for testing and experimentation but not production use, since they’re not fully isolated from the host. See <xref linkend="ch-containers"/> for details.
7956 </para>
8057 </listitem>
8158 <listitem>
8259 <para>
83− Systemd units provided by packages can now be overridden from the NixOS
84− configuration. For instance, if a package <literal>foo</literal> provides
85− systemd units, you can say:
60+ Systemd units provided by packages can now be overridden from the NixOS configuration. For instance, if a package <literal>foo</literal> provides systemd units, you can say:
8661<programlisting>
8762systemd.packages = [ pkgs.foo ];
8863</programlisting>
89− to enable those units. You can then set or override unit options in the
90− usual way, e.g.
64+ to enable those units. You can then set or override unit options in the usual way, e.g.
9165<programlisting>
9266systemd.services.foo.wantedBy = [ "multi-user.target" ];
9367systemd.services.foo.serviceConfig.MemoryLimit = "512M";
@@ -98,14 +72,11 @@ systemd.services.foo.serviceConfig.MemoryLimit = "512M";
9872 </para>
9973
10074 <para>
101− When upgrading from a previous release, please be aware of the following
102− incompatible changes:
75+ When upgrading from a previous release, please be aware of the following incompatible changes:
10376 <itemizedlist>
10477 <listitem>
10578 <para>
106− Nixpkgs no longer exposes unfree packages by default. If your NixOS
107− configuration requires unfree packages from Nixpkgs, you need to enable
108− support for them explicitly by setting:
79+ Nixpkgs no longer exposes unfree packages by default. If your NixOS configuration requires unfree packages from Nixpkgs, you need to enable support for them explicitly by setting:
10980<programlisting>
11081nixpkgs.config.allowUnfree = true;
11182</programlisting>
@@ -118,8 +89,7 @@ error: package ‘nvidia-x11-331.49-3.12.17’ in ‘…/nvidia-x11/default.nix:
11889 </listitem>
11990 <listitem>
12091 <para>
121− The Adobe Flash player is no longer enabled by default in the Firefox and
122− Chromium wrappers. To enable it, you must set:
92+ The Adobe Flash player is no longer enabled by default in the Firefox and Chromium wrappers. To enable it, you must set:
12393<programlisting>
12494nixpkgs.config.allowUnfree = true;
12595nixpkgs.config.firefox.enableAdobeFlash = true; # for Firefox
@@ -129,8 +99,7 @@ nixpkgs.config.chromium.enableAdobeFlash = true; # for Chromium
12999 </listitem>
130100 <listitem>
131101 <para>
132− The firewall is now enabled by default. If you don’t want this, you need
133− to disable it explicitly:
102+ The firewall is now enabled by default. If you don’t want this, you need to disable it explicitly:
134103<programlisting>
135104networking.firewall.enable = false;
136105</programlisting>
@@ -138,40 +107,22 @@ networking.firewall.enable = false;
138107 </listitem>
139108 <listitem>
140109 <para>
141− The option <option>boot.loader.grub.memtest86</option> has been renamed to
142− <option>boot.loader.grub.memtest86.enable</option>.
110+ The option <option>boot.loader.grub.memtest86</option> has been renamed to <option>boot.loader.grub.memtest86.enable</option>.
143111 </para>
144112 </listitem>
145113 <listitem>
146114 <para>
147− The <literal>mysql55</literal> service has been merged into the
148− <literal>mysql</literal> service, which no longer sets a default for the
149− option <option>services.mysql.package</option>.
115+ The <literal>mysql55</literal> service has been merged into the <literal>mysql</literal> service, which no longer sets a default for the option <option>services.mysql.package</option>.
150116 </para>
151117 </listitem>
152118 <listitem>
153119 <para>
154− Package variants are now differentiated by suffixing the name, rather than
155− the version. For instance, <filename>sqlite-3.8.4.3-interactive</filename>
156− is now called <filename>sqlite-interactive-3.8.4.3</filename>. This
157− ensures that <literal>nix-env -i sqlite</literal> is unambiguous, and that
158− <literal>nix-env -u</literal> won’t “upgrade”
159− <literal>sqlite</literal> to <literal>sqlite-interactive</literal> or vice
160− versa. Notably, this change affects the Firefox wrapper (which provides
161− plugins), as it is now called <literal>firefox-wrapper</literal>. So when
162− using <command>nix-env</command>, you should do <literal>nix-env -e
163− firefox; nix-env -i firefox-wrapper</literal> if you want to keep using
164− the wrapper. This change does not affect declarative package management,
165− since attribute names like <literal>pkgs.firefoxWrapper</literal> were
166− already unambiguous.
120+ Package variants are now differentiated by suffixing the name, rather than the version. For instance, <filename>sqlite-3.8.4.3-interactive</filename> is now called <filename>sqlite-interactive-3.8.4.3</filename>. This ensures that <literal>nix-env -i sqlite</literal> is unambiguous, and that <literal>nix-env -u</literal> won’t “upgrade” <literal>sqlite</literal> to <literal>sqlite-interactive</literal> or vice versa. Notably, this change affects the Firefox wrapper (which provides plugins), as it is now called <literal>firefox-wrapper</literal>. So when using <command>nix-env</command>, you should do <literal>nix-env -e firefox; nix-env -i firefox-wrapper</literal> if you want to keep using the wrapper. This change does not affect declarative package management, since attribute names like <literal>pkgs.firefoxWrapper</literal> were already unambiguous.
167121 </para>
168122 </listitem>
169123 <listitem>
170124 <para>
171− The symlink <filename>/etc/ca-bundle.crt</filename> is gone. Programs
172− should instead use the environment variable
173− <envar>OPENSSL_X509_CERT_FILE</envar> (which points to
174− <filename>/etc/ssl/certs/ca-bundle.crt</filename>).
125+ The symlink <filename>/etc/ca-bundle.crt</filename> is gone. Programs should instead use the environment variable <envar>OPENSSL_X509_CERT_FILE</envar> (which points to <filename>/etc/ssl/certs/ca-bundle.crt</filename>).
175126 </para>
176127 </listitem>
177128 </itemizedlist>
nixos/doc/manual/release-notes/rl-1412.xml+19−62
@@ -6,19 +6,16 @@
66 <title>Release 14.12 (“Caterpillar”, 2014/12/30)</title>
77
88 <para>
9− In addition to numerous new and upgraded packages, this release has the
10− following highlights:
9+ In addition to numerous new and upgraded packages, this release has the following highlights:
1110 <itemizedlist>
1211 <listitem>
1312 <para>
14− Systemd has been updated to version 217, which has numerous
15− <link xlink:href="http://lists.freedesktop.org/archives/systemd-devel/2014-October/024662.html">improvements.</link>
13+ Systemd has been updated to version 217, which has numerous <link xlink:href="http://lists.freedesktop.org/archives/systemd-devel/2014-October/024662.html">improvements.</link>
1614 </para>
1715 </listitem>
1816 <listitem>
1917 <para>
20− <link xlink:href="https://www.mail-archive.com/nix-dev@lists.science.uu.nl/msg13957.html">
21− Nix has been updated to 1.8.</link>
18+ <link xlink:href="https://www.mail-archive.com/nix-dev@lists.science.uu.nl/msg13957.html"> Nix has been updated to 1.8.</link>
2219 </para>
2320 </listitem>
2421 <listitem>
@@ -38,13 +35,7 @@
3835 </listitem>
3936 <listitem>
4037 <para>
41− If <option>users.mutableUsers</option> is enabled (the default), changes
42− made to the declaration of a user or group will be correctly realised when
43− running <command>nixos-rebuild</command>. For instance, removing a user
44− specification from <filename>configuration.nix</filename> will cause the
45− actual user account to be deleted. If <option>users.mutableUsers</option>
46− is disabled, it is no longer necessary to specify UIDs or GIDs; if
47− omitted, they are allocated dynamically.
38+ If <option>users.mutableUsers</option> is enabled (the default), changes made to the declaration of a user or group will be correctly realised when running <command>nixos-rebuild</command>. For instance, removing a user specification from <filename>configuration.nix</filename> will cause the actual user account to be deleted. If <option>users.mutableUsers</option> is disabled, it is no longer necessary to specify UIDs or GIDs; if omitted, they are allocated dynamically.
4839 </para>
4940 </listitem>
5041 </itemizedlist>
@@ -362,18 +353,12 @@
362353 </para>
363354
364355 <para>
365− When upgrading from a previous release, please be aware of the following
366− incompatible changes:
356+ When upgrading from a previous release, please be aware of the following incompatible changes:
367357 <itemizedlist>
368358 <listitem>
369359 <para>
370− The default version of Apache httpd is now 2.4. If you use the
371− <option>extraConfig</option> option to pass literal Apache configuration
372− text, you may need to update it — see
373− <link
374−xlink:href="http://httpd.apache.org/docs/2.4/upgrading.html">Apache’s
375− documentation</link> for details. If you wish to continue to use httpd
376− 2.2, add the following line to your NixOS configuration:
360+ The default version of Apache httpd is now 2.4. If you use the <option>extraConfig</option> option to pass literal Apache configuration text, you may need to update it — see <link
361+xlink:href="http://httpd.apache.org/docs/2.4/upgrading.html">Apache’s documentation</link> for details. If you wish to continue to use httpd 2.2, add the following line to your NixOS configuration:
377362<programlisting>
378363services.httpd.package = pkgs.apacheHttpd_2_2;
379364</programlisting>
@@ -381,85 +366,57 @@ services.httpd.package = pkgs.apacheHttpd_2_2;
381366 </listitem>
382367 <listitem>
383368 <para>
384− PHP 5.3 has been removed because it is no longer supported by the PHP
385− project. A <link
386−xlink:href="http://php.net/migration54">migration
387− guide</link> is available.
369+ PHP 5.3 has been removed because it is no longer supported by the PHP project. A <link
370+xlink:href="http://php.net/migration54">migration guide</link> is available.
388371 </para>
389372 </listitem>
390373 <listitem>
391374 <para>
392− The host side of a container virtual Ethernet pair is now called
393− <literal>ve-<replaceable>container-name</replaceable></literal> rather
394− than <literal>c-<replaceable>container-name</replaceable></literal>.
375+ The host side of a container virtual Ethernet pair is now called <literal>ve-<replaceable>container-name</replaceable></literal> rather than <literal>c-<replaceable>container-name</replaceable></literal>.
395376 </para>
396377 </listitem>
397378 <listitem>
398379 <para>
399− GNOME 3.10 support has been dropped. The default GNOME version is now
400− 3.12.
380+ GNOME 3.10 support has been dropped. The default GNOME version is now 3.12.
401381 </para>
402382 </listitem>
403383 <listitem>
404384 <para>
405− VirtualBox has been upgraded to 4.3.20 release. Users may be required to
406− run <command>rm -rf /tmp/.vbox*</command>. The line <literal>imports = [
407− &lt;nixpkgs/nixos/modules/programs/virtualbox.nix&gt; ]</literal> is no
408− longer necessary, use <literal>services.virtualboxHost.enable =
409− true</literal> instead.
385+ VirtualBox has been upgraded to 4.3.20 release. Users may be required to run <command>rm -rf /tmp/.vbox*</command>. The line <literal>imports = [ &lt;nixpkgs/nixos/modules/programs/virtualbox.nix&gt; ]</literal> is no longer necessary, use <literal>services.virtualboxHost.enable = true</literal> instead.
410386 </para>
411387 <para>
412− Also, hardening mode is now enabled by default, which means that unless
413− you want to use USB support, you no longer need to be a member of the
414− <literal>vboxusers</literal> group.
388+ Also, hardening mode is now enabled by default, which means that unless you want to use USB support, you no longer need to be a member of the <literal>vboxusers</literal> group.
415389 </para>
416390 </listitem>
417391 <listitem>
418392 <para>
419− Chromium has been updated to 39.0.2171.65.
420− <option>enablePepperPDF</option> is now enabled by default.
421− <literal>chromium*Wrapper</literal> packages no longer exist, because
422− upstream removed NSAPI support. <literal>chromium-stable</literal> has
423− been renamed to <literal>chromium</literal>.
393+ Chromium has been updated to 39.0.2171.65. <option>enablePepperPDF</option> is now enabled by default. <literal>chromium*Wrapper</literal> packages no longer exist, because upstream removed NSAPI support. <literal>chromium-stable</literal> has been renamed to <literal>chromium</literal>.
424394 </para>
425395 </listitem>
426396 <listitem>
427397 <para>
428− Python packaging documentation is now part of nixpkgs manual. To override
429− the python packages available to a custom python you now use
430− <literal>pkgs.pythonFull.buildEnv.override</literal> instead of
431− <literal>pkgs.pythonFull.override</literal>.
398+ Python packaging documentation is now part of nixpkgs manual. To override the python packages available to a custom python you now use <literal>pkgs.pythonFull.buildEnv.override</literal> instead of <literal>pkgs.pythonFull.override</literal>.
432399 </para>
433400 </listitem>
434401 <listitem>
435402 <para>
436− <literal>boot.resumeDevice = "8:6"</literal> is no longer supported. Most
437− users will want to leave it undefined, which takes the swap partitions
438− automatically. There is an evaluation assertion to ensure that the string
439− starts with a slash.
403+ <literal>boot.resumeDevice = "8:6"</literal> is no longer supported. Most users will want to leave it undefined, which takes the swap partitions automatically. There is an evaluation assertion to ensure that the string starts with a slash.
440404 </para>
441405 </listitem>
442406 <listitem>
443407 <para>
444− The system-wide default timezone for NixOS installations changed from
445− <literal>CET</literal> to <literal>UTC</literal>. To choose a different
446− timezone for your system, configure <literal>time.timeZone</literal> in
447− <literal>configuration.nix</literal>. A fairly complete list of possible
448− values for that setting is available at
449− <link
408+ The system-wide default timezone for NixOS installations changed from <literal>CET</literal> to <literal>UTC</literal>. To choose a different timezone for your system, configure <literal>time.timeZone</literal> in <literal>configuration.nix</literal>. A fairly complete list of possible values for that setting is available at <link
450409xlink:href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones"/>.
451410 </para>
452411 </listitem>
453412 <listitem>
454413 <para>
455− GNU screen has been updated to 4.2.1, which breaks the ability to connect
456− to sessions created by older versions of screen.
414+ GNU screen has been updated to 4.2.1, which breaks the ability to connect to sessions created by older versions of screen.
457415 </para>
458416 </listitem>
459417 <listitem>
460418 <para>
461− The Intel GPU driver was updated to the 3.x prerelease version (used by
462− most distributions) and supports DRI3 now.
419+ The Intel GPU driver was updated to the 3.x prerelease version (used by most distributions) and supports DRI3 now.
463420 </para>
464421 </listitem>
465422 </itemizedlist>
nixos/doc/manual/release-notes/rl-1509.xml+45−163
@@ -6,42 +6,23 @@
66 <title>Release 15.09 (“Dingo”, 2015/09/30)</title>
77
88 <para>
9− In addition to numerous new and upgraded packages, this release has the
10− following highlights:
9+ In addition to numerous new and upgraded packages, this release has the following highlights:
1110 </para>
1211
1312 <itemizedlist>
1413 <listitem>
1514 <para>
16− The <link xlink:href="http://haskell.org/">Haskell</link> packages
17− infrastructure has been re-designed from the ground up (&quot;Haskell
18− NG&quot;). NixOS now distributes the latest version of every single package
19− registered on
20− <link
21− xlink:href="http://hackage.haskell.org/">Hackage</link> -- well
22− in excess of 8,000 Haskell packages. Detailed instructions on how to use
23− that infrastructure can be found in the
24− <link
25− xlink:href="http://nixos.org/nixpkgs/manual/#users-guide-to-the-haskell-infrastructure">User's
26− Guide to the Haskell Infrastructure</link>. Users migrating from an earlier
27− release may find helpful information below, in the list of
28− backwards-incompatible changes. Furthermore, we distribute 51(!) additional
29− Haskell package sets that provide every single
30− <link
31− xlink:href="http://www.stackage.org/">LTS Haskell</link> release
32− since version 0.0 as well as the most recent
33− <link
34− xlink:href="http://www.stackage.org/">Stackage Nightly</link>
35− snapshot. The announcement
36− <link
37− xlink:href="https://nixos.org/nix-dev/2015-September/018138.html">&quot;Full
38− Stackage Support in Nixpkgs&quot;</link> gives additional details.
15+ The <link xlink:href="http://haskell.org/">Haskell</link> packages infrastructure has been re-designed from the ground up (&quot;Haskell NG&quot;). NixOS now distributes the latest version of every single package registered on <link
16+ xlink:href="http://hackage.haskell.org/">Hackage</link> -- well in excess of 8,000 Haskell packages. Detailed instructions on how to use that infrastructure can be found in the <link
17+ xlink:href="http://nixos.org/nixpkgs/manual/#users-guide-to-the-haskell-infrastructure">User's Guide to the Haskell Infrastructure</link>. Users migrating from an earlier release may find helpful information below, in the list of backwards-incompatible changes. Furthermore, we distribute 51(!) additional Haskell package sets that provide every single <link
18+ xlink:href="http://www.stackage.org/">LTS Haskell</link> release since version 0.0 as well as the most recent <link
19+ xlink:href="http://www.stackage.org/">Stackage Nightly</link> snapshot. The announcement <link
20+ xlink:href="https://nixos.org/nix-dev/2015-September/018138.html">&quot;Full Stackage Support in Nixpkgs&quot;</link> gives additional details.
3921 </para>
4022 </listitem>
4123 <listitem>
4224 <para>
43− Nix has been updated to version 1.10, which among other improvements
44− enables cryptographic signatures on binary caches for improved security.
25+ Nix has been updated to version 1.10, which among other improvements enables cryptographic signatures on binary caches for improved security.
4526 </para>
4627 </listitem>
4728 <listitem>
@@ -50,8 +31,7 @@
5031<programlisting>
5132system.autoUpgrade.enable = true;
5233</programlisting>
53− This will cause the system to periodically check for updates in your
54− current channel and run <command>nixos-rebuild</command>.
34+ This will cause the system to periodically check for updates in your current channel and run <command>nixos-rebuild</command>.
5535 </para>
5636 </listitem>
5737 <listitem>
@@ -71,8 +51,7 @@ system.autoUpgrade.enable = true;
7151 </listitem>
7252 <listitem>
7353 <para>
74− KDE 5 has been upgraded to KDE Frameworks 5.10, Plasma 5.3.2 and
75− Applications 15.04.3. KDE 4 has been updated to kdelibs-4.14.10.
54+ KDE 5 has been upgraded to KDE Frameworks 5.10, Plasma 5.3.2 and Applications 15.04.3. KDE 4 has been updated to kdelibs-4.14.10.
7655 </para>
7756 </listitem>
7857 <listitem>
@@ -424,93 +403,61 @@ system.autoUpgrade.enable = true;
424403 </para>
425404
426405 <para>
427− When upgrading from a previous release, please be aware of the following
428− incompatible changes:
406+ When upgrading from a previous release, please be aware of the following incompatible changes:
429407 <itemizedlist>
430408 <listitem>
431409 <para>
432− <command>sshd</command> no longer supports DSA and ECDSA host keys by
433− default. If you have existing systems with such host keys and want to
434− continue to use them, please set
410+ <command>sshd</command> no longer supports DSA and ECDSA host keys by default. If you have existing systems with such host keys and want to continue to use them, please set
435411<programlisting>
436412system.stateVersion = "14.12";
437413</programlisting>
438− The new option <option>system.stateVersion</option> ensures that certain
439− configuration changes that could break existing systems (such as the
440− <command>sshd</command> host key setting) will maintain compatibility with
441− the specified NixOS release. NixOps sets the state version of existing
442− deployments automatically.
414+ The new option <option>system.stateVersion</option> ensures that certain configuration changes that could break existing systems (such as the <command>sshd</command> host key setting) will maintain compatibility with the specified NixOS release. NixOps sets the state version of existing deployments automatically.
443415 </para>
444416 </listitem>
445417 <listitem>
446418 <para>
447− <command>cron</command> is no longer enabled by default, unless you have a
448− non-empty <option>services.cron.systemCronJobs</option>. To force
449− <command>cron</command> to be enabled, set <option>services.cron.enable =
450− true</option>.
419+ <command>cron</command> is no longer enabled by default, unless you have a non-empty <option>services.cron.systemCronJobs</option>. To force <command>cron</command> to be enabled, set <option>services.cron.enable = true</option>.
451420 </para>
452421 </listitem>
453422 <listitem>
454423 <para>
455− Nix now requires binary caches to be cryptographically signed. If you have
456− unsigned binary caches that you want to continue to use, you should set
457− <option>nix.requireSignedBinaryCaches = false</option>.
424+ Nix now requires binary caches to be cryptographically signed. If you have unsigned binary caches that you want to continue to use, you should set <option>nix.requireSignedBinaryCaches = false</option>.
458425 </para>
459426 </listitem>
460427 <listitem>
461428 <para>
462− Steam now doesn't need root rights to work. Instead of using
463− <literal>*-steam-chrootenv</literal>, you should now just run
464− <literal>steam</literal>. <literal>steamChrootEnv</literal> package was
465− renamed to <literal>steam</literal>, and old <literal>steam</literal>
466− package -- to <literal>steamOriginal</literal>.
429+ Steam now doesn't need root rights to work. Instead of using <literal>*-steam-chrootenv</literal>, you should now just run <literal>steam</literal>. <literal>steamChrootEnv</literal> package was renamed to <literal>steam</literal>, and old <literal>steam</literal> package -- to <literal>steamOriginal</literal>.
467430 </para>
468431 </listitem>
469432 <listitem>
470433 <para>
471− CMPlayer has been renamed to bomi upstream. Package
472− <literal>cmplayer</literal> was accordingly renamed to
473− <literal>bomi</literal>
434+ CMPlayer has been renamed to bomi upstream. Package <literal>cmplayer</literal> was accordingly renamed to <literal>bomi</literal>
474435 </para>
475436 </listitem>
476437 <listitem>
477438 <para>
478− Atom Shell has been renamed to Electron upstream. Package
479− <literal>atom-shell</literal> was accordingly renamed to
480− <literal>electron</literal>
439+ Atom Shell has been renamed to Electron upstream. Package <literal>atom-shell</literal> was accordingly renamed to <literal>electron</literal>
481440 </para>
482441 </listitem>
483442 <listitem>
484443 <para>
485− Elm is not released on Hackage anymore. You should now use
486− <literal>elmPackages.elm</literal> which contains the latest Elm platform.
444+ Elm is not released on Hackage anymore. You should now use <literal>elmPackages.elm</literal> which contains the latest Elm platform.
487445 </para>
488446 </listitem>
489447 <listitem>
490448 <para>
491− The CUPS printing service has been updated to version
492− <literal>2.0.2</literal>. Furthermore its systemd service has been renamed
493− to <literal>cups.service</literal>.
449+ The CUPS printing service has been updated to version <literal>2.0.2</literal>. Furthermore its systemd service has been renamed to <literal>cups.service</literal>.
494450 </para>
495451 <para>
496− Local printers are no longer shared or advertised by default. This
497− behavior can be changed by enabling
498− <option>services.printing.defaultShared</option> or
499− <option>services.printing.browsing</option> respectively.
452+ Local printers are no longer shared or advertised by default. This behavior can be changed by enabling <option>services.printing.defaultShared</option> or <option>services.printing.browsing</option> respectively.
500453 </para>
501454 </listitem>
502455 <listitem>
503456 <para>
504− The VirtualBox host and guest options have been named more consistently.
505− They can now found in <option>virtualisation.virtualbox.host.*</option>
506− instead of <option>services.virtualboxHost.*</option> and
507− <option>virtualisation.virtualbox.guest.*</option> instead of
508− <option>services.virtualboxGuest.*</option>.
457+ The VirtualBox host and guest options have been named more consistently. They can now found in <option>virtualisation.virtualbox.host.*</option> instead of <option>services.virtualboxHost.*</option> and <option>virtualisation.virtualbox.guest.*</option> instead of <option>services.virtualboxGuest.*</option>.
509458 </para>
510459 <para>
511− Also, there now is support for the <literal>vboxsf</literal> file system
512− using the <option>fileSystems</option> configuration attribute. An example
513− of how this can be used in a configuration:
460+ Also, there now is support for the <literal>vboxsf</literal> file system using the <option>fileSystems</option> configuration attribute. An example of how this can be used in a configuration:
514461<programlisting>
515462fileSystems."/shiny" = {
516463 device = "myshinysharedfolder";
@@ -521,15 +468,7 @@ fileSystems."/shiny" = {
521468 </listitem>
522469 <listitem>
523470 <para>
524− &quot;<literal>nix-env -qa</literal>&quot; no longer discovers Haskell
525− packages by name. The only packages visible in the global scope are
526− <literal>ghc</literal>, <literal>cabal-install</literal>, and
527− <literal>stack</literal>, but all other packages are hidden. The reason
528− for this inconvenience is the sheer size of the Haskell package set.
529− Name-based lookups are expensive, and most <literal>nix-env -qa</literal>
530− operations would become much slower if we'd add the entire Hackage
531− database into the top level attribute set. Instead, the list of Haskell
532− packages can be displayed by running:
471+ &quot;<literal>nix-env -qa</literal>&quot; no longer discovers Haskell packages by name. The only packages visible in the global scope are <literal>ghc</literal>, <literal>cabal-install</literal>, and <literal>stack</literal>, but all other packages are hidden. The reason for this inconvenience is the sheer size of the Haskell package set. Name-based lookups are expensive, and most <literal>nix-env -qa</literal> operations would become much slower if we'd add the entire Hackage database into the top level attribute set. Instead, the list of Haskell packages can be displayed by running:
533472 </para>
534473<programlisting>
535474nix-env -f &quot;&lt;nixpkgs&gt;&quot; -qaP -A haskellPackages
@@ -541,91 +480,56 @@ nix-env -f &quot;&lt;nixpkgs&gt;&quot; -qaP -A haskellPackages
541480nix-env -f &quot;&lt;nixpkgs&gt;&quot; -iA haskellPackages.pandoc
542481</programlisting>
543482 <para>
544− Installing Haskell <emphasis>libraries</emphasis> this way, however, is no
545− longer supported. See the next item for more details.
483+ Installing Haskell <emphasis>libraries</emphasis> this way, however, is no longer supported. See the next item for more details.
546484 </para>
547485 </listitem>
548486 <listitem>
549487 <para>
550− Previous versions of NixOS came with a feature called
551− <literal>ghc-wrapper</literal>, a small script that allowed GHC to
552− transparently pick up on libraries installed in the user's profile. This
553− feature has been deprecated; <literal>ghc-wrapper</literal> was removed
554− from the distribution. The proper way to register Haskell libraries with
555− the compiler now is the <literal>haskellPackages.ghcWithPackages</literal>
556− function. The
557− <link
558− xlink:href="http://nixos.org/nixpkgs/manual/#users-guide-to-the-haskell-infrastructure">User's
559− Guide to the Haskell Infrastructure</link> provides more information about
560− this subject.
488+ Previous versions of NixOS came with a feature called <literal>ghc-wrapper</literal>, a small script that allowed GHC to transparently pick up on libraries installed in the user's profile. This feature has been deprecated; <literal>ghc-wrapper</literal> was removed from the distribution. The proper way to register Haskell libraries with the compiler now is the <literal>haskellPackages.ghcWithPackages</literal> function. The <link
489+ xlink:href="http://nixos.org/nixpkgs/manual/#users-guide-to-the-haskell-infrastructure">User's Guide to the Haskell Infrastructure</link> provides more information about this subject.
561490 </para>
562491 </listitem>
563492 <listitem>
564493 <para>
565− All Haskell builds that have been generated with version 1.x of the
566− <literal>cabal2nix</literal> utility are now invalid and need to be
567− re-generated with a current version of <literal>cabal2nix</literal> to
568− function. The most recent version of this tool can be installed by running
569− <literal>nix-env -i cabal2nix</literal>.
494+ All Haskell builds that have been generated with version 1.x of the <literal>cabal2nix</literal> utility are now invalid and need to be re-generated with a current version of <literal>cabal2nix</literal> to function. The most recent version of this tool can be installed by running <literal>nix-env -i cabal2nix</literal>.
570495 </para>
571496 </listitem>
572497 <listitem>
573498 <para>
574− The <literal>haskellPackages</literal> set in Nixpkgs used to have a
575− function attribute called <literal>extension</literal> that users could
576− override in their <literal>~/.nixpkgs/config.nix</literal> files to
577− configure additional attributes, etc. That function still exists, but it's
578− now called <literal>overrides</literal>.
499+ The <literal>haskellPackages</literal> set in Nixpkgs used to have a function attribute called <literal>extension</literal> that users could override in their <literal>~/.nixpkgs/config.nix</literal> files to configure additional attributes, etc. That function still exists, but it's now called <literal>overrides</literal>.
579500 </para>
580501 </listitem>
581502 <listitem>
582503 <para>
583− The OpenBLAS library has been updated to version
584− <literal>0.2.14</literal>. Support for the
585− <literal>x86_64-darwin</literal> platform was added. Dynamic architecture
586− detection was enabled; OpenBLAS now selects microarchitecture-optimized
587− routines at runtime, so optimal performance is achieved without the need
588− to rebuild OpenBLAS locally. OpenBLAS has replaced ATLAS in most packages
589− which use an optimized BLAS or LAPACK implementation.
504+ The OpenBLAS library has been updated to version <literal>0.2.14</literal>. Support for the <literal>x86_64-darwin</literal> platform was added. Dynamic architecture detection was enabled; OpenBLAS now selects microarchitecture-optimized routines at runtime, so optimal performance is achieved without the need to rebuild OpenBLAS locally. OpenBLAS has replaced ATLAS in most packages which use an optimized BLAS or LAPACK implementation.
590505 </para>
591506 </listitem>
592507 <listitem>
593508 <para>
594− The <literal>phpfpm</literal> is now using the default PHP version
595− (<literal>pkgs.php</literal>) instead of PHP 5.4
596− (<literal>pkgs.php54</literal>).
509+ The <literal>phpfpm</literal> is now using the default PHP version (<literal>pkgs.php</literal>) instead of PHP 5.4 (<literal>pkgs.php54</literal>).
597510 </para>
598511 </listitem>
599512 <listitem>
600513 <para>
601− The <literal>locate</literal> service no longer indexes the Nix store by
602− default, preventing packages with potentially numerous versions from
603− cluttering the output. Indexing the store can be activated by setting
604− <option>services.locate.includeStore = true</option>.
514+ The <literal>locate</literal> service no longer indexes the Nix store by default, preventing packages with potentially numerous versions from cluttering the output. Indexing the store can be activated by setting <option>services.locate.includeStore = true</option>.
605515 </para>
606516 </listitem>
607517 <listitem>
608518 <para>
609− The Nix expression search path (<envar>NIX_PATH</envar>) no longer
610− contains <filename>/etc/nixos/nixpkgs</filename> by default. You can
611− override <envar>NIX_PATH</envar> by setting <option>nix.nixPath</option>.
519+ The Nix expression search path (<envar>NIX_PATH</envar>) no longer contains <filename>/etc/nixos/nixpkgs</filename> by default. You can override <envar>NIX_PATH</envar> by setting <option>nix.nixPath</option>.
612520 </para>
613521 </listitem>
614522 <listitem>
615523 <para>
616− Python 2.6 has been marked as broken (as it no longer receives security
617− updates from upstream).
524+ Python 2.6 has been marked as broken (as it no longer receives security updates from upstream).
618525 </para>
619526 </listitem>
620527 <listitem>
621528 <para>
622− Any use of module arguments such as <varname>pkgs</varname> to access
623− library functions, or to define <literal>imports</literal> attributes will
624− now lead to an infinite loop at the time of the evaluation.
529+ Any use of module arguments such as <varname>pkgs</varname> to access library functions, or to define <literal>imports</literal> attributes will now lead to an infinite loop at the time of the evaluation.
625530 </para>
626531 <para>
627− In case of an infinite loop, use the <command>--show-trace</command>
628− command line argument and read the line just above the error message.
532+ In case of an infinite loop, use the <command>--show-trace</command> command line argument and read the line just above the error message.
629533<screen>
630534<prompt>$ </prompt>nixos-rebuild build --show-trace
631535…
@@ -634,9 +538,7 @@ infinite recursion encountered
634538</screen>
635539 </para>
636540 <para>
637− Any use of <literal>pkgs.lib</literal>, should be replaced by
638− <varname>lib</varname>, after adding it as argument of the module. The
639− following module
541+ Any use of <literal>pkgs.lib</literal>, should be replaced by <varname>lib</varname>, after adding it as argument of the module. The following module
640542<programlisting>
641543{ config, pkgs, ... }:
642544
@@ -664,9 +566,7 @@ with lib;
664566</programlisting>
665567 </para>
666568 <para>
667− When <varname>pkgs</varname> is used to download other projects to import
668− their modules, and only in such cases, it should be replaced by
669− <literal>(import &lt;nixpkgs&gt; {})</literal>. The following module
569+ When <varname>pkgs</varname> is used to download other projects to import their modules, and only in such cases, it should be replaced by <literal>(import &lt;nixpkgs&gt; {})</literal>. The following module
670570<programlisting>
671571{ config, pkgs, ... }:
672572
@@ -706,43 +606,25 @@ in
706606 <itemizedlist>
707607 <listitem>
708608 <para>
709− The nixos and nixpkgs channels were unified, so one
710− <emphasis>can</emphasis> use <literal>nix-env -iA nixos.bash</literal>
711− instead of <literal>nix-env -iA nixos.pkgs.bash</literal>. See
712− <link xlink:href="https://github.com/NixOS/nixpkgs/commit/2cd7c1f198">the
713− commit</link> for details.
609+ The nixos and nixpkgs channels were unified, so one <emphasis>can</emphasis> use <literal>nix-env -iA nixos.bash</literal> instead of <literal>nix-env -iA nixos.pkgs.bash</literal>. See <link xlink:href="https://github.com/NixOS/nixpkgs/commit/2cd7c1f198">the commit</link> for details.
714610 </para>
715611 </listitem>
716612 <listitem>
717613 <para>
718− Users running an SSH server who worry about the quality of their
719− <literal>/etc/ssh/moduli</literal> file with respect to the
720− <link
721− xlink:href="https://stribika.github.io/2015/01/04/secure-secure-shell.html">vulnerabilities
722− discovered in the Diffie-Hellman key exchange</link> can now replace
723− OpenSSH's default version with one they generated themselves using the new
724− <option>services.openssh.moduliFile</option> option.
614+ Users running an SSH server who worry about the quality of their <literal>/etc/ssh/moduli</literal> file with respect to the <link
615+ xlink:href="https://stribika.github.io/2015/01/04/secure-secure-shell.html">vulnerabilities discovered in the Diffie-Hellman key exchange</link> can now replace OpenSSH's default version with one they generated themselves using the new <option>services.openssh.moduliFile</option> option.
725616 </para>
726617 </listitem>
727618 <listitem>
728619 <para>
729− A newly packaged TeX Live 2015 is provided in
730− <literal>pkgs.texlive</literal>, split into 6500 nix packages. For basic
731− user documentation see
732− <link xlink:href="https://github.com/NixOS/nixpkgs/blob/release-15.09/pkgs/tools/typesetting/tex/texlive/default.nix#L1"
733− >the
734− source</link>. Beware of
735− <link xlink:href="https://github.com/NixOS/nixpkgs/issues/9757"
736− >an
737− issue</link> when installing a too large package set. The plan is to
738− deprecate and maybe delete the original TeX packages until the next
739− release.
620+ A newly packaged TeX Live 2015 is provided in <literal>pkgs.texlive</literal>, split into 6500 nix packages. For basic user documentation see <link xlink:href="https://github.com/NixOS/nixpkgs/blob/release-15.09/pkgs/tools/typesetting/tex/texlive/default.nix#L1"
621+ >the source</link>. Beware of <link xlink:href="https://github.com/NixOS/nixpkgs/issues/9757"
622+ >an issue</link> when installing a too large package set. The plan is to deprecate and maybe delete the original TeX packages until the next release.
740623 </para>
741624 </listitem>
742625 <listitem>
743626 <para>
744− <option>buildEnv.env</option> on all Python interpreters is now available
745− for nix-shell interoperability.
627+ <option>buildEnv.env</option> on all Python interpreters is now available for nix-shell interoperability.
746628 </para>
747629 </listitem>
748630 </itemizedlist>
nixos/doc/manual/release-notes/rl-1603.xml+41−164
@@ -6,17 +6,14 @@
66 <title>Release 16.03 (“Emu”, 2016/03/31)</title>
77
88 <para>
9− In addition to numerous new and upgraded packages, this release has the
10− following highlights:
9+ In addition to numerous new and upgraded packages, this release has the following highlights:
1110 </para>
1211
1312 <itemizedlist>
1413 <listitem>
1514 <para>
16− Systemd 229, bringing
17− <link
18− xlink:href="https://github.com/systemd/systemd/blob/v229/NEWS">numerous
19− improvements</link> over 217.
15+ Systemd 229, bringing <link
16+ xlink:href="https://github.com/systemd/systemd/blob/v229/NEWS">numerous improvements</link> over 217.
2017 </para>
2118 </listitem>
2219 <listitem>
@@ -26,11 +23,8 @@
2623 </listitem>
2724 <listitem>
2825 <para>
29− GCC 5.3 (was 4.9). Note that GCC 5
30− <link
31− xlink:href="https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html">changes
32− the C++ ABI in an incompatible way</link>; this may cause problems if you
33− try to link objects compiled with different versions of GCC.
26+ GCC 5.3 (was 4.9). Note that GCC 5 <link
27+ xlink:href="https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html">changes the C++ ABI in an incompatible way</link>; this may cause problems if you try to link objects compiled with different versions of GCC.
3428 </para>
3529 </listitem>
3630 <listitem>
@@ -45,20 +39,10 @@
4539 </listitem>
4640 <listitem>
4741 <para>
48− Improved support for ensuring
49− <link
50− xlink:href="https://reproducible-builds.org/">bitwise
51− reproducible builds</link>. For example, <literal>stdenv</literal> now sets
52− the environment variable
53− <envar
54− xlink:href="https://reproducible-builds.org/specs/source-date-epoch/">SOURCE_DATE_EPOCH</envar>
55− to a deterministic value, and Nix has
56− <link
57− xlink:href="http://nixos.org/nix/manual/#ssec-relnotes-1.11">gained
58− an option</link> to repeat a build a number of times to test determinism.
59− An ongoing project, the goal of exact reproducibility is to allow binaries
60− to be verified independently (e.g., a user might only trust binaries that
61− appear in three independent binary caches).
42+ Improved support for ensuring <link
43+ xlink:href="https://reproducible-builds.org/">bitwise reproducible builds</link>. For example, <literal>stdenv</literal> now sets the environment variable <envar
44+ xlink:href="https://reproducible-builds.org/specs/source-date-epoch/">SOURCE_DATE_EPOCH</envar> to a deterministic value, and Nix has <link
45+ xlink:href="http://nixos.org/nix/manual/#ssec-relnotes-1.11">gained an option</link> to repeat a build a number of times to test determinism. An ongoing project, the goal of exact reproducibility is to allow binaries to be verified independently (e.g., a user might only trust binaries that appear in three independent binary caches).
6246 </para>
6347 </listitem>
6448 <listitem>
@@ -335,56 +319,38 @@
335319 </para>
336320
337321 <para>
338− When upgrading from a previous release, please be aware of the following
339− incompatible changes:
322+ When upgrading from a previous release, please be aware of the following incompatible changes:
340323 </para>
341324
342325 <itemizedlist>
343326 <listitem>
344327 <para>
345− We no longer produce graphical ISO images and VirtualBox images for
346− <literal>i686-linux</literal>. A minimal ISO image is still provided.
328+ We no longer produce graphical ISO images and VirtualBox images for <literal>i686-linux</literal>. A minimal ISO image is still provided.
347329 </para>
348330 </listitem>
349331 <listitem>
350332 <para>
351− Firefox and similar browsers are now <emphasis>wrapped by
352− default</emphasis>. The package and attribute names are plain
353− <literal>firefox</literal> or <literal>midori</literal>, etc.
354− Backward-compatibility attributes were set up, but note that
355− <command>nix-env -u</command> will <emphasis>not</emphasis> update your
356− current <literal>firefox-with-plugins</literal>; you have to uninstall it
357− and install <literal>firefox</literal> instead.
333+ Firefox and similar browsers are now <emphasis>wrapped by default</emphasis>. The package and attribute names are plain <literal>firefox</literal> or <literal>midori</literal>, etc. Backward-compatibility attributes were set up, but note that <command>nix-env -u</command> will <emphasis>not</emphasis> update your current <literal>firefox-with-plugins</literal>; you have to uninstall it and install <literal>firefox</literal> instead.
358334 </para>
359335 </listitem>
360336 <listitem>
361337 <para>
362− <command>wmiiSnap</command> has been replaced with
363− <command>wmii_hg</command>, but
364− <command>services.xserver.windowManager.wmii.enable</command> has been
365− updated respectively so this only affects you if you have explicitly
366− installed <command>wmiiSnap</command>.
338+ <command>wmiiSnap</command> has been replaced with <command>wmii_hg</command>, but <command>services.xserver.windowManager.wmii.enable</command> has been updated respectively so this only affects you if you have explicitly installed <command>wmiiSnap</command>.
367339 </para>
368340 </listitem>
369341 <listitem>
370342 <para>
371− <literal>jobs</literal> NixOS option has been removed. It served as
372− compatibility layer between Upstart jobs and SystemD services. All services
373− have been rewritten to use <literal>systemd.services</literal>
343+ <literal>jobs</literal> NixOS option has been removed. It served as compatibility layer between Upstart jobs and SystemD services. All services have been rewritten to use <literal>systemd.services</literal>
374344 </para>
375345 </listitem>
376346 <listitem>
377347 <para>
378− <command>wmiimenu</command> is removed, as it has been removed by the
379− developers upstream. Use <command>wimenu</command> from the
380− <command>wmii-hg</command> package.
348+ <command>wmiimenu</command> is removed, as it has been removed by the developers upstream. Use <command>wimenu</command> from the <command>wmii-hg</command> package.
381349 </para>
382350 </listitem>
383351 <listitem>
384352 <para>
385− Gitit is no longer automatically added to the module list in NixOS and as
386− such there will not be any manual entries for it. You will need to add an
387− import statement to your NixOS configuration in order to use it, e.g.
353+ Gitit is no longer automatically added to the module list in NixOS and as such there will not be any manual entries for it. You will need to add an import statement to your NixOS configuration in order to use it, e.g.
388354<programlisting><![CDATA[
389355{
390356 imports = [ <nixpkgs/nixos/modules/services/misc/gitit.nix> ];
@@ -395,10 +361,7 @@
395361 </listitem>
396362 <listitem>
397363 <para>
398− <command>nginx</command> does not accept flags for enabling and disabling
399− modules anymore. Instead it accepts <literal>modules</literal> argument,
400− which is a list of modules to be built in. All modules now reside in
401− <literal>nginxModules</literal> set. Example configuration:
364+ <command>nginx</command> does not accept flags for enabling and disabling modules anymore. Instead it accepts <literal>modules</literal> argument, which is a list of modules to be built in. All modules now reside in <literal>nginxModules</literal> set. Example configuration:
402365<programlisting><![CDATA[
403366nginx.override {
404367 modules = [ nginxModules.rtmp nginxModules.dav nginxModules.moreheaders ];
@@ -408,66 +371,42 @@ nginx.override {
408371 </listitem>
409372 <listitem>
410373 <para>
411− <command>s3sync</command> is removed, as it hasn't been developed by
412− upstream for 4 years and only runs with ruby 1.8. For an actively-developer
413− alternative look at <command>tarsnap</command> and others.
374+ <command>s3sync</command> is removed, as it hasn't been developed by upstream for 4 years and only runs with ruby 1.8. For an actively-developer alternative look at <command>tarsnap</command> and others.
414375 </para>
415376 </listitem>
416377 <listitem>
417378 <para>
418− <command>ruby_1_8</command> has been removed as it's not supported from
419− upstream anymore and probably contains security issues.
379+ <command>ruby_1_8</command> has been removed as it's not supported from upstream anymore and probably contains security issues.
420380 </para>
421381 </listitem>
422382 <listitem>
423383 <para>
424− <literal>tidy-html5</literal> package is removed. Upstream only provided
425− <literal>(lib)tidy5</literal> during development, and now they went back to
426− <literal>(lib)tidy</literal> to work as a drop-in replacement of the
427− original package that has been unmaintained for years. You can (still) use
428− the <literal>html-tidy</literal> package, which got updated to a stable
429− release from this new upstream.
384+ <literal>tidy-html5</literal> package is removed. Upstream only provided <literal>(lib)tidy5</literal> during development, and now they went back to <literal>(lib)tidy</literal> to work as a drop-in replacement of the original package that has been unmaintained for years. You can (still) use the <literal>html-tidy</literal> package, which got updated to a stable release from this new upstream.
430385 </para>
431386 </listitem>
432387 <listitem>
433388 <para>
434− <literal>extraDeviceOptions</literal> argument is removed from
435− <literal>bumblebee</literal> package. Instead there are now two separate
436− arguments: <literal>extraNvidiaDeviceOptions</literal> and
437− <literal>extraNouveauDeviceOptions</literal> for setting extra X11 options
438− for nvidia and nouveau drivers, respectively.
389+ <literal>extraDeviceOptions</literal> argument is removed from <literal>bumblebee</literal> package. Instead there are now two separate arguments: <literal>extraNvidiaDeviceOptions</literal> and <literal>extraNouveauDeviceOptions</literal> for setting extra X11 options for nvidia and nouveau drivers, respectively.
439390 </para>
440391 </listitem>
441392 <listitem>
442393 <para>
443− The <literal>Ctrl+Alt+Backspace</literal> key combination no longer kills
444− the X server by default. There's a new option
445− <option>services.xserver.enableCtrlAltBackspace</option> allowing to enable
446− the combination again.
394+ The <literal>Ctrl+Alt+Backspace</literal> key combination no longer kills the X server by default. There's a new option <option>services.xserver.enableCtrlAltBackspace</option> allowing to enable the combination again.
447395 </para>
448396 </listitem>
449397 <listitem>
450398 <para>
451− <literal>emacsPackagesNg</literal> now contains all packages from the ELPA,
452− MELPA, and MELPA Stable repositories.
399+ <literal>emacsPackagesNg</literal> now contains all packages from the ELPA, MELPA, and MELPA Stable repositories.
453400 </para>
454401 </listitem>
455402 <listitem>
456403 <para>
457− Data directory for Postfix MTA server is moved from
458− <filename>/var/postfix</filename> to <filename>/var/lib/postfix</filename>.
459− Old configurations are migrated automatically.
460− <literal>service.postfix</literal> module has also received many
461− improvements, such as correct directories' access rights, new
462− <literal>aliasFiles</literal> and <literal>mapFiles</literal> options and
463− more.
404+ Data directory for Postfix MTA server is moved from <filename>/var/postfix</filename> to <filename>/var/lib/postfix</filename>. Old configurations are migrated automatically. <literal>service.postfix</literal> module has also received many improvements, such as correct directories' access rights, new <literal>aliasFiles</literal> and <literal>mapFiles</literal> options and more.
464405 </para>
465406 </listitem>
466407 <listitem>
467408 <para>
468− Filesystem options should now be configured as a list of strings, not a
469− comma-separated string. The old style will continue to work, but print a
470− warning, until the 16.09 release. An example of the new style:
409+ Filesystem options should now be configured as a list of strings, not a comma-separated string. The old style will continue to work, but print a warning, until the 16.09 release. An example of the new style:
471410<programlisting>
472411fileSystems."/example" = {
473412 device = "/dev/sdc";
@@ -479,44 +418,20 @@ fileSystems."/example" = {
479418 </listitem>
480419 <listitem>
481420 <para>
482− CUPS, installed by <literal>services.printing</literal> module, now has its
483− data directory in <filename>/var/lib/cups</filename>. Old configurations
484− from <filename>/etc/cups</filename> are moved there automatically, but
485− there might be problems. Also configuration options
486− <literal>services.printing.cupsdConf</literal> and
487− <literal>services.printing.cupsdFilesConf</literal> were removed because
488− they had been allowing one to override configuration variables required for
489− CUPS to work at all on NixOS. For most use cases,
490− <literal>services.printing.extraConf</literal> and new option
491− <literal>services.printing.extraFilesConf</literal> should be enough; if
492− you encounter a situation when they are not, please file a bug.
421+ CUPS, installed by <literal>services.printing</literal> module, now has its data directory in <filename>/var/lib/cups</filename>. Old configurations from <filename>/etc/cups</filename> are moved there automatically, but there might be problems. Also configuration options <literal>services.printing.cupsdConf</literal> and <literal>services.printing.cupsdFilesConf</literal> were removed because they had been allowing one to override configuration variables required for CUPS to work at all on NixOS. For most use cases, <literal>services.printing.extraConf</literal> and new option <literal>services.printing.extraFilesConf</literal> should be enough; if you encounter a situation when they are not, please file a bug.
493422 </para>
494423 <para>
495− There are also Gutenprint improvements; in particular, a new option
496− <literal>services.printing.gutenprint</literal> is added to enable
497− automatic updating of Gutenprint PPMs; it's greatly recommended to enable
498− it instead of adding <literal>gutenprint</literal> to the
499− <literal>drivers</literal> list.
424+ There are also Gutenprint improvements; in particular, a new option <literal>services.printing.gutenprint</literal> is added to enable automatic updating of Gutenprint PPMs; it's greatly recommended to enable it instead of adding <literal>gutenprint</literal> to the <literal>drivers</literal> list.
500425 </para>
501426 </listitem>
502427 <listitem>
503428 <para>
504− <literal>services.xserver.vaapiDrivers</literal> has been removed. Use
505− <literal>hardware.opengl.extraPackages{,32}</literal> instead. You can also
506− specify VDPAU drivers there.
429+ <literal>services.xserver.vaapiDrivers</literal> has been removed. Use <literal>hardware.opengl.extraPackages{,32}</literal> instead. You can also specify VDPAU drivers there.
507430 </para>
508431 </listitem>
509432 <listitem>
510433 <para>
511− <literal>programs.ibus</literal> moved to
512− <literal>i18n.inputMethod.ibus</literal>. The option
513− <literal>programs.ibus.plugins</literal> changed to
514− <literal>i18n.inputMethod.ibus.engines</literal> and the option to enable
515− ibus changed from <literal>programs.ibus.enable</literal> to
516− <literal>i18n.inputMethod.enabled</literal>.
517− <literal>i18n.inputMethod.enabled</literal> should be set to the used input
518− method name, <literal>"ibus"</literal> for ibus. An example of the new
519− style:
434+ <literal>programs.ibus</literal> moved to <literal>i18n.inputMethod.ibus</literal>. The option <literal>programs.ibus.plugins</literal> changed to <literal>i18n.inputMethod.ibus.engines</literal> and the option to enable ibus changed from <literal>programs.ibus.enable</literal> to <literal>i18n.inputMethod.enabled</literal>. <literal>i18n.inputMethod.enabled</literal> should be set to the used input method name, <literal>"ibus"</literal> for ibus. An example of the new style:
520435<programlisting>
521436i18n.inputMethod.enabled = "ibus";
522437i18n.inputMethod.ibus.engines = with pkgs.ibus-engines; [ anthy mozc ];
@@ -530,26 +445,17 @@ programs.ibus.plugins = with pkgs; [ ibus-anthy mozc ];
530445 </listitem>
531446 <listitem>
532447 <para>
533− <literal>services.udev.extraRules</literal> option now writes rules to
534− <filename>99-local.rules</filename> instead of
535− <filename>10-local.rules</filename>. This makes all the user rules apply
536− after others, so their results wouldn't be overriden by anything else.
448+ <literal>services.udev.extraRules</literal> option now writes rules to <filename>99-local.rules</filename> instead of <filename>10-local.rules</filename>. This makes all the user rules apply after others, so their results wouldn't be overriden by anything else.
537449 </para>
538450 </listitem>
539451 <listitem>
540452 <para>
541− Large parts of the <literal>services.gitlab</literal> module has been been
542− rewritten. There are new configuration options available. The
543− <literal>stateDir</literal> option was renamned to
544− <literal>statePath</literal> and the <literal>satellitesDir</literal>
545− option was removed. Please review the currently available options.
453+ Large parts of the <literal>services.gitlab</literal> module has been been rewritten. There are new configuration options available. The <literal>stateDir</literal> option was renamned to <literal>statePath</literal> and the <literal>satellitesDir</literal> option was removed. Please review the currently available options.
546454 </para>
547455 </listitem>
548456 <listitem>
549457 <para>
550− The option <option>services.nsd.zones.&lt;name&gt;.data</option> no longer
551− interpret the dollar sign ($) as a shell variable, as such it should not be
552− escaped anymore. Thus the following zone data:
458+ The option <option>services.nsd.zones.&lt;name&gt;.data</option> no longer interpret the dollar sign ($) as a shell variable, as such it should not be escaped anymore. Thus the following zone data:
553459 </para>
554460<programlisting>
555461\$ORIGIN example.com.
@@ -567,9 +473,7 @@ $TTL 1800
567473 </listitem>
568474 <listitem>
569475 <para>
570− <literal>service.syncthing.dataDir</literal> options now has to point to
571− exact folder where syncthing is writing to. Example configuration should
572− look something like:
476+ <literal>service.syncthing.dataDir</literal> options now has to point to exact folder where syncthing is writing to. Example configuration should look something like:
573477 </para>
574478<programlisting>
575479services.syncthing = {
@@ -581,45 +485,24 @@ services.syncthing = {
581485 </listitem>
582486 <listitem>
583487 <para>
584− <literal>networking.firewall.allowPing</literal> is now enabled by default.
585− Users are encouraged to configure an appropriate rate limit for their
586− machines using the Kernel interface at
587− <filename>/proc/sys/net/ipv4/icmp_ratelimit</filename> and
588− <filename>/proc/sys/net/ipv6/icmp/ratelimit</filename> or using the
589− firewall itself, i.e. by setting the NixOS option
590− <literal>networking.firewall.pingLimit</literal>.
488+ <literal>networking.firewall.allowPing</literal> is now enabled by default. Users are encouraged to configure an appropriate rate limit for their machines using the Kernel interface at <filename>/proc/sys/net/ipv4/icmp_ratelimit</filename> and <filename>/proc/sys/net/ipv6/icmp/ratelimit</filename> or using the firewall itself, i.e. by setting the NixOS option <literal>networking.firewall.pingLimit</literal>.
591489 </para>
592490 </listitem>
593491 <listitem>
594492 <para>
595− Systems with some broadcom cards used to result into a generated config
596− that is no longer accepted. If you get errors like
493+ Systems with some broadcom cards used to result into a generated config that is no longer accepted. If you get errors like
597494<screen>error: path ‘/nix/store/*-broadcom-sta-*’ does not exist and cannot be created</screen>
598− you should either re-run <command>nixos-generate-config</command> or
599− manually replace
600− <literal>"${config.boot.kernelPackages.broadcom_sta}"</literal> by
601− <literal>config.boot.kernelPackages.broadcom_sta</literal> in your
602− <filename>/etc/nixos/hardware-configuration.nix</filename>. More discussion
603− is on <link xlink:href="https://github.com/NixOS/nixpkgs/pull/12595"> the
604− github issue</link>.
495+ you should either re-run <command>nixos-generate-config</command> or manually replace <literal>"${config.boot.kernelPackages.broadcom_sta}"</literal> by <literal>config.boot.kernelPackages.broadcom_sta</literal> in your <filename>/etc/nixos/hardware-configuration.nix</filename>. More discussion is on <link xlink:href="https://github.com/NixOS/nixpkgs/pull/12595"> the github issue</link>.
605496 </para>
606497 </listitem>
607498 <listitem>
608499 <para>
609− The <literal>services.xserver.startGnuPGAgent</literal> option has been
610− removed. GnuPG 2.1.x changed the way the gpg-agent works, and that new
611− approach no longer requires (or even supports) the "start everything as a
612− child of the agent" scheme we've implemented in NixOS for older versions.
613− To configure the gpg-agent for your X session, add the following code to
614− <filename>~/.bashrc</filename> or some file that’s sourced when your
615− shell is started:
500+ The <literal>services.xserver.startGnuPGAgent</literal> option has been removed. GnuPG 2.1.x changed the way the gpg-agent works, and that new approach no longer requires (or even supports) the "start everything as a child of the agent" scheme we've implemented in NixOS for older versions. To configure the gpg-agent for your X session, add the following code to <filename>~/.bashrc</filename> or some file that’s sourced when your shell is started:
616501<programlisting>
617502GPG_TTY=$(tty)
618503export GPG_TTY
619504 </programlisting>
620− If you want to use gpg-agent for SSH, too, add the following to your
621− session initialization (e.g.
622− <literal>displayManager.sessionCommands</literal>)
505+ If you want to use gpg-agent for SSH, too, add the following to your session initialization (e.g. <literal>displayManager.sessionCommands</literal>)
623506<programlisting>
624507gpg-connect-agent /bye
625508unset SSH_AGENT_PID
@@ -629,15 +512,11 @@ export SSH_AUTH_SOCK="''${HOME}/.gnupg/S.gpg-agent.ssh"
629512<programlisting>
630513enable-ssh-support
631514 </programlisting>
632− is included in your <filename>~/.gnupg/gpg-agent.conf</filename>. You will
633− need to use <command>ssh-add</command> to re-add your ssh keys. If gpg’s
634− automatic transformation of the private keys to the new format fails, you
635− will need to re-import your private keyring as well:
515+ is included in your <filename>~/.gnupg/gpg-agent.conf</filename>. You will need to use <command>ssh-add</command> to re-add your ssh keys. If gpg’s automatic transformation of the private keys to the new format fails, you will need to re-import your private keyring as well:
636516<programlisting>
637517gpg --import ~/.gnupg/secring.gpg
638518 </programlisting>
639− The <command>gpg-agent(1)</command> man page has more details about this
640− subject, i.e. in the "EXAMPLES" section.
519+ The <command>gpg-agent(1)</command> man page has more details about this subject, i.e. in the "EXAMPLES" section.
641520 </para>
642521 </listitem>
643522 </itemizedlist>
@@ -661,9 +540,7 @@ gpg --import ~/.gnupg/secring.gpg
661540 </listitem>
662541 <listitem>
663542 <para>
664− Input method support was improved. New NixOS modules (fcitx, nabi and
665− uim), fcitx engines (chewing, hangul, m17n, mozc and table-other) and ibus
666− engines (hangul and m17n) have been added.
543+ Input method support was improved. New NixOS modules (fcitx, nabi and uim), fcitx engines (chewing, hangul, m17n, mozc and table-other) and ibus engines (hangul and m17n) have been added.
667544 </para>
668545 </listitem>
669546 </itemizedlist>
nixos/doc/manual/release-notes/rl-1609.xml+35−126
@@ -6,48 +6,36 @@
66 <title>Release 16.09 (“Flounder”, 2016/09/30)</title>
77
88 <para>
9− In addition to numerous new and upgraded packages, this release has the
10− following highlights:
9+ In addition to numerous new and upgraded packages, this release has the following highlights:
1110 </para>
1211
1312 <itemizedlist>
1413 <listitem>
1514 <para>
16− Many NixOS configurations and Nix packages now use significantly less disk
17− space, thanks to the
18− <link
19− xlink:href="https://github.com/NixOS/nixpkgs/issues/7117">extensive
20− work on closure size reduction</link>. For example, the closure size of a
21− minimal NixOS container went down from ~424 MiB in 16.03 to ~212 MiB in
22− 16.09, while the closure size of Firefox went from ~651 MiB to ~259 MiB.
15+ Many NixOS configurations and Nix packages now use significantly less disk space, thanks to the <link
16+ xlink:href="https://github.com/NixOS/nixpkgs/issues/7117">extensive work on closure size reduction</link>. For example, the closure size of a minimal NixOS container went down from ~424 MiB in 16.03 to ~212 MiB in 16.09, while the closure size of Firefox went from ~651 MiB to ~259 MiB.
2317 </para>
2418 </listitem>
2519 <listitem>
2620 <para>
27− To improve security, packages are now
28− <link
29− xlink:href="https://github.com/NixOS/nixpkgs/pull/12895">built
30− using various hardening features</link>. See the Nixpkgs manual for more
31− information.
21+ To improve security, packages are now <link
22+ xlink:href="https://github.com/NixOS/nixpkgs/pull/12895">built using various hardening features</link>. See the Nixpkgs manual for more information.
3223 </para>
3324 </listitem>
3425 <listitem>
3526 <para>
3627 Support for PXE netboot. See <xref
37− linkend="sec-booting-from-pxe" />
38− for documentation.
28+ linkend="sec-booting-from-pxe" /> for documentation.
3929 </para>
4030 </listitem>
4131 <listitem>
4232 <para>
43− X.org server 1.18. If you use the <literal>ati_unfree</literal> driver,
44− 1.17 is still used due to an ABI incompatibility.
33+ X.org server 1.18. If you use the <literal>ati_unfree</literal> driver, 1.17 is still used due to an ABI incompatibility.
4534 </para>
4635 </listitem>
4736 <listitem>
4837 <para>
49− This release is based on Glibc 2.24, GCC 5.4.0 and systemd 231. The default
50− Linux kernel remains 4.4.
38+ This release is based on Glibc 2.24, GCC 5.4.0 and systemd 231. The default Linux kernel remains 4.4.
5139 </para>
5240 </listitem>
5341 </itemizedlist>
@@ -65,122 +53,71 @@
6553 </itemizedlist>
6654
6755 <para>
68− When upgrading from a previous release, please be aware of the following
69− incompatible changes:
56+ When upgrading from a previous release, please be aware of the following incompatible changes:
7057 </para>
7158
7259 <itemizedlist>
7360 <listitem>
7461 <para>
75− A large number of packages have been converted to use the multiple outputs
76− feature of Nix to greatly reduce the amount of required disk space, as
77− mentioned above. This may require changes to any custom packages to make
78− them build again; see the relevant chapter in the Nixpkgs manual for more
79− information. (Additional caveat to packagers: some packaging conventions
80− related to multiple-output packages
81− <link xlink:href="https://github.com/NixOS/nixpkgs/pull/14766">were
82− changed</link> late (August 2016) in the release cycle and differ from the
83− initial introduction of multiple outputs.)
62+ A large number of packages have been converted to use the multiple outputs feature of Nix to greatly reduce the amount of required disk space, as mentioned above. This may require changes to any custom packages to make them build again; see the relevant chapter in the Nixpkgs manual for more information. (Additional caveat to packagers: some packaging conventions related to multiple-output packages <link xlink:href="https://github.com/NixOS/nixpkgs/pull/14766">were changed</link> late (August 2016) in the release cycle and differ from the initial introduction of multiple outputs.)
8463 </para>
8564 </listitem>
8665 <listitem>
8766 <para>
88− Previous versions of Nixpkgs had support for all versions of the LTS
89− Haskell package set. That support has been dropped. The previously provided
90− <literal>haskell.packages.lts-x_y</literal> package sets still exist in
91− name to aviod breaking user code, but these package sets don't actually
92− contain the versions mandated by the corresponding LTS release. Instead,
93− our package set it loosely based on the latest available LTS release, i.e.
94− LTS 7.x at the time of this writing. New releases of NixOS and Nixpkgs will
95− drop those old names entirely.
96− <link
97− xlink:href="https://nixos.org/nix-dev/2016-June/020585.html">The
98− motivation for this change</link> has been discussed at length on the
99− <literal>nix-dev</literal> mailing list and in
100− <link
101− xlink:href="https://github.com/NixOS/nixpkgs/issues/14897">Github
102− issue #14897</link>. Development strategies for Haskell hackers who want to
103− rely on Nix and NixOS have been described in
104− <link
105− xlink:href="https://nixos.org/nix-dev/2016-June/020642.html">another
106− nix-dev article</link>.
67+ Previous versions of Nixpkgs had support for all versions of the LTS Haskell package set. That support has been dropped. The previously provided <literal>haskell.packages.lts-x_y</literal> package sets still exist in name to aviod breaking user code, but these package sets don't actually contain the versions mandated by the corresponding LTS release. Instead, our package set it loosely based on the latest available LTS release, i.e. LTS 7.x at the time of this writing. New releases of NixOS and Nixpkgs will drop those old names entirely. <link
68+ xlink:href="https://nixos.org/nix-dev/2016-June/020585.html">The motivation for this change</link> has been discussed at length on the <literal>nix-dev</literal> mailing list and in <link
69+ xlink:href="https://github.com/NixOS/nixpkgs/issues/14897">Github issue #14897</link>. Development strategies for Haskell hackers who want to rely on Nix and NixOS have been described in <link
70+ xlink:href="https://nixos.org/nix-dev/2016-June/020642.html">another nix-dev article</link>.
10771 </para>
10872 </listitem>
10973 <listitem>
11074 <para>
111− Shell aliases for systemd sub-commands
112− <link xlink:href="https://github.com/NixOS/nixpkgs/pull/15598">were
113− dropped</link>: <command>start</command>, <command>stop</command>,
114− <command>restart</command>, <command>status</command>.
75+ Shell aliases for systemd sub-commands <link xlink:href="https://github.com/NixOS/nixpkgs/pull/15598">were dropped</link>: <command>start</command>, <command>stop</command>, <command>restart</command>, <command>status</command>.
11576 </para>
11677 </listitem>
11778 <listitem>
11879 <para>
119− Redis now binds to 127.0.0.1 only instead of listening to all network
120− interfaces. This is the default behavior of Redis 3.2
80+ Redis now binds to 127.0.0.1 only instead of listening to all network interfaces. This is the default behavior of Redis 3.2
12181 </para>
12282 </listitem>
12383 <listitem>
12484 <para>
125− <literal>/var/empty</literal> is now immutable. Activation script runs
126− <command>chattr +i</command> to forbid any modifications inside the folder.
127− See <link xlink:href="https://github.com/NixOS/nixpkgs/pull/18365"> the
128− pull request</link> for what bugs this caused.
85+ <literal>/var/empty</literal> is now immutable. Activation script runs <command>chattr +i</command> to forbid any modifications inside the folder. See <link xlink:href="https://github.com/NixOS/nixpkgs/pull/18365"> the pull request</link> for what bugs this caused.
12986 </para>
13087 </listitem>
13188 <listitem>
13289 <para>
133− Gitlab's maintainance script <command>gitlab-runner</command> was removed
134− and split up into the more clearer <command>gitlab-run</command> and
135− <command>gitlab-rake</command> scripts, because
136− <command>gitlab-runner</command> is a component of Gitlab CI.
90+ Gitlab's maintainance script <command>gitlab-runner</command> was removed and split up into the more clearer <command>gitlab-run</command> and <command>gitlab-rake</command> scripts, because <command>gitlab-runner</command> is a component of Gitlab CI.
13791 </para>
13892 </listitem>
13993 <listitem>
14094 <para>
141− <literal>services.xserver.libinput.accelProfile</literal> default changed
142− from <literal>flat</literal> to <literal>adaptive</literal>, as per
143− <link xlink:href="https://wayland.freedesktop.org/libinput/doc/latest/group__config.html#gad63796972347f318b180e322e35cee79">
144− official documentation</link>.
95+ <literal>services.xserver.libinput.accelProfile</literal> default changed from <literal>flat</literal> to <literal>adaptive</literal>, as per <link xlink:href="https://wayland.freedesktop.org/libinput/doc/latest/group__config.html#gad63796972347f318b180e322e35cee79"> official documentation</link>.
14596 </para>
14697 </listitem>
14798 <listitem>
14899 <para>
149− <literal>fonts.fontconfig.ultimate.rendering</literal> was removed because
150− our presets were obsolete for some time. New presets are hardcoded into
151− FreeType; you can select a preset via
152− <literal>fonts.fontconfig.ultimate.preset</literal>. You can customize
153− those presets via ordinary environment variables, using
154− <literal>environment.variables</literal>.
100+ <literal>fonts.fontconfig.ultimate.rendering</literal> was removed because our presets were obsolete for some time. New presets are hardcoded into FreeType; you can select a preset via <literal>fonts.fontconfig.ultimate.preset</literal>. You can customize those presets via ordinary environment variables, using <literal>environment.variables</literal>.
155101 </para>
156102 </listitem>
157103 <listitem>
158104 <para>
159− The <literal>audit</literal> service is no longer enabled by default. Use
160− <literal>security.audit.enable = true</literal> to explicitly enable it.
105+ The <literal>audit</literal> service is no longer enabled by default. Use <literal>security.audit.enable = true</literal> to explicitly enable it.
161106 </para>
162107 </listitem>
163108 <listitem>
164109 <para>
165− <literal>pkgs.linuxPackages.virtualbox</literal> now contains only the
166− kernel modules instead of the VirtualBox user space binaries. If you want
167− to reference the user space binaries, you have to use the new
168− <literal>pkgs.virtualbox</literal> instead.
110+ <literal>pkgs.linuxPackages.virtualbox</literal> now contains only the kernel modules instead of the VirtualBox user space binaries. If you want to reference the user space binaries, you have to use the new <literal>pkgs.virtualbox</literal> instead.
169111 </para>
170112 </listitem>
171113 <listitem>
172114 <para>
173− <literal>goPackages</literal> was replaced with separated Go applications
174− in appropriate <literal>nixpkgs</literal> categories. Each Go package uses
175− its own dependency set. There's also a new <literal>go2nix</literal> tool
176− introduced to generate a Go package definition from its Go source
177− automatically.
115+ <literal>goPackages</literal> was replaced with separated Go applications in appropriate <literal>nixpkgs</literal> categories. Each Go package uses its own dependency set. There's also a new <literal>go2nix</literal> tool introduced to generate a Go package definition from its Go source automatically.
178116 </para>
179117 </listitem>
180118 <listitem>
181119 <para>
182− <literal>services.mongodb.extraConfig</literal> configuration format was
183− changed to YAML.
120+ <literal>services.mongodb.extraConfig</literal> configuration format was changed to YAML.
184121 </para>
185122 </listitem>
186123 <listitem>
@@ -197,70 +134,42 @@
197134 <itemizedlist>
198135 <listitem>
199136 <para>
200− Revamped grsecurity/PaX support. There is now only a single general-purpose
201− distribution kernel and the configuration interface has been streamlined.
202− Desktop users should be able to simply set
137+ Revamped grsecurity/PaX support. There is now only a single general-purpose distribution kernel and the configuration interface has been streamlined. Desktop users should be able to simply set
203138<programlisting>security.grsecurity.enable = true</programlisting>
204− to get a reasonably secure system without having to sacrifice too much
205− functionality.
139+ to get a reasonably secure system without having to sacrifice too much functionality.
206140 </para>
207141 </listitem>
208142 <listitem>
209143 <para>
210− Special filesystems, like <literal>/proc</literal>, <literal>/run</literal>
211− and others, now have the same mount options as recommended by systemd and
212− are unified across different places in NixOS. Mount options are updated
213− during <command>nixos-rebuild switch</command> if possible. One benefit
214− from this is improved security — most such filesystems are now mounted
215− with <literal>noexec</literal>, <literal>nodev</literal> and/or
216− <literal>nosuid</literal> options.
144+ Special filesystems, like <literal>/proc</literal>, <literal>/run</literal> and others, now have the same mount options as recommended by systemd and are unified across different places in NixOS. Mount options are updated during <command>nixos-rebuild switch</command> if possible. One benefit from this is improved security — most such filesystems are now mounted with <literal>noexec</literal>, <literal>nodev</literal> and/or <literal>nosuid</literal> options.
217145 </para>
218146 </listitem>
219147 <listitem>
220148 <para>
221− The reverse path filter was interfering with DHCPv4 server operation in the
222− past. An exception for DHCPv4 and a new option to log packets that were
223− dropped due to the reverse path filter was added
224− (<literal>networking.firewall.logReversePathDrops</literal>) for easier
225− debugging.
149+ The reverse path filter was interfering with DHCPv4 server operation in the past. An exception for DHCPv4 and a new option to log packets that were dropped due to the reverse path filter was added (<literal>networking.firewall.logReversePathDrops</literal>) for easier debugging.
226150 </para>
227151 </listitem>
228152 <listitem>
229153 <para>
230− Containers configuration within
231− <literal>containers.&lt;name&gt;.config</literal> is
232− <link
233− xlink:href="https://github.com/NixOS/nixpkgs/pull/17365">now
234− properly typed and checked</link>. In particular, partial configurations
235− are merged correctly.
154+ Containers configuration within <literal>containers.&lt;name&gt;.config</literal> is <link
155+ xlink:href="https://github.com/NixOS/nixpkgs/pull/17365">now properly typed and checked</link>. In particular, partial configurations are merged correctly.
236156 </para>
237157 </listitem>
238158 <listitem>
239159 <para>
240− The directory container setuid wrapper programs,
241− <filename>/var/setuid-wrappers</filename>,
242− <link
243− xlink:href="https://github.com/NixOS/nixpkgs/pull/18124">is now
244− updated atomically to prevent failures if the switch to a new configuration
245− is interrupted.</link>
160+ The directory container setuid wrapper programs, <filename>/var/setuid-wrappers</filename>, <link
161+ xlink:href="https://github.com/NixOS/nixpkgs/pull/18124">is now updated atomically to prevent failures if the switch to a new configuration is interrupted.</link>
246162 </para>
247163 </listitem>
248164 <listitem>
249165 <para>
250− <literal>services.xserver.startGnuPGAgent</literal> has been removed due to
251− GnuPG 2.1.x bump. See
252− <link
253− xlink:href="https://github.com/NixOS/nixpkgs/commit/5391882ebd781149e213e8817fba6ac3c503740c">
254− how to achieve similar behavior</link>. You might need to <literal>pkill
255− gpg-agent</literal> after the upgrade to prevent a stale agent being in the
256− way.
166+ <literal>services.xserver.startGnuPGAgent</literal> has been removed due to GnuPG 2.1.x bump. See <link
167+ xlink:href="https://github.com/NixOS/nixpkgs/commit/5391882ebd781149e213e8817fba6ac3c503740c"> how to achieve similar behavior</link>. You might need to <literal>pkill gpg-agent</literal> after the upgrade to prevent a stale agent being in the way.
257168 </para>
258169 </listitem>
259170 <listitem>
260171 <para>
261− <link xlink:href="https://github.com/NixOS/nixpkgs/commit/e561edc322d275c3687fec431935095cfc717147">
262− Declarative users could share the uid due to the bug in the script handling
263− conflict resolution. </link>
172+ <link xlink:href="https://github.com/NixOS/nixpkgs/commit/e561edc322d275c3687fec431935095cfc717147"> Declarative users could share the uid due to the bug in the script handling conflict resolution. </link>
264173 </para>
265174 </listitem>
266175 <listitem>
nixos/doc/manual/release-notes/rl-1703.xml+45−148
@@ -13,29 +13,24 @@
1313 <title>Highlights</title>
1414
1515 <para>
16− In addition to numerous new and upgraded packages, this release has the
17− following highlights:
16+ In addition to numerous new and upgraded packages, this release has the following highlights:
1817 </para>
1918
2019 <itemizedlist>
2120 <listitem>
2221 <para>
23− Nixpkgs is now extensible through overlays. See the
24− <link
25− xlink:href="https://nixos.org/nixpkgs/manual/#sec-overlays-install">Nixpkgs
26− manual</link> for more information.
22+ Nixpkgs is now extensible through overlays. See the <link
23+ xlink:href="https://nixos.org/nixpkgs/manual/#sec-overlays-install">Nixpkgs manual</link> for more information.
2724 </para>
2825 </listitem>
2926 <listitem>
3027 <para>
31− This release is based on Glibc 2.25, GCC 5.4.0 and systemd 232. The
32− default Linux kernel is 4.9 and Nix is at 1.11.8.
28+ This release is based on Glibc 2.25, GCC 5.4.0 and systemd 232. The default Linux kernel is 4.9 and Nix is at 1.11.8.
3329 </para>
3430 </listitem>
3531 <listitem>
3632 <para>
37− The default desktop environment now is KDE's Plasma 5. KDE 4 has been
38− removed
33+ The default desktop environment now is KDE's Plasma 5. KDE 4 has been removed
3934 </para>
4035 </listitem>
4136 <listitem>
@@ -45,35 +40,24 @@
4540 </listitem>
4641 <listitem>
4742 <para>
48− X.org server uses branch 1.19. Due to ABI incompatibilities,
49− <literal>ati_unfree</literal> keeps forcing 1.17 and
50− <literal>amdgpu-pro</literal> starts forcing 1.18.
43+ X.org server uses branch 1.19. Due to ABI incompatibilities, <literal>ati_unfree</literal> keeps forcing 1.17 and <literal>amdgpu-pro</literal> starts forcing 1.18.
5144 </para>
5245 </listitem>
5346 <listitem>
5447 <para>
55− Cross compilation has been rewritten. See the nixpkgs manual for details.
56− The most obvious breaking change is that in derivations there is no
57− <literal>.nativeDrv</literal> nor <literal>.crossDrv</literal> are now
58− cross by default, not native.
48+ Cross compilation has been rewritten. See the nixpkgs manual for details. The most obvious breaking change is that in derivations there is no <literal>.nativeDrv</literal> nor <literal>.crossDrv</literal> are now cross by default, not native.
5949 </para>
6050 </listitem>
6151 <listitem>
6252 <para>
63− The <literal>overridePackages</literal> function has been rewritten to be
64− replaced by
65− <link
66− xlink:href="https://nixos.org/nixpkgs/manual/#sec-overlays-install">
67− overlays</link>
53+ The <literal>overridePackages</literal> function has been rewritten to be replaced by <link
54+ xlink:href="https://nixos.org/nixpkgs/manual/#sec-overlays-install"> overlays</link>
6855 </para>
6956 </listitem>
7057 <listitem>
7158 <para>
72− Packages in nixpkgs can be marked as insecure through listed
73− vulnerabilities. See the
74− <link
75− xlink:href="https://nixos.org/nixpkgs/manual/#sec-allow-insecure">Nixpkgs
76− manual</link> for more information.
59+ Packages in nixpkgs can be marked as insecure through listed vulnerabilities. See the <link
60+ xlink:href="https://nixos.org/nixpkgs/manual/#sec-allow-insecure">Nixpkgs manual</link> for more information.
7761 </para>
7862 </listitem>
7963 <listitem>
@@ -512,92 +496,64 @@
512496 <title>Backward Incompatibilities</title>
513497
514498 <para>
515− When upgrading from a previous release, please be aware of the following
516− incompatible changes:
499+ When upgrading from a previous release, please be aware of the following incompatible changes:
517500 </para>
518501
519502 <itemizedlist>
520503 <listitem>
521504 <para>
522− Derivations have no <literal>.nativeDrv</literal> nor
523− <literal>.crossDrv</literal> and are now cross by default, not native.
505+ Derivations have no <literal>.nativeDrv</literal> nor <literal>.crossDrv</literal> and are now cross by default, not native.
524506 </para>
525507 </listitem>
526508 <listitem>
527509 <para>
528− <literal>stdenv.overrides</literal> is now expected to take
529− <literal>self</literal> and <literal>super</literal> arguments. See
530− <literal>lib.trivial.extends</literal> for what those parameters
531− represent.
510+ <literal>stdenv.overrides</literal> is now expected to take <literal>self</literal> and <literal>super</literal> arguments. See <literal>lib.trivial.extends</literal> for what those parameters represent.
532511 </para>
533512 </listitem>
534513 <listitem>
535514 <para>
536− <literal>ansible</literal> now defaults to ansible version 2 as version 1
537− has been removed due to a serious
538− <link
539− xlink:href="https://www.computest.nl/advisories/CT-2017-0109_Ansible.txt">
540− vulnerability</link> unpatched by upstream.
515+ <literal>ansible</literal> now defaults to ansible version 2 as version 1 has been removed due to a serious <link
516+ xlink:href="https://www.computest.nl/advisories/CT-2017-0109_Ansible.txt"> vulnerability</link> unpatched by upstream.
541517 </para>
542518 </listitem>
543519 <listitem>
544520 <para>
545− <literal>gnome</literal> alias has been removed along with
546− <literal>gtk</literal>, <literal>gtkmm</literal> and several others. Now
547− you need to use versioned attributes, like <literal>gnome3</literal>.
521+ <literal>gnome</literal> alias has been removed along with <literal>gtk</literal>, <literal>gtkmm</literal> and several others. Now you need to use versioned attributes, like <literal>gnome3</literal>.
548522 </para>
549523 </listitem>
550524 <listitem>
551525 <para>
552− The attribute name of the Radicale daemon has been changed from
553− <literal>pythonPackages.radicale</literal> to <literal>radicale</literal>.
526+ The attribute name of the Radicale daemon has been changed from <literal>pythonPackages.radicale</literal> to <literal>radicale</literal>.
554527 </para>
555528 </listitem>
556529 <listitem>
557530 <para>
558− The <literal>stripHash</literal> bash function in
559− <literal>stdenv</literal> changed according to its documentation; it now
560− outputs the stripped name to <literal>stdout</literal> instead of putting
561− it in the variable <literal>strippedName</literal>.
531+ The <literal>stripHash</literal> bash function in <literal>stdenv</literal> changed according to its documentation; it now outputs the stripped name to <literal>stdout</literal> instead of putting it in the variable <literal>strippedName</literal>.
562532 </para>
563533 </listitem>
564534 <listitem>
565535 <para>
566− PHP now scans for extra configuration .ini files in /etc/php.d instead of
567− /etc. This prevents accidentally loading non-PHP .ini files that may be in
568− /etc.
536+ PHP now scans for extra configuration .ini files in /etc/php.d instead of /etc. This prevents accidentally loading non-PHP .ini files that may be in /etc.
569537 </para>
570538 </listitem>
571539 <listitem>
572540 <para>
573− Two lone top-level dict dbs moved into <literal>dictdDBs</literal>. This
574− affects: <literal>dictdWordnet</literal> which is now at
575− <literal>dictdDBs.wordnet</literal> and <literal>dictdWiktionary</literal>
576− which is now at <literal>dictdDBs.wiktionary</literal>
541+ Two lone top-level dict dbs moved into <literal>dictdDBs</literal>. This affects: <literal>dictdWordnet</literal> which is now at <literal>dictdDBs.wordnet</literal> and <literal>dictdWiktionary</literal> which is now at <literal>dictdDBs.wiktionary</literal>
577542 </para>
578543 </listitem>
579544 <listitem>
580545 <para>
581− Parsoid service now uses YAML configuration format.
582− <literal>service.parsoid.interwikis</literal> is now called
583− <literal>service.parsoid.wikis</literal> and is a list of either API URLs
584− or attribute sets as specified in parsoid's documentation.
546+ Parsoid service now uses YAML configuration format. <literal>service.parsoid.interwikis</literal> is now called <literal>service.parsoid.wikis</literal> and is a list of either API URLs or attribute sets as specified in parsoid's documentation.
585547 </para>
586548 </listitem>
587549 <listitem>
588550 <para>
589− <literal>Ntpd</literal> was replaced by
590− <literal>systemd-timesyncd</literal> as the default service to synchronize
591− system time with a remote NTP server. The old behavior can be restored by
592− setting <literal>services.ntp.enable</literal> to <literal>true</literal>.
593− Upstream time servers for all NTP implementations are now configured using
594− <literal>networking.timeServers</literal>.
551+ <literal>Ntpd</literal> was replaced by <literal>systemd-timesyncd</literal> as the default service to synchronize system time with a remote NTP server. The old behavior can be restored by setting <literal>services.ntp.enable</literal> to <literal>true</literal>. Upstream time servers for all NTP implementations are now configured using <literal>networking.timeServers</literal>.
595552 </para>
596553 </listitem>
597554 <listitem>
598555 <para>
599− <literal>service.nylon</literal> is now declared using named instances. As
600− an example:
556+ <literal>service.nylon</literal> is now declared using named instances. As an example:
601557<programlisting>
602558 services.nylon = {
603559 enable = true;
@@ -620,11 +576,8 @@
620576 </listitem>
621577 <listitem>
622578 <para>
623− <literal>overridePackages</literal> function no longer exists. It is
624− replaced by
625− <link
626− xlink:href="https://nixos.org/nixpkgs/manual/#sec-overlays-install">
627− overlays</link>. For example, the following code:
579+ <literal>overridePackages</literal> function no longer exists. It is replaced by <link
580+ xlink:href="https://nixos.org/nixpkgs/manual/#sec-overlays-install"> overlays</link>. For example, the following code:
628581<programlisting>
629582let
630583 pkgs = import &lt;nixpkgs&gt; {};
@@ -642,72 +595,42 @@ in
642595 </listitem>
643596 <listitem>
644597 <para>
645− Autoloading connection tracking helpers is now disabled by default. This
646− default was also changed in the Linux kernel and is considered insecure if
647− not configured properly in your firewall. If you need connection tracking
648− helpers (i.e. for active FTP) please enable
649− <literal>networking.firewall.autoLoadConntrackHelpers</literal> and tune
650− <literal>networking.firewall.connectionTrackingModules</literal> to suit
651− your needs.
598+ Autoloading connection tracking helpers is now disabled by default. This default was also changed in the Linux kernel and is considered insecure if not configured properly in your firewall. If you need connection tracking helpers (i.e. for active FTP) please enable <literal>networking.firewall.autoLoadConntrackHelpers</literal> and tune <literal>networking.firewall.connectionTrackingModules</literal> to suit your needs.
652599 </para>
653600 </listitem>
654601 <listitem>
655602 <para>
656− <literal>local_recipient_maps</literal> is not set to empty value by
657− Postfix service. It's an insecure default as stated by Postfix
658− documentation. Those who want to retain this setting need to set it via
659− <literal>services.postfix.extraConfig</literal>.
603+ <literal>local_recipient_maps</literal> is not set to empty value by Postfix service. It's an insecure default as stated by Postfix documentation. Those who want to retain this setting need to set it via <literal>services.postfix.extraConfig</literal>.
660604 </para>
661605 </listitem>
662606 <listitem>
663607 <para>
664− Iputils no longer provide ping6 and traceroute6. The functionality of
665− these tools has been integrated into ping and traceroute respectively. To
666− enforce an address family the new flags <literal>-4</literal> and
667− <literal>-6</literal> have been added. One notable incompatibility is that
668− specifying an interface (for link-local IPv6 for instance) is no longer
669− done with the <literal>-I</literal> flag, but by encoding the interface
670− into the address (<literal>ping fe80::1%eth0</literal>).
608+ Iputils no longer provide ping6 and traceroute6. The functionality of these tools has been integrated into ping and traceroute respectively. To enforce an address family the new flags <literal>-4</literal> and <literal>-6</literal> have been added. One notable incompatibility is that specifying an interface (for link-local IPv6 for instance) is no longer done with the <literal>-I</literal> flag, but by encoding the interface into the address (<literal>ping fe80::1%eth0</literal>).
671609 </para>
672610 </listitem>
673611 <listitem>
674612 <para>
675− The socket handling of the <literal>services.rmilter</literal> module has
676− been fixed and refactored. As rmilter doesn't support binding to more than
677− one socket, the options <literal>bindUnixSockets</literal> and
678− <literal>bindInetSockets</literal> have been replaced by
679− <literal>services.rmilter.bindSocket.*</literal>. The default is still a
680− unix socket in <literal>/run/rmilter/rmilter.sock</literal>. Refer to the
681− options documentation for more information.
613+ The socket handling of the <literal>services.rmilter</literal> module has been fixed and refactored. As rmilter doesn't support binding to more than one socket, the options <literal>bindUnixSockets</literal> and <literal>bindInetSockets</literal> have been replaced by <literal>services.rmilter.bindSocket.*</literal>. The default is still a unix socket in <literal>/run/rmilter/rmilter.sock</literal>. Refer to the options documentation for more information.
682614 </para>
683615 </listitem>
684616 <listitem>
685617 <para>
686− The <literal>fetch*</literal> functions no longer support md5, please use
687− sha256 instead.
618+ The <literal>fetch*</literal> functions no longer support md5, please use sha256 instead.
688619 </para>
689620 </listitem>
690621 <listitem>
691622 <para>
692− The dnscrypt-proxy module interface has been streamlined around the
693− <option>extraArgs</option> option. Where possible, legacy option
694− declarations are mapped to <option>extraArgs</option> but will emit
695− warnings. The <option>resolverList</option> has been outright removed: to
696− use an unlisted resolver, use the <option>customResolver</option> option.
623+ The dnscrypt-proxy module interface has been streamlined around the <option>extraArgs</option> option. Where possible, legacy option declarations are mapped to <option>extraArgs</option> but will emit warnings. The <option>resolverList</option> has been outright removed: to use an unlisted resolver, use the <option>customResolver</option> option.
697624 </para>
698625 </listitem>
699626 <listitem>
700627 <para>
701− torbrowser now stores local state under
702− <filename>~/.local/share/tor-browser</filename> by default. Any browser
703− profile data from the old location, <filename>~/.torbrowser4</filename>,
704− must be migrated manually.
628+ torbrowser now stores local state under <filename>~/.local/share/tor-browser</filename> by default. Any browser profile data from the old location, <filename>~/.torbrowser4</filename>, must be migrated manually.
705629 </para>
706630 </listitem>
707631 <listitem>
708632 <para>
709− The ihaskell, monetdb, offlineimap and sitecopy services have been
710− removed.
633+ The ihaskell, monetdb, offlineimap and sitecopy services have been removed.
711634 </para>
712635 </listitem>
713636 </itemizedlist>
@@ -723,18 +646,12 @@ in
723646 <itemizedlist>
724647 <listitem>
725648 <para>
726− Module type system have a new extensible option types feature that allow
727− to extend certain types, such as enum, through multiple option
728− declarations of the same option across multiple modules.
649+ Module type system have a new extensible option types feature that allow to extend certain types, such as enum, through multiple option declarations of the same option across multiple modules.
729650 </para>
730651 </listitem>
731652 <listitem>
732653 <para>
733− <literal>jre</literal> now defaults to GTK UI by default. This improves
734− visual consistency and makes Java follow system font style, improving the
735− situation on HighDPI displays. This has a cost of increased closure size;
736− for server and other headless workloads it's recommended to use
737− <literal>jre_headless</literal>.
654+ <literal>jre</literal> now defaults to GTK UI by default. This improves visual consistency and makes Java follow system font style, improving the situation on HighDPI displays. This has a cost of increased closure size; for server and other headless workloads it's recommended to use <literal>jre_headless</literal>.
738655 </para>
739656 </listitem>
740657 <listitem>
@@ -744,53 +661,37 @@ in
744661 </listitem>
745662 <listitem>
746663 <para>
747− The Python 2.7 interpreter does not use modules anymore. Instead, all
748− CPython interpreters now include the whole standard library except for
749− `tkinter`, which is available in the Python package set.
664+ The Python 2.7 interpreter does not use modules anymore. Instead, all CPython interpreters now include the whole standard library except for `tkinter`, which is available in the Python package set.
750665 </para>
751666 </listitem>
752667 <listitem>
753668 <para>
754− Python 2.7, 3.5 and 3.6 are now built deterministically and 3.4 mostly.
755− Minor modifications had to be made to the interpreters in order to
756− generate deterministic bytecode. This has security implications and is
757− relevant for those using Python in a <literal>nix-shell</literal>. See the
758− Nixpkgs manual for details.
669+ Python 2.7, 3.5 and 3.6 are now built deterministically and 3.4 mostly. Minor modifications had to be made to the interpreters in order to generate deterministic bytecode. This has security implications and is relevant for those using Python in a <literal>nix-shell</literal>. See the Nixpkgs manual for details.
759670 </para>
760671 </listitem>
761672 <listitem>
762673 <para>
763− The Python package sets now use a fixed-point combinator and the sets are
764− available as attributes of the interpreters.
674+ The Python package sets now use a fixed-point combinator and the sets are available as attributes of the interpreters.
765675 </para>
766676 </listitem>
767677 <listitem>
768678 <para>
769− The Python function <literal>buildPythonPackage</literal> has been
770− improved and can be used to build from Setuptools source, Flit source, and
771− precompiled Wheels.
679+ The Python function <literal>buildPythonPackage</literal> has been improved and can be used to build from Setuptools source, Flit source, and precompiled Wheels.
772680 </para>
773681 </listitem>
774682 <listitem>
775683 <para>
776− When adding new or updating current Python libraries, the expressions
777− should be put in separate files in
778− <literal>pkgs/development/python-modules</literal> and called from
779− <literal>python-packages.nix</literal>.
684+ When adding new or updating current Python libraries, the expressions should be put in separate files in <literal>pkgs/development/python-modules</literal> and called from <literal>python-packages.nix</literal>.
780685 </para>
781686 </listitem>
782687 <listitem>
783688 <para>
784− The dnscrypt-proxy service supports synchronizing the list of public
785− resolvers without working DNS resolution. This fixes issues caused by the
786− resolver list becoming outdated. It also improves the viability of
787− DNSCrypt only configurations.
689+ The dnscrypt-proxy service supports synchronizing the list of public resolvers without working DNS resolution. This fixes issues caused by the resolver list becoming outdated. It also improves the viability of DNSCrypt only configurations.
788690 </para>
789691 </listitem>
790692 <listitem>
791693 <para>
792− Containers using bridged networking no longer lose their connection after
793− changes to the host networking.
694+ Containers using bridged networking no longer lose their connection after changes to the host networking.
794695 </para>
795696 </listitem>
796697 <listitem>
@@ -800,16 +701,12 @@ in
800701 </listitem>
801702 <listitem>
802703 <para>
803− The bind DNS utilities (e.g. dig) have been split into their own output
804− and are now also available in <literal>pkgs.dnsutils</literal> and it is
805− no longer necessary to pull in all of <literal>bind</literal> to use them.
704+ The bind DNS utilities (e.g. dig) have been split into their own output and are now also available in <literal>pkgs.dnsutils</literal> and it is no longer necessary to pull in all of <literal>bind</literal> to use them.
806705 </para>
807706 </listitem>
808707 <listitem>
809708 <para>
810− Per-user configuration was moved from <filename>~/.nixpkgs</filename> to
811− <filename>~/.config/nixpkgs</filename>. The former is still valid for
812− <filename>config.nix</filename> for backwards compatibility.
709+ Per-user configuration was moved from <filename>~/.nixpkgs</filename> to <filename>~/.config/nixpkgs</filename>. The former is still valid for <filename>config.nix</filename> for backwards compatibility.
813710 </para>
814711 </listitem>
815712 </itemizedlist>
nixos/doc/manual/release-notes/rl-1709.xml+65−227
@@ -13,30 +13,23 @@
1313 <title>Highlights</title>
1414
1515 <para>
16− In addition to numerous new and upgraded packages, this release has the
17− following highlights:
16+ In addition to numerous new and upgraded packages, this release has the following highlights:
1817 </para>
1918
2019 <itemizedlist>
2120 <listitem>
2221 <para>
23− The GNOME version is now 3.24. KDE Plasma was upgraded to 5.10, KDE
24− Applications to 17.08.1 and KDE Frameworks to 5.37.
22+ The GNOME version is now 3.24. KDE Plasma was upgraded to 5.10, KDE Applications to 17.08.1 and KDE Frameworks to 5.37.
2523 </para>
2624 </listitem>
2725 <listitem>
2826 <para>
29− The user handling now keeps track of deallocated UIDs/GIDs. When a user or
30− group is revived, this allows it to be allocated the UID/GID it had
31− before. A consequence is that UIDs and GIDs are no longer reused.
27+ The user handling now keeps track of deallocated UIDs/GIDs. When a user or group is revived, this allows it to be allocated the UID/GID it had before. A consequence is that UIDs and GIDs are no longer reused.
3228 </para>
3329 </listitem>
3430 <listitem>
3531 <para>
36− The module option <option>services.xserver.xrandrHeads</option> now causes
37− the first head specified in this list to be set as the primary head. Apart
38− from that, it's now possible to also set additional options by using an
39− attribute set, for example:
32+ The module option <option>services.xserver.xrandrHeads</option> now causes the first head specified in this list to be set as the primary head. Apart from that, it's now possible to also set additional options by using an attribute set, for example:
4033<programlisting>
4134{ services.xserver.xrandrHeads = [
4235 "HDMI-0"
@@ -50,36 +43,21 @@
5043 ];
5144}
5245</programlisting>
53− This will set the <literal>DVI-0</literal> output to be the primary head,
54− even though <literal>HDMI-0</literal> is the first head in the list.
46+ This will set the <literal>DVI-0</literal> output to be the primary head, even though <literal>HDMI-0</literal> is the first head in the list.
5547 </para>
5648 </listitem>
5749 <listitem>
5850 <para>
59− The handling of SSL in the <literal>services.nginx</literal> module has
60− been cleaned up, renaming the misnamed <literal>enableSSL</literal> to
61− <literal>onlySSL</literal> which reflects its original intention. This is
62− not to be used with the already existing <literal>forceSSL</literal> which
63− creates a second non-SSL virtual host redirecting to the SSL virtual host.
64− This by chance had worked earlier due to specific implementation details.
65− In case you had specified both please remove the
66− <literal>enableSSL</literal> option to keep the previous behaviour.
51+ The handling of SSL in the <literal>services.nginx</literal> module has been cleaned up, renaming the misnamed <literal>enableSSL</literal> to <literal>onlySSL</literal> which reflects its original intention. This is not to be used with the already existing <literal>forceSSL</literal> which creates a second non-SSL virtual host redirecting to the SSL virtual host. This by chance had worked earlier due to specific implementation details. In case you had specified both please remove the <literal>enableSSL</literal> option to keep the previous behaviour.
6752 </para>
6853 <para>
69− Another <literal>addSSL</literal> option has been introduced to configure
70− both a non-SSL virtual host and an SSL virtual host with the same
71− configuration.
54+ Another <literal>addSSL</literal> option has been introduced to configure both a non-SSL virtual host and an SSL virtual host with the same configuration.
7255 </para>
7356 <para>
74− Options to configure <literal>resolver</literal> options and
75− <literal>upstream</literal> blocks have been introduced. See their
76− information for further details.
57+ Options to configure <literal>resolver</literal> options and <literal>upstream</literal> blocks have been introduced. See their information for further details.
7758 </para>
7859 <para>
79− The <literal>port</literal> option has been replaced by a more generic
80− <literal>listen</literal> option which makes it possible to specify
81− multiple addresses, ports and SSL configs dependant on the new SSL
82− handling mentioned above.
60+ The <literal>port</literal> option has been replaced by a more generic <literal>listen</literal> option which makes it possible to specify multiple addresses, ports and SSL configs dependant on the new SSL handling mentioned above.
8361 </para>
8462 </listitem>
8563 </itemizedlist>
@@ -468,47 +446,31 @@
468446 <title>Backward Incompatibilities</title>
469447
470448 <para>
471− When upgrading from a previous release, please be aware of the following
472− incompatible changes:
449+ When upgrading from a previous release, please be aware of the following incompatible changes:
473450 </para>
474451
475452 <itemizedlist>
476453 <listitem>
477454 <para>
478− <emphasis role="strong"> In an Qemu-based virtualization environment, the
479− network interface names changed from i.e. <literal>enp0s3</literal> to
480− <literal>ens3</literal>. </emphasis>
455+ <emphasis role="strong"> In an Qemu-based virtualization environment, the network interface names changed from i.e. <literal>enp0s3</literal> to <literal>ens3</literal>. </emphasis>
481456 </para>
482457 <para>
483− This is due to a kernel configuration change. The new naming is consistent
484− with those of other Linux distributions with systemd. See
485− <link xlink:href="https://github.com/NixOS/nixpkgs/issues/29197">#29197</link>
486− for more information.
458+ This is due to a kernel configuration change. The new naming is consistent with those of other Linux distributions with systemd. See <link xlink:href="https://github.com/NixOS/nixpkgs/issues/29197">#29197</link> for more information.
487459 </para>
488460 <para>
489− A machine is affected if the <literal>virt-what</literal> tool either
490− returns <literal>qemu</literal> or <literal>kvm</literal>
491− <emphasis>and</emphasis> has interface names used in any part of its NixOS
492− configuration, in particular if a static network configuration with
493− <literal>networking.interfaces</literal> is used.
461+ A machine is affected if the <literal>virt-what</literal> tool either returns <literal>qemu</literal> or <literal>kvm</literal> <emphasis>and</emphasis> has interface names used in any part of its NixOS configuration, in particular if a static network configuration with <literal>networking.interfaces</literal> is used.
494462 </para>
495463 <para>
496464 Before rebooting affected machines, please ensure:
497465 <itemizedlist>
498466 <listitem>
499467 <para>
500− Change the interface names in your NixOS configuration. The first
501− interface will be called <literal>ens3</literal>, the second one
502− <literal>ens8</literal> and starting from there incremented by 1.
468+ Change the interface names in your NixOS configuration. The first interface will be called <literal>ens3</literal>, the second one <literal>ens8</literal> and starting from there incremented by 1.
503469 </para>
504470 </listitem>
505471 <listitem>
506472 <para>
507− After changing the interface names, rebuild your system with
508− <literal>nixos-rebuild boot</literal> to activate the new configuration
509− after a reboot. If you switch to the new configuration right away you
510− might lose network connectivity! If using <literal>nixops</literal>,
511− deploy with <literal>nixops deploy --force-reboot</literal>.
473+ After changing the interface names, rebuild your system with <literal>nixos-rebuild boot</literal> to activate the new configuration after a reboot. If you switch to the new configuration right away you might lose network connectivity! If using <literal>nixops</literal>, deploy with <literal>nixops deploy --force-reboot</literal>.
512474 </para>
513475 </listitem>
514476 </itemizedlist>
@@ -516,88 +478,59 @@
516478 </listitem>
517479 <listitem>
518480 <para>
519− The following changes apply if the <literal>stateVersion</literal> is
520− changed to 17.09 or higher. For <literal>stateVersion = "17.03"</literal>
521− or lower the old behavior is preserved.
481+ The following changes apply if the <literal>stateVersion</literal> is changed to 17.09 or higher. For <literal>stateVersion = "17.03"</literal> or lower the old behavior is preserved.
522482 </para>
523483 <itemizedlist>
524484 <listitem>
525485 <para>
526− The <literal>postgres</literal> default version was changed from 9.5 to
527− 9.6.
486+ The <literal>postgres</literal> default version was changed from 9.5 to 9.6.
528487 </para>
529488 </listitem>
530489 <listitem>
531490 <para>
532− The <literal>postgres</literal> superuser name has changed from
533− <literal>root</literal> to <literal>postgres</literal> to more closely
534− follow what other Linux distributions are doing.
491+ The <literal>postgres</literal> superuser name has changed from <literal>root</literal> to <literal>postgres</literal> to more closely follow what other Linux distributions are doing.
535492 </para>
536493 </listitem>
537494 <listitem>
538495 <para>
539− The <literal>postgres</literal> default <literal>dataDir</literal> has
540− changed from <literal>/var/db/postgres</literal> to
541− <literal>/var/lib/postgresql/$psqlSchema</literal> where $psqlSchema is
542− 9.6 for example.
496+ The <literal>postgres</literal> default <literal>dataDir</literal> has changed from <literal>/var/db/postgres</literal> to <literal>/var/lib/postgresql/$psqlSchema</literal> where $psqlSchema is 9.6 for example.
543497 </para>
544498 </listitem>
545499 <listitem>
546500 <para>
547− The <literal>mysql</literal> default <literal>dataDir</literal> has
548− changed from <literal>/var/mysql</literal> to
549− <literal>/var/lib/mysql</literal>.
501+ The <literal>mysql</literal> default <literal>dataDir</literal> has changed from <literal>/var/mysql</literal> to <literal>/var/lib/mysql</literal>.
550502 </para>
551503 </listitem>
552504 <listitem>
553505 <para>
554− Radicale's default package has changed from 1.x to 2.x. Instructions to
555− migrate can be found <link xlink:href="http://radicale.org/1to2/"> here
556− </link>. It is also possible to use the newer version by setting the
557− <literal>package</literal> to <literal>radicale2</literal>, which is
558− done automatically when <literal>stateVersion</literal> is 17.09 or
559− higher. The <literal>extraArgs</literal> option has been added to allow
560− passing the data migration arguments specified in the instructions; see
561− the
562− <filename xlink:href="https://github.com/NixOS/nixpkgs/blob/master/nixos/tests/radicale.nix">radicale.nix</filename>
563− NixOS test for an example migration.
506+ Radicale's default package has changed from 1.x to 2.x. Instructions to migrate can be found <link xlink:href="http://radicale.org/1to2/"> here </link>. It is also possible to use the newer version by setting the <literal>package</literal> to <literal>radicale2</literal>, which is done automatically when <literal>stateVersion</literal> is 17.09 or higher. The <literal>extraArgs</literal> option has been added to allow passing the data migration arguments specified in the instructions; see the <filename xlink:href="https://github.com/NixOS/nixpkgs/blob/master/nixos/tests/radicale.nix">radicale.nix</filename> NixOS test for an example migration.
564507 </para>
565508 </listitem>
566509 </itemizedlist>
567510 </listitem>
568511 <listitem>
569512 <para>
570− The <literal>aiccu</literal> package was removed. This is due to SixXS
571− <link xlink:href="https://www.sixxs.net/main/"> sunsetting</link> its IPv6
572− tunnel.
513+ The <literal>aiccu</literal> package was removed. This is due to SixXS <link xlink:href="https://www.sixxs.net/main/"> sunsetting</link> its IPv6 tunnel.
573514 </para>
574515 </listitem>
575516 <listitem>
576517 <para>
577− The <literal>fanctl</literal> package and <literal>fan</literal> module
578− have been removed due to the developers not upstreaming their iproute2
579− patches and lagging with compatibility to recent iproute2 versions.
518+ The <literal>fanctl</literal> package and <literal>fan</literal> module have been removed due to the developers not upstreaming their iproute2 patches and lagging with compatibility to recent iproute2 versions.
580519 </para>
581520 </listitem>
582521 <listitem>
583522 <para>
584− Top-level <literal>idea</literal> package collection was renamed. All
585− JetBrains IDEs are now at <literal>jetbrains</literal>.
523+ Top-level <literal>idea</literal> package collection was renamed. All JetBrains IDEs are now at <literal>jetbrains</literal>.
586524 </para>
587525 </listitem>
588526 <listitem>
589527 <para>
590− <literal>flexget</literal>'s state database cannot be upgraded to its new
591− internal format, requiring removal of any existing
592− <literal>db-config.sqlite</literal> which will be automatically recreated.
528+ <literal>flexget</literal>'s state database cannot be upgraded to its new internal format, requiring removal of any existing <literal>db-config.sqlite</literal> which will be automatically recreated.
593529 </para>
594530 </listitem>
595531 <listitem>
596532 <para>
597− The <literal>ipfs</literal> service now doesn't ignore the
598− <literal>dataDir</literal> option anymore. If you've ever set this option
599− to anything other than the default you'll have to either unset it (so the
600− default gets used) or migrate the old data manually with
533+ The <literal>ipfs</literal> service now doesn't ignore the <literal>dataDir</literal> option anymore. If you've ever set this option to anything other than the default you'll have to either unset it (so the default gets used) or migrate the old data manually with
601534<programlisting>
602535dataDir=&lt;valueOfDataDir&gt;
603536mv /var/lib/ipfs/.ipfs/* $dataDir
@@ -607,107 +540,66 @@ rmdir /var/lib/ipfs/.ipfs
607540 </listitem>
608541 <listitem>
609542 <para>
610− The <literal>caddy</literal> service was previously using an extra
611− <literal>.caddy</literal> directory in the data directory specified with
612− the <literal>dataDir</literal> option. The contents of the
613− <literal>.caddy</literal> directory are now expected to be in the
614− <literal>dataDir</literal>.
543+ The <literal>caddy</literal> service was previously using an extra <literal>.caddy</literal> directory in the data directory specified with the <literal>dataDir</literal> option. The contents of the <literal>.caddy</literal> directory are now expected to be in the <literal>dataDir</literal>.
615544 </para>
616545 </listitem>
617546 <listitem>
618547 <para>
619− The <literal>ssh-agent</literal> user service is not started by default
620− anymore. Use <literal>programs.ssh.startAgent</literal> to enable it if
621− needed. There is also a new <literal>programs.gnupg.agent</literal> module
622− that creates a <literal>gpg-agent</literal> user service. It can also
623− serve as a SSH agent if <literal>enableSSHSupport</literal> is set.
548+ The <literal>ssh-agent</literal> user service is not started by default anymore. Use <literal>programs.ssh.startAgent</literal> to enable it if needed. There is also a new <literal>programs.gnupg.agent</literal> module that creates a <literal>gpg-agent</literal> user service. It can also serve as a SSH agent if <literal>enableSSHSupport</literal> is set.
624549 </para>
625550 </listitem>
626551 <listitem>
627552 <para>
628− The <literal>services.tinc.networks.&lt;name&gt;.listenAddress</literal>
629− option had a misleading name that did not correspond to its behavior. It
630− now correctly defines the ip to listen for incoming connections on. To
631− keep the previous behaviour, use
632− <literal>services.tinc.networks.&lt;name&gt;.bindToAddress</literal>
633− instead. Refer to the description of the options for more details.
553+ The <literal>services.tinc.networks.&lt;name&gt;.listenAddress</literal> option had a misleading name that did not correspond to its behavior. It now correctly defines the ip to listen for incoming connections on. To keep the previous behaviour, use <literal>services.tinc.networks.&lt;name&gt;.bindToAddress</literal> instead. Refer to the description of the options for more details.
634554 </para>
635555 </listitem>
636556 <listitem>
637557 <para>
638− <literal>tlsdate</literal> package and module were removed. This is due to
639− the project being dead and not building with openssl 1.1.
558+ <literal>tlsdate</literal> package and module were removed. This is due to the project being dead and not building with openssl 1.1.
640559 </para>
641560 </listitem>
642561 <listitem>
643562 <para>
644− <literal>wvdial</literal> package and module were removed. This is due to
645− the project being dead and not building with openssl 1.1.
563+ <literal>wvdial</literal> package and module were removed. This is due to the project being dead and not building with openssl 1.1.
646564 </para>
647565 </listitem>
648566 <listitem>
649567 <para>
650− <literal>cc-wrapper</literal>'s setup-hook now exports a number of
651− environment variables corresponding to binutils binaries, (e.g.
652− <envar>LD</envar>, <envar>STRIP</envar>, <envar>RANLIB</envar>, etc). This
653− is done to prevent packages' build systems guessing, which is harder to
654− predict, especially when cross-compiling. However, some packages have
655− broken due to this—their build systems either not supporting, or
656− claiming to support without adequate testing, taking such environment
657− variables as parameters.
568+ <literal>cc-wrapper</literal>'s setup-hook now exports a number of environment variables corresponding to binutils binaries, (e.g. <envar>LD</envar>, <envar>STRIP</envar>, <envar>RANLIB</envar>, etc). This is done to prevent packages' build systems guessing, which is harder to predict, especially when cross-compiling. However, some packages have broken due to this—their build systems either not supporting, or claiming to support without adequate testing, taking such environment variables as parameters.
658569 </para>
659570 </listitem>
660571 <listitem>
661572 <para>
662− <literal>services.firefox.syncserver</literal> now runs by default as a
663− non-root user. To accomodate this change, the default sqlite database
664− location has also been changed. Migration should work automatically. Refer
665− to the description of the options for more details.
573+ <literal>services.firefox.syncserver</literal> now runs by default as a non-root user. To accomodate this change, the default sqlite database location has also been changed. Migration should work automatically. Refer to the description of the options for more details.
666574 </para>
667575 </listitem>
668576 <listitem>
669577 <para>
670− The <literal>compiz</literal> window manager and package was removed. The
671− system support had been broken for several years.
578+ The <literal>compiz</literal> window manager and package was removed. The system support had been broken for several years.
672579 </para>
673580 </listitem>
674581 <listitem>
675582 <para>
676− Touchpad support should now be enabled through <literal>libinput</literal>
677− as <literal>synaptics</literal> is now deprecated. See the option
678− <literal>services.xserver.libinput.enable</literal>.
583+ Touchpad support should now be enabled through <literal>libinput</literal> as <literal>synaptics</literal> is now deprecated. See the option <literal>services.xserver.libinput.enable</literal>.
679584 </para>
680585 </listitem>
681586 <listitem>
682587 <para>
683− grsecurity/PaX support has been dropped, following upstream's decision to
684− cease free support. See
685− <link xlink:href="https://grsecurity.net/passing_the_baton.php">
686− upstream's announcement</link> for more information. No complete
687− replacement for grsecurity/PaX is available presently.
588+ grsecurity/PaX support has been dropped, following upstream's decision to cease free support. See <link xlink:href="https://grsecurity.net/passing_the_baton.php"> upstream's announcement</link> for more information. No complete replacement for grsecurity/PaX is available presently.
688589 </para>
689590 </listitem>
690591 <listitem>
691592 <para>
692− <literal>services.mysql</literal> now has declarative configuration of
693− databases and users with the <literal>ensureDatabases</literal> and
694− <literal>ensureUsers</literal> options.
593+ <literal>services.mysql</literal> now has declarative configuration of databases and users with the <literal>ensureDatabases</literal> and <literal>ensureUsers</literal> options.
695594 </para>
696595 <para>
697− These options will never delete existing databases and users, especially
698− not when the value of the options are changed.
596+ These options will never delete existing databases and users, especially not when the value of the options are changed.
699597 </para>
700598 <para>
701− The MySQL users will be identified using
702− <link xlink:href="https://mariadb.com/kb/en/library/authentication-plugin-unix-socket/">
703− Unix socket authentication</link>. This authenticates the Unix user with
704− the same name only, and that without the need for a password.
599+ The MySQL users will be identified using <link xlink:href="https://mariadb.com/kb/en/library/authentication-plugin-unix-socket/"> Unix socket authentication</link>. This authenticates the Unix user with the same name only, and that without the need for a password.
705600 </para>
706601 <para>
707− If you have previously created a MySQL <literal>root</literal> user
708− <emphasis>with a password</emphasis>, you will need to add
709− <literal>root</literal> user for unix socket authentication before using
710− the new options. This can be done by running the following SQL script:
602+ If you have previously created a MySQL <literal>root</literal> user <emphasis>with a password</emphasis>, you will need to add <literal>root</literal> user for unix socket authentication before using the new options. This can be done by running the following SQL script:
711603<programlisting language="sql">
712604CREATE USER 'root'@'%' IDENTIFIED BY '';
713605GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;
@@ -720,55 +612,38 @@ FLUSH PRIVILEGES;
720612 </listitem>
721613 <listitem>
722614 <para>
723− <literal>services.mysqlBackup</literal> now works by default without any
724− user setup, including for users other than <literal>mysql</literal>.
615+ <literal>services.mysqlBackup</literal> now works by default without any user setup, including for users other than <literal>mysql</literal>.
725616 </para>
726617 <para>
727− By default, the <literal>mysql</literal> user is no longer the user which
728− performs the backup. Instead a system account
729− <literal>mysqlbackup</literal> is used.
618+ By default, the <literal>mysql</literal> user is no longer the user which performs the backup. Instead a system account <literal>mysqlbackup</literal> is used.
730619 </para>
731620 <para>
732− The <literal>mysqlBackup</literal> service is also now using systemd
733− timers instead of <literal>cron</literal>.
621+ The <literal>mysqlBackup</literal> service is also now using systemd timers instead of <literal>cron</literal>.
734622 </para>
735623 <para>
736− Therefore, the <literal>services.mysqlBackup.period</literal> option no
737− longer exists, and has been replaced with
738− <literal>services.mysqlBackup.calendar</literal>, which is in the format
739− of
740− <link
624+ Therefore, the <literal>services.mysqlBackup.period</literal> option no longer exists, and has been replaced with <literal>services.mysqlBackup.calendar</literal>, which is in the format of <link
741625 xlink:href="https://www.freedesktop.org/software/systemd/man/systemd.time.html#Calendar%20Events">systemd.time(7)</link>.
742626 </para>
743627 <para>
744− If you expect to be sent an e-mail when the backup fails, consider using a
745− script which monitors the systemd journal for errors. Regretfully, at
746− present there is no built-in functionality for this.
628+ If you expect to be sent an e-mail when the backup fails, consider using a script which monitors the systemd journal for errors. Regretfully, at present there is no built-in functionality for this.
747629 </para>
748630 <para>
749− You can check that backups still work by running <command>systemctl start
750− mysql-backup</command> then <command>systemctl status
751− mysql-backup</command>.
631+ You can check that backups still work by running <command>systemctl start mysql-backup</command> then <command>systemctl status mysql-backup</command>.
752632 </para>
753633 </listitem>
754634 <listitem>
755635 <para>
756− Templated systemd services e.g <literal>container@name</literal> are now
757− handled currectly when switching to a new configuration, resulting in them
758− being reloaded.
636+ Templated systemd services e.g <literal>container@name</literal> are now handled currectly when switching to a new configuration, resulting in them being reloaded.
759637 </para>
760638 </listitem>
761639 <listitem>
762640 <para>
763− Steam: the <literal>newStdcpp</literal> parameter was removed and should
764− not be needed anymore.
641+ Steam: the <literal>newStdcpp</literal> parameter was removed and should not be needed anymore.
765642 </para>
766643 </listitem>
767644 <listitem>
768645 <para>
769− Redis has been updated to version 4 which mandates a cluster mass-restart,
770− due to changes in the network handling, in order to ensure compatibility
771− with networks NATing traffic.
646+ Redis has been updated to version 4 which mandates a cluster mass-restart, due to changes in the network handling, in order to ensure compatibility with networks NATing traffic.
772647 </para>
773648 </listitem>
774649 </itemizedlist>
@@ -784,46 +659,28 @@ FLUSH PRIVILEGES;
784659 <itemizedlist>
785660 <listitem>
786661 <para>
787− Modules can now be disabled by using
788− <link
789− xlink:href="https://nixos.org/nixpkgs/manual/#sec-replace-modules">
790− disabledModules</link>, allowing another to take it's place. This can be
791− used to import a set of modules from another channel while keeping the
792− rest of the system on a stable release.
662+ Modules can now be disabled by using <link
663+ xlink:href="https://nixos.org/nixpkgs/manual/#sec-replace-modules"> disabledModules</link>, allowing another to take it's place. This can be used to import a set of modules from another channel while keeping the rest of the system on a stable release.
793664 </para>
794665 </listitem>
795666 <listitem>
796667 <para>
797− Updated to FreeType 2.7.1, including a new TrueType engine. The new engine
798− replaces the Infinality engine which was the default in NixOS. The default
799− font rendering settings are now provided by fontconfig-penultimate,
800− replacing fontconfig-ultimate; the new defaults are less invasive and
801− provide rendering that is more consistent with other systems and hopefully
802− with each font designer's intent. Some system-wide configuration has been
803− removed from the Fontconfig NixOS module where user Fontconfig settings
804− are available.
668+ Updated to FreeType 2.7.1, including a new TrueType engine. The new engine replaces the Infinality engine which was the default in NixOS. The default font rendering settings are now provided by fontconfig-penultimate, replacing fontconfig-ultimate; the new defaults are less invasive and provide rendering that is more consistent with other systems and hopefully with each font designer's intent. Some system-wide configuration has been removed from the Fontconfig NixOS module where user Fontconfig settings are available.
805669 </para>
806670 </listitem>
807671 <listitem>
808672 <para>
809− ZFS/SPL have been updated to 0.7.0, <literal>zfsUnstable,
810− splUnstable</literal> have therefore been removed.
673+ ZFS/SPL have been updated to 0.7.0, <literal>zfsUnstable, splUnstable</literal> have therefore been removed.
811674 </para>
812675 </listitem>
813676 <listitem>
814677 <para>
815− The <option>time.timeZone</option> option now allows the value
816− <literal>null</literal> in addition to timezone strings. This value allows
817− changing the timezone of a system imperatively using <command>timedatectl
818− set-timezone</command>. The default timezone is still UTC.
678+ The <option>time.timeZone</option> option now allows the value <literal>null</literal> in addition to timezone strings. This value allows changing the timezone of a system imperatively using <command>timedatectl set-timezone</command>. The default timezone is still UTC.
819679 </para>
820680 </listitem>
821681 <listitem>
822682 <para>
823− Nixpkgs overlays may now be specified with a file as well as a directory.
824− The value of <literal>&lt;nixpkgs-overlays></literal> may be a file, and
825− <filename>~/.config/nixpkgs/overlays.nix</filename> can be used instead of
826− the <filename>~/.config/nixpkgs/overlays</filename> directory.
683+ Nixpkgs overlays may now be specified with a file as well as a directory. The value of <literal>&lt;nixpkgs-overlays></literal> may be a file, and <filename>~/.config/nixpkgs/overlays.nix</filename> can be used instead of the <filename>~/.config/nixpkgs/overlays</filename> directory.
827684 </para>
828685 <para>
829686 See the overlays chapter of the Nixpkgs manual for more details.
@@ -831,67 +688,48 @@ FLUSH PRIVILEGES;
831688 </listitem>
832689 <listitem>
833690 <para>
834− Definitions for <filename>/etc/hosts</filename> can now be specified
835− declaratively with <literal>networking.hosts</literal>.
691+ Definitions for <filename>/etc/hosts</filename> can now be specified declaratively with <literal>networking.hosts</literal>.
836692 </para>
837693 </listitem>
838694 <listitem>
839695 <para>
840− Two new options have been added to the installer loader, in addition to
841− the default having changed. The kernel log verbosity has been lowered to
842− the upstream default for the default options, in order to not spam the
843− console when e.g. joining a network.
696+ Two new options have been added to the installer loader, in addition to the default having changed. The kernel log verbosity has been lowered to the upstream default for the default options, in order to not spam the console when e.g. joining a network.
844697 </para>
845698 <para>
846− This therefore leads to adding a new <literal>debug</literal> option to
847− set the log level to the previous verbose mode, to make debugging easier,
848− but still accessible easily.
699+ This therefore leads to adding a new <literal>debug</literal> option to set the log level to the previous verbose mode, to make debugging easier, but still accessible easily.
849700 </para>
850701 <para>
851− Additionally a <literal>copytoram</literal> option has been added, which
852− makes it possible to remove the install medium after booting. This allows
853− tethering from your phone after booting from it.
702+ Additionally a <literal>copytoram</literal> option has been added, which makes it possible to remove the install medium after booting. This allows tethering from your phone after booting from it.
854703 </para>
855704 </listitem>
856705 <listitem>
857706 <para>
858− <literal>services.gitlab-runner.configOptions</literal> has been added to
859− specify the configuration of gitlab-runners declaratively.
707+ <literal>services.gitlab-runner.configOptions</literal> has been added to specify the configuration of gitlab-runners declaratively.
860708 </para>
861709 </listitem>
862710 <listitem>
863711 <para>
864− <literal>services.jenkins.plugins</literal> has been added to install
865− plugins easily, this can be generated with jenkinsPlugins2nix.
712+ <literal>services.jenkins.plugins</literal> has been added to install plugins easily, this can be generated with jenkinsPlugins2nix.
866713 </para>
867714 </listitem>
868715 <listitem>
869716 <para>
870− <literal>services.postfix.config</literal> has been added to specify the
871− main.cf with NixOS options. Additionally other options have been added to
872− the postfix module and has been improved further.
717+ <literal>services.postfix.config</literal> has been added to specify the main.cf with NixOS options. Additionally other options have been added to the postfix module and has been improved further.
873718 </para>
874719 </listitem>
875720 <listitem>
876721 <para>
877− The GitLab package and module have been updated to the latest 10.0
878− release.
722+ The GitLab package and module have been updated to the latest 10.0 release.
879723 </para>
880724 </listitem>
881725 <listitem>
882726 <para>
883− The <literal>systemd-boot</literal> boot loader now lists the NixOS
884− version, kernel version and build date of all bootable generations.
727+ The <literal>systemd-boot</literal> boot loader now lists the NixOS version, kernel version and build date of all bootable generations.
885728 </para>
886729 </listitem>
887730 <listitem>
888731 <para>
889− The dnscrypt-proxy service now defaults to using a random upstream
890− resolver, selected from the list of public non-logging resolvers with
891− DNSSEC support. Existing configurations can be migrated to this mode of
892− operation by omitting the
893− <option>services.dnscrypt-proxy.resolverName</option> option or setting it
894− to <literal>"random"</literal>.
732+ The dnscrypt-proxy service now defaults to using a random upstream resolver, selected from the list of public non-logging resolvers with DNSSEC support. Existing configurations can be migrated to this mode of operation by omitting the <option>services.dnscrypt-proxy.resolverName</option> option or setting it to <literal>"random"</literal>.
895733 </para>
896734 </listitem>
897735 </itemizedlist>
nixos/doc/manual/release-notes/rl-1803.xml+56−210

This diff is too big to show here.

nixos/doc/manual/release-notes/rl-1809.xml+69−242

This diff is too big to show here.

nixos/doc/manual/release-notes/rl-1903.xml+82−366

This diff is too big to show here.

nixos/doc/manual/release-notes/rl-1909.xml+325−406

This diff is too big to show here.

nixos/doc/manual/release-notes/rl-2003.xml+2−5

This diff is too big to show here.

nixos/doc/xmlformat.conf−1

This diff is too big to show here.

nixos/modules/i18n/input-method/default.xml+20−54

This diff is too big to show here.

nixos/modules/programs/digitalbitbox/doc.xml+9−24

This diff is too big to show here.

nixos/modules/programs/plotinus.xml+4−9

This diff is too big to show here.

nixos/modules/programs/zsh/oh-my-zsh.xml+13−49

This diff is too big to show here.

nixos/modules/security/acme.xml+7−23

This diff is too big to show here.

nixos/modules/security/hidepid.xml+3−8

This diff is too big to show here.

nixos/modules/services/databases/foundationdb.xml+39−158

This diff is too big to show here.

nixos/modules/services/databases/postgresql.xml+13−26

This diff is too big to show here.

nixos/modules/services/desktops/flatpak.xml+7−18

This diff is too big to show here.

nixos/modules/services/editors/emacs.xml+51−170

This diff is too big to show here.

nixos/modules/services/hardware/trezord.xml+2−8

This diff is too big to show here.

nixos/modules/services/misc/gitlab.xml+8−26

This diff is too big to show here.

nixos/modules/services/misc/taskserver/doc.xml+18−56

This diff is too big to show here.

nixos/modules/services/misc/weechat.xml+5−16

This diff is too big to show here.

nixos/modules/services/monitoring/prometheus/exporters.xml+12−39

This diff is too big to show here.

nixos/modules/services/networking/dnscrypt-proxy.xml+3−11

This diff is too big to show here.

nixos/modules/services/web-apps/matomo-doc.xml+11−45

This diff is too big to show here.

nixos/modules/services/web-apps/nextcloud.xml+14−41

This diff is too big to show here.