summary refs log tree commit diff
path: root/doc
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2018-05-03 16:24:30 -0400
committerJohn Ericson <John.Ericson@Obsidian.Systems>2018-05-03 16:35:36 -0400
commitcf06e42d1cad2732ca23264dee19bbc0d7172b3b (patch)
tree624d0854c8f07c4d3ba2eb28590076b0486684a3 /doc
parentcbe21ac614285160a18fe21b8a804f3a2f80c51b (diff)
parentb45ef79b74d267891a11c1775a473c610ecebe78 (diff)
downloadnixpkgs-cf06e42d1cad2732ca23264dee19bbc0d7172b3b.tar
nixpkgs-cf06e42d1cad2732ca23264dee19bbc0d7172b3b.tar.gz
nixpkgs-cf06e42d1cad2732ca23264dee19bbc0d7172b3b.tar.bz2
nixpkgs-cf06e42d1cad2732ca23264dee19bbc0d7172b3b.tar.lz
nixpkgs-cf06e42d1cad2732ca23264dee19bbc0d7172b3b.tar.xz
nixpkgs-cf06e42d1cad2732ca23264dee19bbc0d7172b3b.tar.zst
nixpkgs-cf06e42d1cad2732ca23264dee19bbc0d7172b3b.zip
Merge remote-tracking branch 'upstream/master' into staging
Diffstat (limited to 'doc')
-rw-r--r--doc/Makefile7
-rw-r--r--doc/coding-conventions.xml1214
-rw-r--r--doc/configuration.xml569
-rw-r--r--doc/contributing.xml38
-rw-r--r--doc/cross-compilation.xml689
-rw-r--r--doc/default.nix3
-rw-r--r--doc/functions.xml1111
-rw-r--r--doc/languages-frameworks/beam.xml500
-rw-r--r--doc/languages-frameworks/bower.xml289
-rw-r--r--doc/languages-frameworks/coq.xml60
-rw-r--r--doc/languages-frameworks/go.xml174
-rw-r--r--doc/languages-frameworks/index.xml59
-rw-r--r--doc/languages-frameworks/java.xml84
-rw-r--r--doc/languages-frameworks/lua.xml43
-rw-r--r--doc/languages-frameworks/perl.xml233
-rw-r--r--doc/languages-frameworks/qt.xml108
-rw-r--r--doc/languages-frameworks/ruby.xml92
-rw-r--r--doc/languages-frameworks/texlive.xml108
-rw-r--r--doc/manual.xml47
-rw-r--r--doc/meta.xml544
-rw-r--r--doc/multiple-output.xml382
-rw-r--r--doc/overlays.xml256
-rw-r--r--doc/package-notes.xml927
-rw-r--r--doc/platform-notes.xml84
-rw-r--r--doc/quick-start.xml372
-rw-r--r--doc/release-notes.xml1353
-rw-r--r--doc/reviewing-contributions.xml739
-rw-r--r--doc/shell.nix1
-rw-r--r--doc/stdenv.xml4160
-rw-r--r--doc/submitting-changes.xml860
30 files changed, 8273 insertions, 6833 deletions
diff --git a/doc/Makefile b/doc/Makefile
index 952ef4bfcbb..8a4612e95f1 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -1,12 +1,17 @@
 MD_TARGETS=$(addsuffix .xml, $(basename $(wildcard ./*.md ./**/*.md)))
 
 .PHONY: all
-all: validate out/html/index.html out/epub/manual.epub
+all: validate format out/html/index.html out/epub/manual.epub
 
 .PHONY: debug
 debug:
 	nix-shell --run "xmloscopy --docbook5 ./manual.xml ./manual-full.xml"
 
+.PHONY: format
+format:
+	find . -iname '*.xml' -type f -print0 | xargs -0 -I{} -n1 \
+		xmlformat --config-file "$$XMLFORMAT_CONFIG" -i {}
+
 .PHONY: clean
 clean:
 	rm -f ${MD_TARGETS} .version manual-full.xml
diff --git a/doc/coding-conventions.xml b/doc/coding-conventions.xml
index d556c7ebe1e..f244c11d4f2 100644
--- a/doc/coding-conventions.xml
+++ b/doc/coding-conventions.xml
@@ -1,56 +1,59 @@
 <chapter xmlns="http://docbook.org/ns/docbook"
          xmlns:xlink="http://www.w3.org/1999/xlink"
          xml:id="chap-conventions">
-
-<title>Coding conventions</title>
-
-
-<section xml:id="sec-syntax"><title>Syntax</title>
-
-<itemizedlist>
-
-  <listitem><para>Use 2 spaces of indentation per indentation level in
-  Nix expressions, 4 spaces in shell scripts.</para></listitem>
-
-  <listitem><para>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.</para></listitem>
-
-  <listitem><para>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"/>.</para></listitem>
-
-  <listitem><para>Function calls with attribute set arguments are
-  written as
-
+ <title>Coding conventions</title>
+ <section xml:id="sec-syntax">
+  <title>Syntax</title>
+
+  <itemizedlist>
+   <listitem>
+    <para>
+     Use 2 spaces of indentation per indentation level in Nix expressions, 4
+     spaces in shell scripts.
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     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.
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     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"/>.
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     Function calls with attribute set arguments are written as
 <programlisting>
 foo {
   arg = ...;
 }
 </programlisting>
-
-  not
-
+     not
 <programlisting>
 foo
 {
   arg = ...;
 }
 </programlisting>
-
-  Also fine is
-
+     Also fine is
 <programlisting>
 foo { arg = ...; }
 </programlisting>
-
-  if it's a short call.</para></listitem>
-
-  <listitem><para>In attribute sets or lists that span multiple lines,
-  the attribute names or list elements should be aligned:
-
+     if it's a short call.
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     In attribute sets or lists that span multiple lines, the attribute names
+     or list elements should be aligned:
 <programlisting>
 # A long list.
 list =
@@ -73,12 +76,11 @@ attrs = {
     if true then big_expr else big_expr;
 };
 </programlisting>
-
-  </para></listitem>
-
-  <listitem><para>Short lists or attribute sets can be written on one
-  line:
-
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     Short lists or attribute sets can be written on one line:
 <programlisting>
 # A short list.
 list = [ elem1 elem2 elem3 ];
@@ -86,66 +88,58 @@ list = [ elem1 elem2 elem3 ];
 # A short set.
 attrs = { x = 1280; y = 1024; };
 </programlisting>
-
-  </para></listitem>
-
-  <listitem><para>Breaking in the middle of a function argument can
-  give hard-to-read code, like
-
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     Breaking in the middle of a function argument can give hard-to-read code,
+     like
 <programlisting>
 someFunction { x = 1280;
   y = 1024; } otherArg
   yetAnotherArg
 </programlisting>
-
-  (especially if the argument is very large, spanning multiple
-  lines).</para>
-
-  <para>Better:
-
+     (especially if the argument is very large, spanning multiple lines).
+    </para>
+    <para>
+     Better:
 <programlisting>
 someFunction
   { x = 1280; y = 1024; }
   otherArg
   yetAnotherArg
 </programlisting>
-
-  or
-
+     or
 <programlisting>
 let res = { x = 1280; y = 1024; };
 in someFunction res otherArg yetAnotherArg
 </programlisting>
-
-  </para></listitem>
-
-  <listitem><para>The bodies of functions, asserts, and withs are not
-  indented to prevent a lot of superfluous indentation levels, i.e.
-
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     The bodies of functions, asserts, and withs are not indented to prevent a
+     lot of superfluous indentation levels, i.e.
 <programlisting>
 { arg1, arg2 }:
 assert system == "i686-linux";
 stdenv.mkDerivation { ...
 </programlisting>
-
-  not
-
+     not
 <programlisting>
 { arg1, arg2 }:
   assert system == "i686-linux";
     stdenv.mkDerivation { ...
 </programlisting>
-
-  </para></listitem>
-
-  <listitem><para>Function formal arguments are written as:
-
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     Function formal arguments are written as:
 <programlisting>
 { arg1, arg2, arg3 }:
 </programlisting>
-
-  but if they don't fit on one line they're written as:
-
+     but if they don't fit on one line they're written as:
 <programlisting>
 { arg1, arg2, arg3
 , arg4, ...
@@ -153,35 +147,28 @@ stdenv.mkDerivation { ...
   argN
 }:
 </programlisting>
-
-  </para></listitem>
-
-  <listitem><para>Functions should list their expected arguments as
-  precisely as possible.  That is, write
-
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     Functions should list their expected arguments as precisely as possible.
+     That is, write
 <programlisting>
 { stdenv, fetchurl, perl }: <replaceable>...</replaceable>
 </programlisting>
-
-  instead of
-
+     instead of
 <programlisting>
 args: with args; <replaceable>...</replaceable>
 </programlisting>
-
-  or
-
+     or
 <programlisting>
 { stdenv, fetchurl, perl, ... }: <replaceable>...</replaceable>
 </programlisting>
-
-  </para>
-
-  <para>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:
-
+    </para>
+    <para>
+     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:
 <programlisting>
 { stdenv, doCoverageAnalysis ? false, ... } @ args:
 
@@ -189,9 +176,7 @@ stdenv.mkDerivation (args // {
   <replaceable>...</replaceable> if doCoverageAnalysis then "bla" else "" <replaceable>...</replaceable>
 })
 </programlisting>
-
-  instead of
-
+     instead of
 <programlisting>
 args:
 
@@ -199,432 +184,557 @@ args.stdenv.mkDerivation (args // {
   <replaceable>...</replaceable> if args ? doCoverageAnalysis &amp;&amp; args.doCoverageAnalysis then "bla" else "" <replaceable>...</replaceable>
 })
 </programlisting>
+    </para>
+   </listitem>
+  </itemizedlist>
+ </section>
+ <section xml:id="sec-package-naming">
+  <title>Package naming</title>
 
-  </para></listitem>
-
-</itemizedlist>
-
-</section>
-
-
-<section xml:id="sec-package-naming"><title>Package naming</title>
-
-<para>In Nixpkgs, there are generally three different names associated with a package:
-
-<itemizedlist>
-
-  <listitem><para>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>.</para></listitem>
-
-  <listitem><para>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>.</para></listitem>
-
-  <listitem><para>The filename for (the directory containing) the Nix
-  expression.</para></listitem>
-
-</itemizedlist>
-
-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>.
-</para>
-
-<para>There are a few naming guidelines:
-
-<itemizedlist>
-
-  <listitem><para>Generally, try to stick to the upstream package
-  name.</para></listitem>
-
-  <listitem><para>Don’t use uppercase letters in the
-  <literal>name</literal> attribute — e.g.,
-  <literal>"mplayer-1.0rc2"</literal> instead of
-  <literal>"MPlayer-1.0rc2"</literal>.</para></listitem>
-
-  <listitem><para>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>.</para></listitem>
-
-  <listitem><para>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 must 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>.</para></listitem>
-
-  <listitem><para>Dashes in the package name should 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.</para></listitem>
-
-  <listitem><para>If there are multiple versions of a package, this
-  should 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" /></para></listitem>
-
-</itemizedlist>
-
-</para>
-
-</section>
-
-
-<section xml:id="sec-organisation"><title>File naming and organisation</title>
-
-<para>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>.</para>
-
-<section xml:id="sec-hierarchy"><title>Hierarchy</title>
-
-<para>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>.</para>
-
-<para>When in doubt, consider refactoring the
-<filename>pkgs/</filename> tree, e.g. creating new categories or
-splitting up an existing category.</para>
-
-<variablelist>
-  <varlistentry>
-    <term>If it’s used to support <emphasis>software development</emphasis>:</term>
+  <para>
+   In Nixpkgs, there are generally three different names associated with a
+   package:
+   <itemizedlist>
     <listitem>
-      <variablelist>
-        <varlistentry>
-          <term>If it’s a <emphasis>library</emphasis> used by other packages:</term>
-          <listitem>
-            <para><filename>development/libraries</filename> (e.g. <filename>libxml2</filename>)</para>
-          </listitem>
-        </varlistentry>
-        <varlistentry>
-          <term>If it’s a <emphasis>compiler</emphasis>:</term>
-          <listitem>
-            <para><filename>development/compilers</filename> (e.g. <filename>gcc</filename>)</para>
-          </listitem>
-        </varlistentry>
-        <varlistentry>
-          <term>If it’s an <emphasis>interpreter</emphasis>:</term>
-          <listitem>
-            <para><filename>development/interpreters</filename> (e.g. <filename>guile</filename>)</para>
-          </listitem>
-        </varlistentry>
-        <varlistentry>
-          <term>If it’s a (set of) development <emphasis>tool(s)</emphasis>:</term>
-          <listitem>
-            <variablelist>
-              <varlistentry>
-                <term>If it’s a <emphasis>parser generator</emphasis> (including lexers):</term>
-                <listitem>
-                  <para><filename>development/tools/parsing</filename> (e.g. <filename>bison</filename>, <filename>flex</filename>)</para>
-                </listitem>
-              </varlistentry>
-              <varlistentry>
-                <term>If it’s a <emphasis>build manager</emphasis>:</term>
-                <listitem>
-                  <para><filename>development/tools/build-managers</filename> (e.g. <filename>gnumake</filename>)</para>
-                </listitem>
-              </varlistentry>
-              <varlistentry>
-                <term>Else:</term>
-                <listitem>
-                  <para><filename>development/tools/misc</filename> (e.g. <filename>binutils</filename>)</para>
-                </listitem>
-              </varlistentry>
-            </variablelist>
-          </listitem>
-        </varlistentry>
-        <varlistentry>
-          <term>Else:</term>
-          <listitem>
-            <para><filename>development/misc</filename></para>
-          </listitem>
-        </varlistentry>
-      </variablelist>
+     <para>
+      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>.
+     </para>
     </listitem>
-  </varlistentry>
-  <varlistentry>
-    <term>If it’s a (set of) <emphasis>tool(s)</emphasis>:</term>
     <listitem>
-      <para>(A tool is a relatively small program, especially one intended
-      to be used non-interactively.)</para>
-      <variablelist>
-        <varlistentry>
-          <term>If it’s for <emphasis>networking</emphasis>:</term>
-          <listitem>
-            <para><filename>tools/networking</filename> (e.g. <filename>wget</filename>)</para>
-          </listitem>
-        </varlistentry>
-        <varlistentry>
-          <term>If it’s for <emphasis>text processing</emphasis>:</term>
-          <listitem>
-            <para><filename>tools/text</filename> (e.g. <filename>diffutils</filename>)</para>
-          </listitem>
-        </varlistentry>
-        <varlistentry>
-          <term>If it’s a <emphasis>system utility</emphasis>, i.e.,
-          something related or essential to the operation of a
-          system:</term>
-          <listitem>
-            <para><filename>tools/system</filename> (e.g. <filename>cron</filename>)</para>
-          </listitem>
-        </varlistentry>
-        <varlistentry>
-          <term>If it’s an <emphasis>archiver</emphasis> (which may
-          include a compression function):</term>
-          <listitem>
-            <para><filename>tools/archivers</filename> (e.g. <filename>zip</filename>, <filename>tar</filename>)</para>
-          </listitem>
-        </varlistentry>
-        <varlistentry>
-          <term>If it’s a <emphasis>compression</emphasis> program:</term>
-          <listitem>
-            <para><filename>tools/compression</filename> (e.g. <filename>gzip</filename>, <filename>bzip2</filename>)</para>
-          </listitem>
-        </varlistentry>
-        <varlistentry>
-          <term>If it’s a <emphasis>security</emphasis>-related program:</term>
-          <listitem>
-            <para><filename>tools/security</filename> (e.g. <filename>nmap</filename>, <filename>gnupg</filename>)</para>
-          </listitem>
-        </varlistentry>
-        <varlistentry>
-          <term>Else:</term>
-          <listitem>
-            <para><filename>tools/misc</filename></para>
-          </listitem>
-        </varlistentry>
-      </variablelist>
+     <para>
+      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>.
+     </para>
     </listitem>
-  </varlistentry>
-  <varlistentry>
-    <term>If it’s a <emphasis>shell</emphasis>:</term>
     <listitem>
-      <para><filename>shells</filename> (e.g. <filename>bash</filename>)</para>
+     <para>
+      The filename for (the directory containing) the Nix expression.
+     </para>
     </listitem>
-  </varlistentry>
-  <varlistentry>
-    <term>If it’s a <emphasis>server</emphasis>:</term>
+   </itemizedlist>
+   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>.
+  </para>
+
+  <para>
+   There are a few naming guidelines:
+   <itemizedlist>
     <listitem>
-      <variablelist>
-        <varlistentry>
-          <term>If it’s a web server:</term>
-          <listitem>
-            <para><filename>servers/http</filename> (e.g. <filename>apache-httpd</filename>)</para>
-          </listitem>
-        </varlistentry>
-        <varlistentry>
-          <term>If it’s an implementation of the X Windowing System:</term>
-          <listitem>
-            <para><filename>servers/x11</filename> (e.g. <filename>xorg</filename> — this includes the client libraries and programs)</para>
-          </listitem>
-        </varlistentry>
-        <varlistentry>
-          <term>Else:</term>
-          <listitem>
-            <para><filename>servers/misc</filename></para>
-          </listitem>
-        </varlistentry>
-      </variablelist>
+     <para>
+      Generally, try to stick to the upstream package name.
+     </para>
     </listitem>
-  </varlistentry>
-  <varlistentry>
-    <term>If it’s a <emphasis>desktop environment</emphasis>:</term>
     <listitem>
-      <para><filename>desktops</filename> (e.g. <filename>kde</filename>, <filename>gnome</filename>, <filename>enlightenment</filename>)</para>
+     <para>
+      Don’t use uppercase letters in the <literal>name</literal> attribute
+      — e.g., <literal>"mplayer-1.0rc2"</literal> instead of
+      <literal>"MPlayer-1.0rc2"</literal>.
+     </para>
     </listitem>
-  </varlistentry>
-  <varlistentry>
-    <term>If it’s a <emphasis>window manager</emphasis>:</term>
     <listitem>
-      <para><filename>applications/window-managers</filename> (e.g. <filename>awesome</filename>, <filename>stumpwm</filename>)</para>
+     <para>
+      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>.
+     </para>
     </listitem>
-  </varlistentry>
-  <varlistentry>
-    <term>If it’s an <emphasis>application</emphasis>:</term>
     <listitem>
-      <para>A (typically large) program with a distinct user
-      interface, primarily used interactively.</para>
-      <variablelist>
-        <varlistentry>
-          <term>If it’s a <emphasis>version management system</emphasis>:</term>
-          <listitem>
-            <para><filename>applications/version-management</filename> (e.g. <filename>subversion</filename>)</para>
-          </listitem>
-        </varlistentry>
-        <varlistentry>
-          <term>If it’s for <emphasis>video playback / editing</emphasis>:</term>
-          <listitem>
-            <para><filename>applications/video</filename> (e.g. <filename>vlc</filename>)</para>
-          </listitem>
-        </varlistentry>
-        <varlistentry>
-          <term>If it’s for <emphasis>graphics viewing / editing</emphasis>:</term>
-          <listitem>
-            <para><filename>applications/graphics</filename> (e.g. <filename>gimp</filename>)</para>
-          </listitem>
-        </varlistentry>
-        <varlistentry>
-          <term>If it’s for <emphasis>networking</emphasis>:</term>
-          <listitem>
-            <variablelist>
-              <varlistentry>
-                <term>If it’s a <emphasis>mailreader</emphasis>:</term>
-                <listitem>
-                  <para><filename>applications/networking/mailreaders</filename> (e.g. <filename>thunderbird</filename>)</para>
-                </listitem>
-              </varlistentry>
-              <varlistentry>
-                <term>If it’s a <emphasis>newsreader</emphasis>:</term>
-                <listitem>
-                  <para><filename>applications/networking/newsreaders</filename> (e.g. <filename>pan</filename>)</para>
-                </listitem>
-              </varlistentry>
-              <varlistentry>
-                <term>If it’s a <emphasis>web browser</emphasis>:</term>
-                <listitem>
-                  <para><filename>applications/networking/browsers</filename> (e.g. <filename>firefox</filename>)</para>
-                </listitem>
-              </varlistentry>
-              <varlistentry>
-                <term>Else:</term>
-                <listitem>
-                  <para><filename>applications/networking/misc</filename></para>
-                </listitem>
-              </varlistentry>
-            </variablelist>
-          </listitem>
-        </varlistentry>
-        <varlistentry>
-          <term>Else:</term>
-          <listitem>
-            <para><filename>applications/misc</filename></para>
-          </listitem>
-        </varlistentry>
-      </variablelist>
+     <para>
+      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 must 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>.
+     </para>
     </listitem>
-  </varlistentry>
-  <varlistentry>
-    <term>If it’s <emphasis>data</emphasis> (i.e., does not have a
-    straight-forward executable semantics):</term>
     <listitem>
-      <variablelist>
-        <varlistentry>
-          <term>If it’s a <emphasis>font</emphasis>:</term>
-          <listitem>
-            <para><filename>data/fonts</filename></para>
-          </listitem>
-        </varlistentry>
-        <varlistentry>
-          <term>If it’s related to <emphasis>SGML/XML processing</emphasis>:</term>
-          <listitem>
-            <variablelist>
-              <varlistentry>
-                <term>If it’s an <emphasis>XML DTD</emphasis>:</term>
-                <listitem>
-                  <para><filename>data/sgml+xml/schemas/xml-dtd</filename> (e.g. <filename>docbook</filename>)</para>
-                </listitem>
-              </varlistentry>
-              <varlistentry>
-                <term>If it’s an <emphasis>XSLT stylesheet</emphasis>:</term>
-                <listitem>
-                  <para>(Okay, these are executable...)</para>
-                  <para><filename>data/sgml+xml/stylesheets/xslt</filename> (e.g. <filename>docbook-xsl</filename>)</para>
-                </listitem>
-              </varlistentry>
-            </variablelist>
-          </listitem>
-        </varlistentry>
-      </variablelist>
+     <para>
+      Dashes in the package name should 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.
+     </para>
     </listitem>
-  </varlistentry>
-  <varlistentry>
-    <term>If it’s a <emphasis>game</emphasis>:</term>
     <listitem>
-      <para><filename>games</filename></para>
+     <para>
+      If there are multiple versions of a package, this should 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" />
+     </para>
     </listitem>
-  </varlistentry>
-  <varlistentry>
-    <term>Else:</term>
-    <listitem>
-      <para><filename>misc</filename></para>
-    </listitem>
-  </varlistentry>
-</variablelist>
-
-</section>
-
-<section xml:id="sec-versioning"><title>Versioning</title>
-
-<para>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.</para>
-
-<para>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>.</para>
+   </itemizedlist>
+  </para>
+ </section>
+ <section xml:id="sec-organisation">
+  <title>File naming and organisation</title>
 
-<para>All versions of a package <emphasis>must</emphasis> be included
-in <filename>all-packages.nix</filename> to make sure that they
-evaluate correctly.</para>
+  <para>
+   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>.
+  </para>
 
-</section>
+  <section xml:id="sec-hierarchy">
+   <title>Hierarchy</title>
+
+   <para>
+    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>.
+   </para>
+
+   <para>
+    When in doubt, consider refactoring the <filename>pkgs/</filename> tree,
+    e.g. creating new categories or splitting up an existing category.
+   </para>
+
+   <variablelist>
+    <varlistentry>
+     <term>If it’s used to support <emphasis>software development</emphasis>:</term>
+     <listitem>
+      <variablelist>
+       <varlistentry>
+        <term>If it’s a <emphasis>library</emphasis> used by other packages:</term>
+        <listitem>
+         <para>
+          <filename>development/libraries</filename> (e.g.
+          <filename>libxml2</filename>)
+         </para>
+        </listitem>
+       </varlistentry>
+       <varlistentry>
+        <term>If it’s a <emphasis>compiler</emphasis>:</term>
+        <listitem>
+         <para>
+          <filename>development/compilers</filename> (e.g.
+          <filename>gcc</filename>)
+         </para>
+        </listitem>
+       </varlistentry>
+       <varlistentry>
+        <term>If it’s an <emphasis>interpreter</emphasis>:</term>
+        <listitem>
+         <para>
+          <filename>development/interpreters</filename> (e.g.
+          <filename>guile</filename>)
+         </para>
+        </listitem>
+       </varlistentry>
+       <varlistentry>
+        <term>If it’s a (set of) development <emphasis>tool(s)</emphasis>:</term>
+        <listitem>
+         <variablelist>
+          <varlistentry>
+           <term>If it’s a <emphasis>parser generator</emphasis> (including lexers):</term>
+           <listitem>
+            <para>
+             <filename>development/tools/parsing</filename> (e.g.
+             <filename>bison</filename>, <filename>flex</filename>)
+            </para>
+           </listitem>
+          </varlistentry>
+          <varlistentry>
+           <term>If it’s a <emphasis>build manager</emphasis>:</term>
+           <listitem>
+            <para>
+             <filename>development/tools/build-managers</filename> (e.g.
+             <filename>gnumake</filename>)
+            </para>
+           </listitem>
+          </varlistentry>
+          <varlistentry>
+           <term>Else:</term>
+           <listitem>
+            <para>
+             <filename>development/tools/misc</filename> (e.g.
+             <filename>binutils</filename>)
+            </para>
+           </listitem>
+          </varlistentry>
+         </variablelist>
+        </listitem>
+       </varlistentry>
+       <varlistentry>
+        <term>Else:</term>
+        <listitem>
+         <para>
+          <filename>development/misc</filename>
+         </para>
+        </listitem>
+       </varlistentry>
+      </variablelist>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term>If it’s a (set of) <emphasis>tool(s)</emphasis>:</term>
+     <listitem>
+      <para>
+       (A tool is a relatively small program, especially one intended to be
+       used non-interactively.)
+      </para>
+      <variablelist>
+       <varlistentry>
+        <term>If it’s for <emphasis>networking</emphasis>:</term>
+        <listitem>
+         <para>
+          <filename>tools/networking</filename> (e.g.
+          <filename>wget</filename>)
+         </para>
+        </listitem>
+       </varlistentry>
+       <varlistentry>
+        <term>If it’s for <emphasis>text processing</emphasis>:</term>
+        <listitem>
+         <para>
+          <filename>tools/text</filename> (e.g. <filename>diffutils</filename>)
+         </para>
+        </listitem>
+       </varlistentry>
+       <varlistentry>
+        <term>If it’s a <emphasis>system utility</emphasis>, i.e.,
+          something related or essential to the operation of a
+          system:</term>
+        <listitem>
+         <para>
+          <filename>tools/system</filename> (e.g. <filename>cron</filename>)
+         </para>
+        </listitem>
+       </varlistentry>
+       <varlistentry>
+        <term>If it’s an <emphasis>archiver</emphasis> (which may
+          include a compression function):</term>
+        <listitem>
+         <para>
+          <filename>tools/archivers</filename> (e.g. <filename>zip</filename>,
+          <filename>tar</filename>)
+         </para>
+        </listitem>
+       </varlistentry>
+       <varlistentry>
+        <term>If it’s a <emphasis>compression</emphasis> program:</term>
+        <listitem>
+         <para>
+          <filename>tools/compression</filename> (e.g.
+          <filename>gzip</filename>, <filename>bzip2</filename>)
+         </para>
+        </listitem>
+       </varlistentry>
+       <varlistentry>
+        <term>If it’s a <emphasis>security</emphasis>-related program:</term>
+        <listitem>
+         <para>
+          <filename>tools/security</filename> (e.g. <filename>nmap</filename>,
+          <filename>gnupg</filename>)
+         </para>
+        </listitem>
+       </varlistentry>
+       <varlistentry>
+        <term>Else:</term>
+        <listitem>
+         <para>
+          <filename>tools/misc</filename>
+         </para>
+        </listitem>
+       </varlistentry>
+      </variablelist>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term>If it’s a <emphasis>shell</emphasis>:</term>
+     <listitem>
+      <para>
+       <filename>shells</filename> (e.g. <filename>bash</filename>)
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term>If it’s a <emphasis>server</emphasis>:</term>
+     <listitem>
+      <variablelist>
+       <varlistentry>
+        <term>If it’s a web server:</term>
+        <listitem>
+         <para>
+          <filename>servers/http</filename> (e.g.
+          <filename>apache-httpd</filename>)
+         </para>
+        </listitem>
+       </varlistentry>
+       <varlistentry>
+        <term>If it’s an implementation of the X Windowing System:</term>
+        <listitem>
+         <para>
+          <filename>servers/x11</filename> (e.g. <filename>xorg</filename> —
+          this includes the client libraries and programs)
+         </para>
+        </listitem>
+       </varlistentry>
+       <varlistentry>
+        <term>Else:</term>
+        <listitem>
+         <para>
+          <filename>servers/misc</filename>
+         </para>
+        </listitem>
+       </varlistentry>
+      </variablelist>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term>If it’s a <emphasis>desktop environment</emphasis>:</term>
+     <listitem>
+      <para>
+       <filename>desktops</filename> (e.g. <filename>kde</filename>,
+       <filename>gnome</filename>, <filename>enlightenment</filename>)
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term>If it’s a <emphasis>window manager</emphasis>:</term>
+     <listitem>
+      <para>
+       <filename>applications/window-managers</filename> (e.g.
+       <filename>awesome</filename>, <filename>stumpwm</filename>)
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term>If it’s an <emphasis>application</emphasis>:</term>
+     <listitem>
+      <para>
+       A (typically large) program with a distinct user interface, primarily
+       used interactively.
+      </para>
+      <variablelist>
+       <varlistentry>
+        <term>If it’s a <emphasis>version management system</emphasis>:</term>
+        <listitem>
+         <para>
+          <filename>applications/version-management</filename> (e.g.
+          <filename>subversion</filename>)
+         </para>
+        </listitem>
+       </varlistentry>
+       <varlistentry>
+        <term>If it’s for <emphasis>video playback / editing</emphasis>:</term>
+        <listitem>
+         <para>
+          <filename>applications/video</filename> (e.g.
+          <filename>vlc</filename>)
+         </para>
+        </listitem>
+       </varlistentry>
+       <varlistentry>
+        <term>If it’s for <emphasis>graphics viewing / editing</emphasis>:</term>
+        <listitem>
+         <para>
+          <filename>applications/graphics</filename> (e.g.
+          <filename>gimp</filename>)
+         </para>
+        </listitem>
+       </varlistentry>
+       <varlistentry>
+        <term>If it’s for <emphasis>networking</emphasis>:</term>
+        <listitem>
+         <variablelist>
+          <varlistentry>
+           <term>If it’s a <emphasis>mailreader</emphasis>:</term>
+           <listitem>
+            <para>
+             <filename>applications/networking/mailreaders</filename> (e.g.
+             <filename>thunderbird</filename>)
+            </para>
+           </listitem>
+          </varlistentry>
+          <varlistentry>
+           <term>If it’s a <emphasis>newsreader</emphasis>:</term>
+           <listitem>
+            <para>
+             <filename>applications/networking/newsreaders</filename> (e.g.
+             <filename>pan</filename>)
+            </para>
+           </listitem>
+          </varlistentry>
+          <varlistentry>
+           <term>If it’s a <emphasis>web browser</emphasis>:</term>
+           <listitem>
+            <para>
+             <filename>applications/networking/browsers</filename> (e.g.
+             <filename>firefox</filename>)
+            </para>
+           </listitem>
+          </varlistentry>
+          <varlistentry>
+           <term>Else:</term>
+           <listitem>
+            <para>
+             <filename>applications/networking/misc</filename>
+            </para>
+           </listitem>
+          </varlistentry>
+         </variablelist>
+        </listitem>
+       </varlistentry>
+       <varlistentry>
+        <term>Else:</term>
+        <listitem>
+         <para>
+          <filename>applications/misc</filename>
+         </para>
+        </listitem>
+       </varlistentry>
+      </variablelist>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term>If it’s <emphasis>data</emphasis> (i.e., does not have a
+    straight-forward executable semantics):</term>
+     <listitem>
+      <variablelist>
+       <varlistentry>
+        <term>If it’s a <emphasis>font</emphasis>:</term>
+        <listitem>
+         <para>
+          <filename>data/fonts</filename>
+         </para>
+        </listitem>
+       </varlistentry>
+       <varlistentry>
+        <term>If it’s related to <emphasis>SGML/XML processing</emphasis>:</term>
+        <listitem>
+         <variablelist>
+          <varlistentry>
+           <term>If it’s an <emphasis>XML DTD</emphasis>:</term>
+           <listitem>
+            <para>
+             <filename>data/sgml+xml/schemas/xml-dtd</filename> (e.g.
+             <filename>docbook</filename>)
+            </para>
+           </listitem>
+          </varlistentry>
+          <varlistentry>
+           <term>If it’s an <emphasis>XSLT stylesheet</emphasis>:</term>
+           <listitem>
+            <para>
+             (Okay, these are executable...)
+            </para>
+            <para>
+             <filename>data/sgml+xml/stylesheets/xslt</filename> (e.g.
+             <filename>docbook-xsl</filename>)
+            </para>
+           </listitem>
+          </varlistentry>
+         </variablelist>
+        </listitem>
+       </varlistentry>
+      </variablelist>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term>If it’s a <emphasis>game</emphasis>:</term>
+     <listitem>
+      <para>
+       <filename>games</filename>
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term>Else:</term>
+     <listitem>
+      <para>
+       <filename>misc</filename>
+      </para>
+     </listitem>
+    </varlistentry>
+   </variablelist>
+  </section>
+
+  <section xml:id="sec-versioning">
+   <title>Versioning</title>
+
+   <para>
+    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.
+   </para>
+
+   <para>
+    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>.
+   </para>
+
+   <para>
+    All versions of a package <emphasis>must</emphasis> be included in
+    <filename>all-packages.nix</filename> to make sure that they evaluate
+    correctly.
+   </para>
+  </section>
+ </section>
+ <section xml:id="sec-sources">
+  <title>Fetching Sources</title>
 
-</section>
-<section xml:id="sec-sources"><title>Fetching Sources</title>
-  <para>There are multiple ways to fetch a package source in nixpkgs. The
-    general guideline is that you should package 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.
+  <para>
+   There are multiple ways to fetch a package source in nixpkgs. The general
+   guideline is that you should package 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.
   </para>
-  <para>You can find many source fetch helpers in <literal>pkgs/build-support/fetch*</literal>.
+
+  <para>
+   You can find many source fetch helpers in
+   <literal>pkgs/build-support/fetch*</literal>.
   </para>
-  <para>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:
-    <itemizedlist>
-      <listitem>
-        <para>Bad: Uses <literal>git://</literal> which won't be proxied.
+
+  <para>
+   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:
+   <itemizedlist>
+    <listitem>
+     <para>
+      Bad: Uses <literal>git://</literal> which won't be proxied.
 <programlisting>
 src = fetchgit {
   url = "git://github.com/NixOS/nix.git";
@@ -632,10 +742,11 @@ src = fetchgit {
   sha256 = "1cw5fszffl5pkpa6s6wjnkiv6lm5k618s32sp60kvmvpy7a2v9kg";
 }
 </programlisting>
-        </para>
-      </listitem>
-      <listitem>
-        <para>Better: This is ok, but an archive fetch will still be faster.
+     </para>
+    </listitem>
+    <listitem>
+     <para>
+      Better: This is ok, but an archive fetch will still be faster.
 <programlisting>
 src = fetchgit {
   url = "https://github.com/NixOS/nix.git";
@@ -643,10 +754,11 @@ src = fetchgit {
   sha256 = "1cw5fszffl5pkpa6s6wjnkiv6lm5k618s32sp60kvmvpy7a2v9kg";
 }
 </programlisting>
-        </para>
-      </listitem>
-      <listitem>
-        <para>Best: Fetches a snapshot archive and you get the rev you want.
+     </para>
+    </listitem>
+    <listitem>
+     <para>
+      Best: Fetches a snapshot archive and you get the rev you want.
 <programlisting>
 src = fetchFromGitHub {
   owner = "NixOS";
@@ -655,15 +767,19 @@ src = fetchFromGitHub {
   sha256 = "04yri911rj9j19qqqn6m82266fl05pz98inasni0vxr1cf1gdgv9";
 }
 </programlisting>
-        </para>
-      </listitem>
-    </itemizedlist>
+     </para>
+    </listitem>
+   </itemizedlist>
+  </para>
+ </section>
+ <section xml:id="sec-patches">
+  <title>Patches</title>
+
+  <para>
+   Patches available online should be retrieved using
+   <literal>fetchpatch</literal>.
   </para>
-</section>
 
-<section xml:id="sec-patches"><title>Patches</title>
-  <para>Patches available online should be retrieved using
-    <literal>fetchpatch</literal>.</para>
   <para>
 <programlisting>
 patches = [
@@ -675,30 +791,54 @@ patches = [
 ];
 </programlisting>
   </para>
-  <para>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.</para>
-<para><programlisting>
+
+  <para>
+   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.
+  </para>
+
+  <para>
+<programlisting>
 patches = [ ./0001-changes.patch ];
-</programlisting></para>
-  <para>If you do need to do create this sort of patch file,
-  one way to do so is with git:
-  <orderedlist>
-    <listitem><para>Move to the root directory of the source code
-    you're patching.<screen>
-$ cd the/program/source</screen></para></listitem>
-    <listitem><para>If a git repository is not already present,
-    create one and stage all of the source files.<screen>
+</programlisting>
+  </para>
+
+  <para>
+   If you do need to do create this sort of patch file, one way to do so is
+   with git:
+   <orderedlist>
+    <listitem>
+     <para>
+      Move to the root directory of the source code you're patching.
+<screen>
+$ cd the/program/source</screen>
+     </para>
+    </listitem>
+    <listitem>
+     <para>
+      If a git repository is not already present, create one and stage all of
+      the source files.
+<screen>
 $ git init
-$ git add .</screen></para></listitem>
-    <listitem><para>Edit some files to make whatever changes need
-    to be included in the patch.</para></listitem>
-    <listitem><para>Use git to create a diff, and pipe the output
-    to a patch file:<screen>
+$ git add .</screen>
+     </para>
+    </listitem>
+    <listitem>
+     <para>
+      Edit some files to make whatever changes need to be included in the
+      patch.
+     </para>
+    </listitem>
+    <listitem>
+     <para>
+      Use git to create a diff, and pipe the output to a patch file:
+<screen>
 $ git diff > nixpkgs/pkgs/the/package/0001-changes.patch</screen>
-    </para></listitem>
-  </orderedlist></para>
-</section>
-
+     </para>
+    </listitem>
+   </orderedlist>
+  </para>
+ </section>
 </chapter>
diff --git a/doc/configuration.xml b/doc/configuration.xml
index 5370265c53a..4411b4844e9 100644
--- a/doc/configuration.xml
+++ b/doc/configuration.xml
@@ -1,42 +1,51 @@
 <chapter xmlns="http://docbook.org/ns/docbook"
          xmlns:xlink="http://www.w3.org/1999/xlink"
          xml:id="chap-packageconfig">
-
-<title>Global configuration</title>
-
-<para>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:</para>
-
-<itemizedlist>
-  <listitem><para>The package is thought to be broken, and has had
-  its <literal>meta.broken</literal> set to
-  <literal>true</literal>.</para></listitem>
-
-  <listitem><para>The package isn't intended to run on the given system, as none of its <literal>meta.platforms</literal> match the given system.</para></listitem>
-
-  <listitem><para>The package's <literal>meta.license</literal> is set
-  to a license which is considered to be unfree.</para></listitem>
-
-  <listitem><para>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>.</para></listitem>
-</itemizedlist>
-
-<para>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.
-</para>
-
-<para>Each of these criteria can be altered in the nixpkgs
-configuration.</para>
-
-<para>The nixpkgs configuration for a NixOS system is set in the
-<literal>configuration.nix</literal>, as in the following example:
+ <title>Global configuration</title>
+ <para>
+  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:
+ </para>
+ <itemizedlist>
+  <listitem>
+   <para>
+    The package is thought to be broken, and has had its
+    <literal>meta.broken</literal> set to <literal>true</literal>.
+   </para>
+  </listitem>
+  <listitem>
+   <para>
+    The package isn't intended to run on the given system, as none of its
+    <literal>meta.platforms</literal> match the given system.
+   </para>
+  </listitem>
+  <listitem>
+   <para>
+    The package's <literal>meta.license</literal> is set to a license which is
+    considered to be unfree.
+   </para>
+  </listitem>
+  <listitem>
+   <para>
+    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>.
+   </para>
+  </listitem>
+ </itemizedlist>
+ <para>
+  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.
+ </para>
+ <para>
+  Each of these criteria can be altered in the nixpkgs configuration.
+ </para>
+ <para>
+  The nixpkgs configuration for a NixOS system is set in the
+  <literal>configuration.nix</literal>, as in the following example:
 <programlisting>
 {
   nixpkgs.config = {
@@ -44,187 +53,197 @@ configuration.</para>
   };
 }
 </programlisting>
-However, this does not allow unfree software for individual users.
-Their configurations are managed separately.</para>
-
-<para>A user's of nixpkgs configuration is stored in a user-specific
-configuration file located at
-<filename>~/.config/nixpkgs/config.nix</filename>. For example:
+  However, this does not allow unfree software for individual users. Their
+  configurations are managed separately.
+ </para>
+ <para>
+  A user's of nixpkgs configuration is stored in a user-specific configuration
+  file located at <filename>~/.config/nixpkgs/config.nix</filename>. For
+  example:
 <programlisting>
 {
   allowUnfree = true;
 }
 </programlisting>
-</para>
-
-<para>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.</para>
-
-<section xml:id="sec-allow-broken">
+ </para>
+ <para>
+  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.
+ </para>
+ <section xml:id="sec-allow-broken">
   <title>Installing broken packages</title>
 
-
-  <para>There are two ways to try compiling a package which has been
-  marked as broken.</para>
+  <para>
+   There are two ways to try compiling a package which has been marked as
+   broken.
+  </para>
 
   <itemizedlist>
-    <listitem><para>
-      For allowing the build of a broken package once, you can use an
-      environment variable for a single invocation of the nix tools:
-
-      <programlisting>$ export NIXPKGS_ALLOW_BROKEN=1</programlisting>
-    </para></listitem>
-
-    <listitem><para>
-      For permanently allowing broken packages to be built, you may
-      add <literal>allowBroken = true;</literal> to your user's
-      configuration file, like this:
-
+   <listitem>
+    <para>
+     For allowing the build of a broken package once, you can use an
+     environment variable for a single invocation of the nix tools:
+<programlisting>$ export NIXPKGS_ALLOW_BROKEN=1</programlisting>
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     For permanently allowing broken packages to be built, you may add
+     <literal>allowBroken = true;</literal> to your user's configuration file,
+     like this:
 <programlisting>
 {
   allowBroken = true;
 }
 </programlisting>
-    </para></listitem>
+    </para>
+   </listitem>
   </itemizedlist>
-</section>
-
-<section xml:id="sec-allow-unsupported-system">
+ </section>
+ <section xml:id="sec-allow-unsupported-system">
   <title>Installing packages on unsupported systems</title>
 
-
   <para>
-    There are also two ways to try compiling a package which has been marked as unsuported for the given system.
+   There are also two ways to try compiling a package which has been marked as
+   unsuported for the given system.
   </para>
 
   <itemizedlist>
-    <listitem><para>
-      For allowing the build of a broken package once, you can use an environment variable for a single invocation of the nix tools:
-
-      <programlisting>$ export NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1</programlisting>
-    </para></listitem>
-
-    <listitem>
-      <para>
-        For permanently allowing broken packages to be built, you may add <literal>allowUnsupportedSystem = true;</literal> to your user's configuration file, like this:
-
+   <listitem>
+    <para>
+     For allowing the build of a broken package once, you can use an
+     environment variable for a single invocation of the nix tools:
+<programlisting>$ export NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1</programlisting>
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     For permanently allowing broken packages to be built, you may add
+     <literal>allowUnsupportedSystem = true;</literal> to your user's
+     configuration file, like this:
 <programlisting>
 {
   allowUnsupportedSystem = true;
 }
 </programlisting>
-      </para>
-    </listitem>
+    </para>
+   </listitem>
   </itemizedlist>
 
   <para>
-    The difference between an 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.
+   The difference between an 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.
   </para>
-</section>
-
-<section xml:id="sec-allow-unfree">
+ </section>
+ <section xml:id="sec-allow-unfree">
   <title>Installing unfree packages</title>
 
-  <para>There are several ways to tweak how Nix handles a package
-  which has been marked as unfree.</para>
+  <para>
+   There are several ways to tweak how Nix handles a package which has been
+   marked as unfree.
+  </para>
 
   <itemizedlist>
-    <listitem><para>
-      To temporarily allow all unfree packages, you can use an
-      environment variable for a single invocation of the nix tools:
-
-      <programlisting>$ export NIXPKGS_ALLOW_UNFREE=1</programlisting>
-    </para></listitem>
-
-    <listitem><para>
-      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.</para>
-
-      <para>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:
+   <listitem>
+    <para>
+     To temporarily allow all unfree packages, you can use an environment
+     variable for a single invocation of the nix tools:
+<programlisting>$ export NIXPKGS_ALLOW_UNFREE=1</programlisting>
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     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.
+    </para>
+    <para>
+     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:
 <programlisting>
 {
   allowUnfreePredicate = (pkg: false);
 }
 </programlisting>
-      </para>
-
-      <para>A more useful example, the following configuration allows
-      only allows flash player and visual studio code:
-
+    </para>
+    <para>
+     A more useful example, the following configuration allows only allows
+     flash player and visual studio code:
 <programlisting>
 {
   allowUnfreePredicate = (pkg: elem (builtins.parseDrvName pkg.name).name [ "flashplayer" "vscode" ]);
 }
 </programlisting>
-    </para></listitem>
-
-    <listitem>
-      <para>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.
-      </para>
-
-      <para>The following example configuration whitelists the
-      licenses <literal>amd</literal> and <literal>wtfpl</literal>:
-
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     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.
+    </para>
+    <para>
+     The following example configuration whitelists the licenses
+     <literal>amd</literal> and <literal>wtfpl</literal>:
 <programlisting>
 {
   whitelistedLicenses = with stdenv.lib.licenses; [ amd wtfpl ];
 }
 </programlisting>
-      </para>
-
-      <para>The following example configuration blacklists the
-      <literal>gpl3</literal> and <literal>agpl3</literal> licenses:
-
+    </para>
+    <para>
+     The following example configuration blacklists the <literal>gpl3</literal>
+     and <literal>agpl3</literal> licenses:
 <programlisting>
 {
   blacklistedLicenses = with stdenv.lib.licenses; [ agpl3 gpl3 ];
 }
 </programlisting>
-      </para>
-    </listitem>
+    </para>
+   </listitem>
   </itemizedlist>
 
-  <para>A complete list of licenses can be found in the file
-  <filename>lib/licenses.nix</filename> of the nixpkgs tree.</para>
-</section>
-
-
-<section xml:id="sec-allow-insecure">
-  <title>
-    Installing insecure packages
-  </title>
+  <para>
+   A complete list of licenses can be found in the file
+   <filename>lib/licenses.nix</filename> of the nixpkgs tree.
+  </para>
+ </section>
+ <section xml:id="sec-allow-insecure">
+  <title>Installing insecure packages</title>
 
-  <para>There are several ways to tweak how Nix handles a package
-  which has been marked as insecure.</para>
+  <para>
+   There are several ways to tweak how Nix handles a package which has been
+   marked as insecure.
+  </para>
 
   <itemizedlist>
-    <listitem><para>
-      To temporarily allow all insecure packages, you can use an
-      environment variable for a single invocation of the nix tools:
-
-      <programlisting>$ export NIXPKGS_ALLOW_INSECURE=1</programlisting>
-    </para></listitem>
-
-    <listitem><para>
-      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.</para>
-
-      <para>The following example configuration permits the
-      installation of the hypothetically insecure package
-      <literal>hello</literal>, version <literal>1.2.3</literal>:
+   <listitem>
+    <para>
+     To temporarily allow all insecure packages, you can use an environment
+     variable for a single invocation of the nix tools:
+<programlisting>$ export NIXPKGS_ALLOW_INSECURE=1</programlisting>
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     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.
+    </para>
+    <para>
+     The following example configuration permits the installation of the
+     hypothetically insecure package <literal>hello</literal>, version
+     <literal>1.2.3</literal>:
 <programlisting>
 {
   permittedInsecurePackages = [
@@ -232,47 +251,44 @@ distributing the software.</para>
   ];
 }
 </programlisting>
-      </para>
-    </listitem>
-
-    <listitem><para>
-      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.</para>
-
-      <para>The <literal>allowInsecurePredicate</literal> option is a
-      function which accepts a package and returns a boolean, much
-      like <literal>allowUnfreePredicate</literal>.</para>
-
-      <para>The following configuration example only allows insecure
-      packages with very short names:
-
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     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.
+    </para>
+    <para>
+     The <literal>allowInsecurePredicate</literal> option is a function which
+     accepts a package and returns a boolean, much like
+     <literal>allowUnfreePredicate</literal>.
+    </para>
+    <para>
+     The following configuration example only allows insecure packages with
+     very short names:
 <programlisting>
 {
   allowInsecurePredicate = (pkg: (builtins.stringLength (builtins.parseDrvName pkg.name).name) &lt;= 5);
 }
 </programlisting>
-      </para>
-
-      <para>Note that <literal>permittedInsecurePackages</literal> is
-      only checked if <literal>allowInsecurePredicate</literal> is not
-      specified.
-    </para></listitem>
+    </para>
+    <para>
+     Note that <literal>permittedInsecurePackages</literal> is only checked if
+     <literal>allowInsecurePredicate</literal> is not specified.
+    </para>
+   </listitem>
   </itemizedlist>
-</section>
-
+ </section>
 <!--============================================================-->
+ <section xml:id="sec-modify-via-packageOverrides">
+  <title>Modify packages via <literal>packageOverrides</literal></title>
 
-<section xml:id="sec-modify-via-packageOverrides"><title>Modify
-packages via <literal>packageOverrides</literal></title>
-
-<para>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 return modified
-set of packages.
-
+  <para>
+   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 return
+   modified set of packages.
 <programlisting>
 {
   packageOverrides = pkgs: rec {
@@ -280,30 +296,27 @@ set of packages.
   };
 }
 </programlisting>
-
-</para>
-
-</section>
-
-<section xml:id="sec-declarative-package-management">
+  </para>
+ </section>
+ <section xml:id="sec-declarative-package-management">
   <title>Declarative Package Management</title>
 
   <section xml:id="sec-building-environment">
-    <title>Build an environment</title>
-
-    <para>
-      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>:
-    </para>
-
-    <screen>
+   <title>Build an environment</title>
+
+   <para>
+    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>:
+   </para>
+
+<screen>
 {
   packageOverrides = pkgs: with pkgs; {
     myPackages = pkgs.buildEnv {
@@ -314,17 +327,17 @@ set of packages.
 }
     </screen>
 
-    <para>
-      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:
-    </para>
-
-    <screen>
+   <para>
+    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:
+   </para>
+
+<screen>
 {
   packageOverrides = pkgs: with pkgs; {
     myPackages = pkgs.buildEnv {
@@ -336,31 +349,30 @@ set of packages.
 }
     </screen>
 
-    <para>
-      <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.
-    </para>
-
+   <para>
+    <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.
+   </para>
   </section>
 
   <section xml:id="sec-getting-documentation">
-    <title>Getting documentation</title>
-
-    <para>
-      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.
-    </para>
-
-    <screen>
+   <title>Getting documentation</title>
+
+   <para>
+    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.
+   </para>
+
+<screen>
 {
   packageOverrides = pkgs: with pkgs; {
     myPackages = pkgs.buildEnv {
@@ -373,14 +385,13 @@ set of packages.
 }
     </screen>
 
-    <para>
-      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.
-    </para>
+   <para>
+    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.
+   </para>
 
-    <screen>
+<screen>
 {
   packageOverrides = pkgs: with pkgs; rec {
     myProfile = writeText "my-profile" ''
@@ -412,13 +423,13 @@ cp ${myProfile} $out/etc/profile.d/my-profile.sh
 }
     </screen>
 
-    <para>
-      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:
-    </para>
+   <para>
+    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:
+   </para>
 
-    <screen>
+<screen>
 #!/bin/sh
 if [ -d $HOME/.nix-profile/etc/profile.d ]; then
   for i in $HOME/.nix-profile/etc/profile.d/*.sh; do
@@ -429,23 +440,22 @@ if [ -d $HOME/.nix-profile/etc/profile.d ]; then
 fi
     </screen>
 
-    <para>
-      Now just run <literal>source $HOME/.profile</literal> and you can starting
-      loading man pages from your environent.
-    </para>
-
+   <para>
+    Now just run <literal>source $HOME/.profile</literal> and you can starting
+    loading man pages from your environent.
+   </para>
   </section>
 
   <section xml:id="sec-gnu-info-setup">
-    <title>GNU info setup</title>
+   <title>GNU info setup</title>
 
-    <para>
-      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.
-    </para>
+   <para>
+    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.
+   </para>
 
-    <screen>
+<screen>
 {
   packageOverrides = pkgs: with pkgs; rec {
     myProfile = writeText "my-profile" ''
@@ -487,16 +497,13 @@ cp ${myProfile} $out/etc/profile.d/my-profile.sh
 }
     </screen>
 
-    <para>
-      <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.
-    </para>
-
+   <para>
+    <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.
+   </para>
   </section>
-
-</section>
-
+ </section>
 </chapter>
diff --git a/doc/contributing.xml b/doc/contributing.xml
index 7aa0df271ff..d28442b7a2c 100644
--- a/doc/contributing.xml
+++ b/doc/contributing.xml
@@ -1,35 +1,35 @@
 <chapter xmlns="http://docbook.org/ns/docbook"
          xmlns:xlink="http://www.w3.org/1999/xlink"
          xml:id="chap-contributing">
-
-<title>Contributing to this documentation</title>
-
-<para>The DocBook sources of the Nixpkgs manual are in the <filename
+ <title>Contributing to this documentation</title>
+ <para>
+  The DocBook sources of the Nixpkgs manual are in the
+  <filename
 xlink:href="https://github.com/NixOS/nixpkgs/tree/master/doc">doc</filename>
-subdirectory of the Nixpkgs repository.</para>
-
-<para>You can quickly check your edits with <command>make</command>:</para>
-
+  subdirectory of the Nixpkgs repository.
+ </para>
+ <para>
+  You can quickly check your edits with <command>make</command>:
+ </para>
 <screen>
   $ cd /path/to/nixpkgs/doc
   $ nix-shell
   [nix-shell]$ make
 </screen>
-
-<para>If you experience problems, run <command>make debug</command>
-to help understand the docbook errors.</para>
-
-<para>After making modifications to the manual, it's important to
-build it before committing. You can do that as follows:
-
+ <para>
+  If you experience problems, run <command>make debug</command> to help
+  understand the docbook errors.
+ </para>
+ <para>
+  After making modifications to the manual, it's important to build it before
+  committing. You can do that as follows:
 <screen>
   $ cd /path/to/nixpkgs/doc
   $ nix-shell
   [nix-shell]$ make clean
   [nix-shell]$ nix-build .
 </screen>
-
-If the build succeeds, the manual will be in
-<filename>./result/share/doc/nixpkgs/manual.html</filename>.</para>
-
+  If the build succeeds, the manual will be in
+  <filename>./result/share/doc/nixpkgs/manual.html</filename>.
+ </para>
 </chapter>
diff --git a/doc/cross-compilation.xml b/doc/cross-compilation.xml
index 0b2b85aeeef..fe0e0d88d30 100644
--- a/doc/cross-compilation.xml
+++ b/doc/cross-compilation.xml
@@ -1,308 +1,469 @@
 <chapter xmlns="http://docbook.org/ns/docbook"
          xmlns:xlink="http://www.w3.org/1999/xlink"
          xml:id="chap-cross">
-
-<title>Cross-compilation</title>
-
-<section xml:id="sec-cross-intro">
+ <title>Cross-compilation</title>
+ <section xml:id="sec-cross-intro">
   <title>Introduction</title>
+
   <para>
-    "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, but there are advantages to being rigorous about distinguishing build-time vs run-time environments 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.
+   "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, but there are advantages
+   to being rigorous about distinguishing build-time vs run-time environments
+   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.
   </para>
 
   <para>
-    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.
+   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.
   </para>
-</section>
-
+ </section>
 <!--============================================================-->
-
-<section xml:id="sec-cross-packaging">
+ <section xml:id="sec-cross-packaging">
   <title>Packaging in a cross-friendly manner</title>
 
   <section>
-    <title>Platform parameters</title>
-    <para>
-      Nixpkgs follows the <link xlink:href="https://gcc.gnu.org/onlinedocs/gccint/Configure-Terms.html">common historical convention of GNU autoconf</link> of distinguishing between 3 types of platform: <wordasword>build</wordasword>, <wordasword>host</wordasword>, and <wordasword>target</wordasword>.
+   <title>Platform parameters</title>
 
-      In summary, <wordasword>build</wordasword> is the platform on which a package is being built, <wordasword>host</wordasword> is the platform on which it is to run. The third attribute, <wordasword>target</wordasword>, is relevant only for certain specific compilers and build tools.
-    </para>
+   <para>
+    Nixpkgs follows the
+    <link xlink:href="https://gcc.gnu.org/onlinedocs/gccint/Configure-Terms.html">common
+    historical convention of GNU autoconf</link> of distinguishing between 3
+    types of platform: <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
+    is to run. The third attribute, <wordasword>target</wordasword>, is
+    relevant only for certain specific compilers and build tools.
+   </para>
 
-    <para>
-      In Nixpkgs, these three platforms are defined as attribute sets under the names <literal>buildPlatform</literal>, <literal>hostPlatform</literal>, and <literal>targetPlatform</literal>.
-      All three are always defined as attributes in the standard environment, and at the top level. That means one can get at them just like a dependency in a function that is imported with <literal>callPackage</literal>:
-      <programlisting>{ stdenv, buildPlatform, hostPlatform, fooDep, barDep, .. }: ...buildPlatform...</programlisting>, or just off <varname>stdenv</varname>:
-      <programlisting>{ stdenv, fooDep, barDep, .. }: ...stdenv.buildPlatform...</programlisting>.
-    </para>
-    <variablelist>
-      <varlistentry>
-        <term><varname>buildPlatform</varname></term>
-        <listitem><para>
-          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 be safe to ignore.
-        </para></listitem>
-      </varlistentry>
-      <varlistentry>
-        <term><varname>hostPlatform</varname></term>
-        <listitem><para>
-          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.
-        </para></listitem>
-      </varlistentry>
-      <varlistentry>
-        <term><varname>targetPlatform</varname></term>
-        <listitem>
-          <para>
-            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.
-          </para>
-          <para>
-            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 specifying this single "target platform" is thus pushed to build time of the compiler.
-            The root cause of this mistake is often that the compiler (which will be run on the host) and the the standard library/runtime (which will be run on the target) are built by a single build process.
-          </para>
-          <para>
-            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.
-          </para>
-          <para>
-            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.
-          </para>
-        </listitem>
-      </varlistentry>
-    </variablelist>
-    <para>
-      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:
-    </para>
-    <variablelist>
-      <varlistentry>
-        <term><varname>system</varname></term>
-        <listitem>
-          <para>
-            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.
-            This format isn't very standard, but has built-in support in Nix, such as the <varname>builtins.currentSystem</varname> impure string.
-          </para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term><varname>config</varname></term>
-        <listitem>
-          <para>
-            This is a 3- or 4- component shorthand for the platform.
-            Examples of this would be "x86_64-unknown-linux-gnu" and "aarch64-apple-darwin14".
-            This is a standard format called the "LLVM target triple", as they are pioneered by LLVM and traditionally just used for the <varname>targetPlatform</varname>.
-            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>!
-          </para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term><varname>parsed</varname></term>
-        <listitem>
-          <para>
-            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>.
-            [Technically, only one need be specified and the others can be inferred, though the precision of inference may not be very good.]
-            See <literal>lib.systems.parse</literal> for the exact representation.
-          </para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term><varname>libc</varname></term>
-        <listitem>
-          <para>
-            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>.
-          </para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term><varname>is*</varname></term>
-        <listitem>
-          <para>
-            These predicates are defined in <literal>lib.systems.inspect</literal>, and slapped on 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.
-          </para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term><varname>platform</varname></term>
-        <listitem>
-          <para>
-            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!
-          </para>
-        </listitem>
-      </varlistentry>
-    </variablelist>
+   <para>
+    In Nixpkgs, these three platforms are defined as attribute sets under the
+    names <literal>buildPlatform</literal>, <literal>hostPlatform</literal>,
+    and <literal>targetPlatform</literal>. All three are always defined as
+    attributes in the standard environment, and at the top level. That means
+    one can get at them just like a dependency in a function that is imported
+    with <literal>callPackage</literal>:
+<programlisting>{ stdenv, buildPlatform, hostPlatform, fooDep, barDep, .. }: ...buildPlatform...</programlisting>
+    , or just off <varname>stdenv</varname>:
+<programlisting>{ stdenv, fooDep, barDep, .. }: ...stdenv.buildPlatform...</programlisting>
+    .
+   </para>
+
+   <variablelist>
+    <varlistentry>
+     <term><varname>buildPlatform</varname>
+     </term>
+     <listitem>
+      <para>
+       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 be safe to ignore.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>hostPlatform</varname>
+     </term>
+     <listitem>
+      <para>
+       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.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>targetPlatform</varname>
+     </term>
+     <listitem>
+      <para>
+       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.
+      </para>
+      <para>
+       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 specifying this single "target platform"
+       is thus pushed to build time of the compiler. The root cause of this
+       mistake is often that the compiler (which will be run on the host) and
+       the the standard library/runtime (which will be run on the target) are
+       built by a single build process.
+      </para>
+      <para>
+       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.
+      </para>
+      <para>
+       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.
+      </para>
+     </listitem>
+    </varlistentry>
+   </variablelist>
+
+   <para>
+    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:
+   </para>
+
+   <variablelist>
+    <varlistentry>
+     <term><varname>system</varname>
+     </term>
+     <listitem>
+      <para>
+       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. This format isn't very
+       standard, but has built-in support in Nix, such as the
+       <varname>builtins.currentSystem</varname> impure string.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>config</varname>
+     </term>
+     <listitem>
+      <para>
+       This is a 3- or 4- component shorthand for the platform. Examples of
+       this would be "x86_64-unknown-linux-gnu" and "aarch64-apple-darwin14".
+       This is a standard format called the "LLVM target triple", as they are
+       pioneered by LLVM and traditionally just used for the
+       <varname>targetPlatform</varname>. 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>!
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>parsed</varname>
+     </term>
+     <listitem>
+      <para>
+       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>. [Technically, only one need
+       be specified and the others can be inferred, though the precision of
+       inference may not be very good.] See
+       <literal>lib.systems.parse</literal> for the exact representation.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>libc</varname>
+     </term>
+     <listitem>
+      <para>
+       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>.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>is*</varname>
+     </term>
+     <listitem>
+      <para>
+       These predicates are defined in <literal>lib.systems.inspect</literal>,
+       and slapped on 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.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>platform</varname>
+     </term>
+     <listitem>
+      <para>
+       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!
+      </para>
+     </listitem>
+    </varlistentry>
+   </variablelist>
   </section>
 
   <section>
-    <title>Specifying Dependencies</title>
-    <para>
-      In this section we explore the relationship between both runtime and buildtime dependencies and the 3 Autoconf platforms.
-    </para>
-    <para>
-      A runtime dependency between 2 packages implies that between them both the host and target 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.
-    </para>
-    <para>
-      A build time dependency, however, implies a shift in platforms between the depending package and the depended-on package.
-      The meaning of a build time dependency is 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.
-      Analogously, the depending package's host platform is equal to the depended-on package's target platform.
-    </para>
-    <para>
-      In this manner, given the 3 platforms for one package, we can determine the three platforms for all its transitive dependencies.
-      This is the most important guiding principle behind cross-compilation with Nixpkgs, and will be called the <wordasword>sliding window principle</wordasword>.
-    </para>
+   <title>Specifying Dependencies</title>
+
+   <para>
+    In this section we explore the relationship between both runtime and
+    buildtime dependencies and the 3 Autoconf platforms.
+   </para>
+
+   <para>
+    A runtime dependency between 2 packages implies that between them both the
+    host and target 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.
+   </para>
+
+   <para>
+    A build time dependency, however, implies a shift in platforms between the
+    depending package and the depended-on package. The meaning of a build time
+    dependency is 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. Analogously,
+    the depending package's host platform is equal to the depended-on package's
+    target platform.
+   </para>
+
+   <para>
+    In this manner, given the 3 platforms for one package, we can determine the
+    three platforms for all its transitive dependencies. This is the most
+    important guiding principle behind cross-compilation with Nixpkgs, and will
+    be called the <wordasword>sliding window principle</wordasword>.
+   </para>
+
+   <para>
+    Some examples will probably make this clearer. If a package is being built
+    with a <literal>(build, host, target)</literal> platform triple of
+    <literal>(foo, bar, bar)</literal>, then its build-time dependencies would
+    have a triple of <literal>(foo, foo, bar)</literal>, and <emphasis>those
+    packages'</emphasis> build-time dependencies would have triple of
+    <literal>(foo, foo, foo)</literal>. In other words, it should take two
+    "rounds" of following build-time dependency edges before one reaches a
+    fixed point where, by the sliding window principle, the platform triple no
+    longer changes. Indeed, this happens with cross compilation, where only
+    rounds of native dependencies starting with the second necessarily coincide
+    with native packages.
+   </para>
+
+   <note>
     <para>
-      Some examples will probably make this clearer.
-      If a package is being built with a <literal>(build, host, target)</literal> platform triple of <literal>(foo, bar, bar)</literal>, then its build-time dependencies would have a triple of <literal>(foo, foo, bar)</literal>, and <emphasis>those packages'</emphasis> build-time dependencies would have triple of <literal>(foo, foo, foo)</literal>.
-      In other words, it should take two "rounds" of following build-time dependency edges before one reaches a fixed point where, by the sliding window principle, the platform triple no longer changes.
-      Indeed, this happens with cross compilation, where only rounds of native dependencies starting with the second necessarily coincide with native packages.
+     The depending package's target platform is unconstrained by the sliding
+     window principle, which makes sense in that one can in principle build
+     cross compilers targeting arbitrary platforms.
     </para>
-    <note><para>
-      The depending package's target platform is unconstrained by the sliding window principle, which makes sense in that one can in principle build cross compilers targeting arbitrary platforms.
-    </para></note>
+   </note>
+
+   <para>
+    How does this work in practice? Nixpkgs is now structured so that
+    build-time dependencies are taken from <varname>buildPackages</varname>,
+    whereas run-time dependencies are taken from the top level attribute set.
+    For example, <varname>buildPackages.gcc</varname> should be used at build
+    time, while <varname>gcc</varname> should be used at run time. Now, for
+    most of Nixpkgs's history, there was no <varname>buildPackages</varname>,
+    and most packages have not been refactored to use it explicitly. Instead,
+    one can use the six (<emphasis>gasp</emphasis>) attributes used for
+    specifying dependencies as documented in
+    <xref linkend="ssec-stdenv-dependencies"/>. We "splice" together the
+    run-time and build-time package sets with <varname>callPackage</varname>,
+    and then <varname>mkDerivation</varname> for each of four attributes pulls
+    the right derivation out. This splicing can be skipped when not cross
+    compiling as the package sets are the same, but is a bit slow for cross
+    compiling. Because of this, a best-of-both-worlds solution is in the works
+    with no splicing or explicit access of <varname>buildPackages</varname>
+    needed. For now, feel free to use either method.
+   </para>
+
+   <note>
     <para>
-      How does this work in practice? Nixpkgs is now structured so that build-time dependencies are taken from <varname>buildPackages</varname>, whereas run-time dependencies are taken from the top level attribute set.
-      For example, <varname>buildPackages.gcc</varname> should be used at build time, while <varname>gcc</varname> should be used at run time.
-      Now, for most of Nixpkgs's history, there was no <varname>buildPackages</varname>, and most packages have not been refactored to use it explicitly.
-      Instead, one can use the six (<emphasis>gasp</emphasis>) attributes used for specifying dependencies as documented in <xref linkend="ssec-stdenv-dependencies"/>.
-      We "splice" together the run-time and build-time package sets with <varname>callPackage</varname>, and then <varname>mkDerivation</varname> for each of four attributes pulls the right derivation out.
-      This splicing can be skipped when not cross compiling as the package sets are the same, but is a bit slow for cross compiling.
-      Because of this, a best-of-both-worlds solution is in the works with no splicing or explicit access of <varname>buildPackages</varname> needed.
-      For now, feel free to use either method.
+     There is also a "backlink" <varname>targetPackages</varname>, yielding a
+     package set whose <varname>buildPackages</varname> is the current package
+     set. This is a hack, though, to accommodate compilers with lousy build
+     systems. Please do not use this unless you are absolutely sure you are
+     packaging such a compiler and there is no other way.
     </para>
-    <note><para>
-      There is also a "backlink" <varname>targetPackages</varname>, yielding a package set whose <varname>buildPackages</varname> is the current package set.
-      This is a hack, though, to accommodate compilers with lousy build systems.
-      Please do not use this unless you are absolutely sure you are packaging such a compiler and there is no other way.
-    </para></note>
+   </note>
   </section>
 
   <section>
-    <title>Cross packagaing cookbook</title>
-    <para>
-      Some frequently problems when packaging for cross compilation are good to just spell and answer.
-      Ideally the information above is exhaustive, so this section cannot provide any new information,
-      but its 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!
-    </para>
-    <qandaset>
-      <qandaentry>
-        <question><para>
-          What if my package's build system needs to build a C program to be run under the build environment?
-        </para></question>
-        <answer><para>
-          <programlisting>depsBuildBuild = [ buildPackages.stdenv.cc ];</programlisting>
-          Add it to your <function>mkDerivation</function> invocation.
-        </para></answer>
-      </qandaentry>
-      <qandaentry>
-        <question><para>
-          My package fails to find <command>ar</command>.
-        </para></question>
-        <answer><para>
-          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`.
-        </para></answer>
-      </qandaentry>
-      <qandaentry>
-        <question><para>
-          My package's testsuite needs to run host platform code.
-        </para></question>
-        <answer><para>
-          <programlisting>doCheck = stdenv.hostPlatform != stdenv.buildPlatfrom;</programlisting>
-          Add it to your <function>mkDerivation</function> invocation.
-        </para></answer>
-      </qandaentry>
-    </qandaset>
-  </section>
-</section>
+   <title>Cross packagaing cookbook</title>
 
-<!--============================================================-->
+   <para>
+    Some frequently problems when packaging for cross compilation are good to
+    just spell and answer. Ideally the information above is exhaustive, so this
+    section cannot provide any new information, but its 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!
+   </para>
 
-<section xml:id="sec-cross-usage">
+   <qandaset>
+    <qandaentry>
+     <question>
+      <para>
+       What if my package's build system needs to build a C program to be run
+       under the build environment?
+      </para>
+     </question>
+     <answer>
+      <para>
+<programlisting>depsBuildBuild = [ buildPackages.stdenv.cc ];</programlisting>
+       Add it to your <function>mkDerivation</function> invocation.
+      </para>
+     </answer>
+    </qandaentry>
+    <qandaentry>
+     <question>
+      <para>
+       My package fails to find <command>ar</command>.
+      </para>
+     </question>
+     <answer>
+      <para>
+       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`.
+      </para>
+     </answer>
+    </qandaentry>
+    <qandaentry>
+     <question>
+      <para>
+       My package's testsuite needs to run host platform code.
+      </para>
+     </question>
+     <answer>
+      <para>
+<programlisting>doCheck = stdenv.hostPlatform != stdenv.buildPlatfrom;</programlisting>
+       Add it to your <function>mkDerivation</function> invocation.
+      </para>
+     </answer>
+    </qandaentry>
+   </qandaset>
+  </section>
+ </section>
+<!--============================================================-->
+ <section xml:id="sec-cross-usage">
   <title>Cross-building packages</title>
-  <note><para>
-    More information needs to moved from the old wiki, especially <link xlink:href="https://nixos.org/wiki/CrossCompiling" />, for this section.
-  </para></note>
+
+  <note>
+   <para>
+    More information needs to moved from the old wiki, especially
+    <link xlink:href="https://nixos.org/wiki/CrossCompiling" />, for this
+    section.
+   </para>
+  </note>
+
   <para>
-    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: <programlisting>
+   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:
+<programlisting>
 nix-build &lt;nixpkgs&gt; --arg crossSystem '(import &lt;nixpkgs/lib&gt;).systems.examples.fooBarBaz' -A whatever</programlisting>
   </para>
+
   <note>
-    <para>
-      Eventually we would like to make these platform examples an unnecessary convenience so that <programlisting>
+   <para>
+    Eventually we would like to make these platform examples an unnecessary
+    convenience so that
+<programlisting>
 nix-build &lt;nixpkgs&gt; --arg crossSystem.config '&lt;arch&gt;-&lt;os&gt;-&lt;vendor&gt;-&lt;abi&gt;' -A whatever</programlisting>
-      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.
-    </para>
+    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.
+   </para>
   </note>
+
   <para>
-    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.
+   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.
   </para>
+
   <note>
-    <para>
-      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.
-    </para>
+   <para>
+    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.
+   </para>
   </note>
+
   <para>
-    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 then is <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.
+   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 then is
+   <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.
   </para>
-</section>
-
+ </section>
 <!--============================================================-->
-
-<section xml:id="sec-cross-infra">
+ <section xml:id="sec-cross-infra">
   <title>Cross-compilation infrastructure</title>
-  <para>To be written.</para>
-  <note><para>
-    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.
-  </para></note>
-</section>
 
+  <para>
+   To be written.
+  </para>
+
+  <note>
+   <para>
+    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.
+   </para>
+  </note>
+ </section>
 </chapter>
diff --git a/doc/default.nix b/doc/default.nix
index e5be364506f..0d95d3f0457 100644
--- a/doc/default.nix
+++ b/doc/default.nix
@@ -7,7 +7,7 @@ in
 pkgs.stdenv.mkDerivation {
   name = "nixpkgs-manual";
 
-  buildInputs = with pkgs; [ pandoc libxml2 libxslt zip jing ];
+  buildInputs = with pkgs; [ pandoc libxml2 libxslt zip jing  xmlformat ];
 
   src = ./.;
 
@@ -18,6 +18,7 @@ pkgs.stdenv.mkDerivation {
   HIGHLIGHTJS = pkgs.documentation-highlighter;
   XSL = "${pkgs.docbook5_xsl}/xml/xsl";
   RNG = "${pkgs.docbook5}/xml/rng/docbook/docbook.rng";
+  XMLFORMAT_CONFIG = ../nixos/doc/xmlformat.conf;
   xsltFlags = lib.concatStringsSep " " [
     "--param section.autolabel 1"
     "--param section.label.includes.component.label 1"
diff --git a/doc/functions.xml b/doc/functions.xml
index b2e45097294..cdae96703f1 100644
--- a/doc/functions.xml
+++ b/doc/functions.xml
@@ -1,144 +1,139 @@
 <chapter xmlns="http://docbook.org/ns/docbook"
 	 xmlns:xlink="http://www.w3.org/1999/xlink"
 	 xml:id="chap-functions">
-
-<title>Functions reference</title>
-
-<para>
-  The nixpkgs repository has several utility functions to manipulate Nix expressions.
-</para>
-
-<section xml:id="sec-overrides">
+ <title>Functions reference</title>
+ <para>
+  The nixpkgs repository has several utility functions to manipulate Nix
+  expressions.
+ </para>
+ <section xml:id="sec-overrides">
   <title>Overriding</title>
 
   <para>
-    Sometimes one wants to override parts of
-    <literal>nixpkgs</literal>, e.g. derivation attributes, the results of
-    derivations or even the whole package set.
+   Sometimes one wants to override parts of <literal>nixpkgs</literal>, e.g.
+   derivation attributes, the results of derivations or even the whole package
+   set.
   </para>
 
   <section xml:id="sec-pkg-override">
-    <title>&lt;pkg&gt;.override</title>
+   <title>&lt;pkg&gt;.override</title>
 
-    <para>
-      The function <varname>override</varname> is usually available for all the
-      derivations in the nixpkgs expression (<varname>pkgs</varname>).
-    </para>
-    <para>
-      It is used to override the arguments passed to a function.
-    </para>
-    <para>
-      Example usages:
+   <para>
+    The function <varname>override</varname> is usually available for all the
+    derivations in the nixpkgs expression (<varname>pkgs</varname>).
+   </para>
+
+   <para>
+    It is used to override the arguments passed to a function.
+   </para>
 
-      <programlisting>pkgs.foo.override { arg1 = val1; arg2 = val2; ... }</programlisting>
-      <programlisting>import pkgs.path { overlays = [ (self: super: {
+   <para>
+    Example usages:
+<programlisting>pkgs.foo.override { arg1 = val1; arg2 = val2; ... }</programlisting>
+<programlisting>import pkgs.path { overlays = [ (self: super: {
     foo = super.foo.override { barSupport = true ; };
   })]};</programlisting>
-      <programlisting>mypkg = pkgs.callPackage ./mypkg.nix {
+<programlisting>mypkg = pkgs.callPackage ./mypkg.nix {
     mydep = pkgs.mydep.override { ... };
   }</programlisting>
-    </para>
-
-    <para>
-      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.
-    </para>
-
+   </para>
+
+   <para>
+    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.
+   </para>
   </section>
 
   <section xml:id="sec-pkg-overrideAttrs">
-    <title>&lt;pkg&gt;.overrideAttrs</title>
-
-    <para>
-      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>.
-    </para>
-
-    <para>
-      Example usage:
-
-      <programlisting>helloWithDebug = pkgs.hello.overrideAttrs (oldAttrs: rec {
+   <title>&lt;pkg&gt;.overrideAttrs</title>
+
+   <para>
+    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>.
+   </para>
+
+   <para>
+    Example usage:
+<programlisting>helloWithDebug = pkgs.hello.overrideAttrs (oldAttrs: rec {
     separateDebugInfo = true;
   });</programlisting>
-    </para>
+   </para>
 
-    <para>
-      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.
-    </para>
+   <para>
+    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.
+   </para>
+
+   <para>
+    The argument <varname>oldAttrs</varname> is conventionally used to refer to
+    the attr set originally passed to <varname>stdenv.mkDerivation</varname>.
+   </para>
 
+   <note>
     <para>
-      The argument <varname>oldAttrs</varname> is conventionally used to refer to
-      the attr set originally passed to <varname>stdenv.mkDerivation</varname>.
+     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>sdenv.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 involves less typing.
     </para>
-
-    <note>
-      <para>
-        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>sdenv.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 involves less typing.
-      </para>
-    </note>
-
+   </note>
   </section>
 
-
   <section xml:id="sec-pkg-overrideDerivation">
-    <title>&lt;pkg&gt;.overrideDerivation</title>
-
-    <warning>
-      <para>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>.
-      </para>
-    </warning>
-
-    <warning>
-      <para>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>.
-    </para>
-    </warning>
+   <title>&lt;pkg&gt;.overrideDerivation</title>
 
+   <warning>
     <para>
-      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.
+     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>.
     </para>
+   </warning>
 
+   <warning>
     <para>
-      Example usage:
-
-      <programlisting>mySed = pkgs.gnused.overrideDerivation (oldAttrs: {
+     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>.
+    </para>
+   </warning>
+
+   <para>
+    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.
+   </para>
+
+   <para>
+    Example usage:
+<programlisting>mySed = pkgs.gnused.overrideDerivation (oldAttrs: {
     name = "sed-4.2.2-pre";
     src = fetchurl {
       url = ftp://alpha.gnu.org/gnu/sed/sed-4.2.2-pre.tar.bz2;
@@ -146,98 +141,90 @@
     };
     patches = [];
   });</programlisting>
-    </para>
+   </para>
 
-    <para>
-      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.
-    </para>
+   <para>
+    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.
+   </para>
 
+   <para>
+    The argument <varname>oldAttrs</varname> is used to refer to the attribute
+    set of the original derivation.
+   </para>
+
+   <note>
     <para>
-      The argument <varname>oldAttrs</varname> is used to refer to the attribute set of
-      the original derivation.
+     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.
     </para>
-
-    <note>
-      <para>
-        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.
-      </para>
-    </note>
-
+   </note>
   </section>
 
   <section xml:id="sec-lib-makeOverridable">
-    <title>lib.makeOverridable</title>
+   <title>lib.makeOverridable</title>
 
-    <para>
-      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.
-    </para>
-
-    <para>
-      Example usage:
+   <para>
+    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.
+   </para>
 
-      <programlisting>f = { a, b }: { result = a+b; }
+   <para>
+    Example usage:
+<programlisting>f = { a, b }: { result = a+b; }
   c = lib.makeOverridable f { a = 1; b = 2; }</programlisting>
-
-    </para>
-
-    <para>
-      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.
-    </para>
-
-    <para>
-      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.
-    </para>
-
+   </para>
+
+   <para>
+    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.
+   </para>
+
+   <para>
+    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.
+   </para>
   </section>
-
-</section>
-
-<section xml:id="sec-generators">
+ </section>
+ <section xml:id="sec-generators">
   <title>Generators</title>
 
   <para>
-    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>
+   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>
   </para>
 
   <para>
-    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.
+   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.
   </para>
 
   <para>
-    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:
+   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:
   </para>
 
 <programlisting>
@@ -270,7 +257,9 @@ in customToINI {
 }
 </programlisting>
 
-  <para>This will produce the following INI file as nix string:</para>
+  <para>
+   This will produce the following INI file as nix string:
+  </para>
 
 <programlisting>
 [main]
@@ -284,111 +273,138 @@ str\:ange:"very::strange"
 merge:"diff3"
 </programlisting>
 
-  <note><para>Nix store paths can be converted to strings by enclosing a
-  derivation attribute like so: <code>"${drv}"</code>.</para></note>
+  <note>
+   <para>
+    Nix store paths can be converted to strings by enclosing a derivation
+    attribute like so: <code>"${drv}"</code>.
+   </para>
+  </note>
 
   <para>
-    Detailed documentation for each generator can be found in
-    <literal>lib/generators.nix</literal>.
+   Detailed documentation for each generator can be found in
+   <literal>lib/generators.nix</literal>.
   </para>
-
-</section>
-
-<section xml:id="sec-debug">
+ </section>
+ <section xml:id="sec-debug">
   <title>Debugging Nix Expressions</title>
 
-  <para>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.</para>
-
-
-  <para>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.</para>
-</section>
-
+  <para>
+   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.
+  </para>
 
-<section xml:id="sec-fhs-environments">
+  <para>
+   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.
+  </para>
+ </section>
+ <section xml:id="sec-fhs-environments">
   <title>buildFHSUserEnv</title>
 
   <para>
-    <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:
+   <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:
   </para>
 
   <variablelist>
-    <varlistentry>
-    <term><literal>name</literal></term>
-
-    <listitem><para>Environment name.</para></listitem>
-    </varlistentry>
-
-    <varlistentry>
-    <term><literal>targetPkgs</literal></term>
-
-    <listitem><para>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.</para></listitem>
-    </varlistentry>
-
-    <varlistentry>
-    <term><literal>multiPkgs</literal></term>
-
-    <listitem><para>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.</para></listitem>
-    </varlistentry>
-
-    <varlistentry>
-    <term><literal>extraBuildCommands</literal></term>
-
-    <listitem><para>Additional commands to be executed for finalizing the
-    directory structure.</para></listitem>
-    </varlistentry>
-
-    <varlistentry>
-    <term><literal>extraBuildCommandsMulti</literal></term>
-
-    <listitem><para>Like <literal>extraBuildCommands</literal>, but
-    executed only on multilib architectures.</para></listitem>
-    </varlistentry>
-
-    <varlistentry>
-    <term><literal>extraOutputsToInstall</literal></term>
-
-    <listitem><para>Additional derivation outputs to be linked for both
-    target and multi-architecture packages.</para></listitem>
-    </varlistentry>
-
-    <varlistentry>
-    <term><literal>extraInstallCommands</literal></term>
-
-    <listitem><para>Additional commands to be executed for finalizing the
-    derivation with runner script.</para></listitem>
-    </varlistentry>
-
-    <varlistentry>
-    <term><literal>runScript</literal></term>
-
-    <listitem><para>A command that would be executed inside the sandbox and
-    passed all the command line arguments. It defaults to
-    <literal>bash</literal>.</para></listitem>
-    </varlistentry>
+   <varlistentry>
+    <term><literal>name</literal>
+    </term>
+    <listitem>
+     <para>
+      Environment name.
+     </para>
+    </listitem>
+   </varlistentry>
+   <varlistentry>
+    <term><literal>targetPkgs</literal>
+    </term>
+    <listitem>
+     <para>
+      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.
+     </para>
+    </listitem>
+   </varlistentry>
+   <varlistentry>
+    <term><literal>multiPkgs</literal>
+    </term>
+    <listitem>
+     <para>
+      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.
+     </para>
+    </listitem>
+   </varlistentry>
+   <varlistentry>
+    <term><literal>extraBuildCommands</literal>
+    </term>
+    <listitem>
+     <para>
+      Additional commands to be executed for finalizing the directory
+      structure.
+     </para>
+    </listitem>
+   </varlistentry>
+   <varlistentry>
+    <term><literal>extraBuildCommandsMulti</literal>
+    </term>
+    <listitem>
+     <para>
+      Like <literal>extraBuildCommands</literal>, but executed only on multilib
+      architectures.
+     </para>
+    </listitem>
+   </varlistentry>
+   <varlistentry>
+    <term><literal>extraOutputsToInstall</literal>
+    </term>
+    <listitem>
+     <para>
+      Additional derivation outputs to be linked for both target and
+      multi-architecture packages.
+     </para>
+    </listitem>
+   </varlistentry>
+   <varlistentry>
+    <term><literal>extraInstallCommands</literal>
+    </term>
+    <listitem>
+     <para>
+      Additional commands to be executed for finalizing the derivation with
+      runner script.
+     </para>
+    </listitem>
+   </varlistentry>
+   <varlistentry>
+    <term><literal>runScript</literal>
+    </term>
+    <listitem>
+     <para>
+      A command that would be executed inside the sandbox and passed all the
+      command line arguments. It defaults to <literal>bash</literal>.
+     </para>
+    </listitem>
+   </varlistentry>
   </variablelist>
 
   <para>
-    One can create a simple environment using a <literal>shell.nix</literal>
-    like that:
+   One can create a simple environment using a <literal>shell.nix</literal>
+   like that:
   </para>
 
 <programlisting><![CDATA[
@@ -413,50 +429,49 @@ merge:"diff3"
 ]]></programlisting>
 
   <para>
-    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.
+   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.
   </para>
-</section>
-
-<section xml:id="sec-pkgs-dockerTools">
-<title>pkgs.dockerTools</title>
+ </section>
+ <section xml:id="sec-pkgs-dockerTools">
+  <title>pkgs.dockerTools</title>
 
-<para>
-  <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.
-</para>
-
-<warning>
   <para>
-  The <varname>dockerTools</varname> API is unstable and may be subject to
-  backwards-incompatible changes in the future.
+   <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.
   </para>
-</warning>
-
-<section xml:id="ssec-pkgs-dockerTools-buildImage">
-  <title>buildImage</title>
 
-  <para>
-  This function is analogous to the <command>docker build</command> command,
-  in that can 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>.
-  </para>
-
-  <para>
-  The parameters of <varname>buildImage</varname> with relative example values are
-  described below:
-  </para>
-
-  <example xml:id='ex-dockerTools-buildImage'><title>Docker build</title>
-  <programlisting>
+  <warning>
+   <para>
+    The <varname>dockerTools</varname> API is unstable and may be subject to
+    backwards-incompatible changes in the future.
+   </para>
+  </warning>
+
+  <section xml:id="ssec-pkgs-dockerTools-buildImage">
+   <title>buildImage</title>
+
+   <para>
+    This function is analogous to the <command>docker build</command> command,
+    in that can 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>.
+   </para>
+
+   <para>
+    The parameters of <varname>buildImage</varname> with relative example
+    values are described below:
+   </para>
+
+   <example xml:id='ex-dockerTools-buildImage'>
+    <title>Docker build</title>
+<programlisting>
   buildImage {
     name = "redis"; <co xml:id='ex-dockerTools-buildImage-1' />
     tag = "latest"; <co xml:id='ex-dockerTools-buildImage-2' />
@@ -480,238 +495,217 @@ merge:"diff3"
     };
   }
   </programlisting>
-  </example>
-
-  <para>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.
-  </para>
-
-  <calloutlist>
-  <callout arearefs='ex-dockerTools-buildImage-1'>
+   </example>
+
+   <para>
+    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.
+   </para>
+
+   <calloutlist>
+    <callout arearefs='ex-dockerTools-buildImage-1'>
+     <para>
+      <varname>name</varname> specifies the name of the resulting image. This
+      is the only required argument for <varname>buildImage</varname>.
+     </para>
+    </callout>
+    <callout arearefs='ex-dockerTools-buildImage-2'>
+     <para>
+      <varname>tag</varname> specifies the tag of the resulting image. By
+      default it's <literal>latest</literal>.
+     </para>
+    </callout>
+    <callout arearefs='ex-dockerTools-buildImage-3'>
+     <para>
+      <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>.
+     </para>
+    </callout>
+    <callout arearefs='ex-dockerTools-buildImage-4'>
+     <para>
+      <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.
+     </para>
+    </callout>
+    <callout arearefs='ex-dockerTools-buildImage-5'>
+     <para>
+      <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.
+     </para>
+    </callout>
+    <callout arearefs='ex-dockerTools-buildImage-6'>
+     <para>
+      <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>.
+     </para>
+    </callout>
+    <callout arearefs='ex-dockerTools-buildImage-runAsRoot'>
+     <para>
+      <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>.
+      <note>
+       <para>
+        Using this parameter requires the <literal>kvm</literal> device to be
+        available.
+       </para>
+      </note>
+     </para>
+    </callout>
+    <callout arearefs='ex-dockerTools-buildImage-8'>
+     <para>
+      <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>.
+     </para>
+    </callout>
+   </calloutlist>
+
+   <para>
+    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.
+   </para>
+
+   <para>
+    At the end of the process, only one new single layer will be produced and
+    added to the resulting image.
+   </para>
+
+   <para>
+    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>.
+   </para>
+
+   <para>
+    It is possible to inspect the arguments with which an image was built using
+    its <varname>buildArgs</varname> attribute.
+   </para>
+
+   <note>
     <para>
-    <varname>name</varname> specifies the name of the resulting image.
-    This is the only required argument for <varname>buildImage</varname>.
+     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>.
     </para>
-  </callout>
+   </note>
 
-  <callout arearefs='ex-dockerTools-buildImage-2'>
+   <note>
     <para>
-    <varname>tag</varname> specifies the tag of the resulting image.
-    By default it's <literal>latest</literal>.
+     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>.
     </para>
-  </callout>
-
-  <callout arearefs='ex-dockerTools-buildImage-3'>
-    <para>
-    <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>.
-    </para>
-  </callout>
-
-  <callout arearefs='ex-dockerTools-buildImage-4'>
-    <para>
-    <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.
-    </para>
-  </callout>
-
-  <callout arearefs='ex-dockerTools-buildImage-5'>
-    <para>
-    <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.
-    </para>
-  </callout>
-
-  <callout arearefs='ex-dockerTools-buildImage-6'>
-    <para>
-    <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>.
-    </para>
-  </callout>
-
-  <callout arearefs='ex-dockerTools-buildImage-runAsRoot'>
-    <para>
-    <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>.
-
-    <note>
-      <para>
-      Using this parameter requires the <literal>kvm</literal>
-      device to be available.
-      </para>
-    </note>
-    </para>
-  </callout>
-
-  <callout arearefs='ex-dockerTools-buildImage-8'>
-    <para>
-    <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>.
-    </para>
-  </callout>
-
-  </calloutlist>
-
-  <para>
-  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.
-  </para>
-
-  <para>
-  At the end of the process, only one new single layer will be produced and
-  added to the resulting image.
-  </para>
-
-  <para>
-  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>.
-  </para>
-
-  <para>
-  It is possible to inspect the arguments with which an image was built
-  using its <varname>buildArgs</varname> attribute.
-  </para>
-
-
-
-  <note>
-  <para>
-  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>.
-  </para>
-  </note>
-
-  <note>
-  <para>
-  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>.
-  </para>
-  </note>
-
-</section>
+   </note>
+  </section>
 
-<section xml:id="ssec-pkgs-dockerTools-fetchFromRegistry">
-  <title>pullImage</title>
+  <section xml:id="ssec-pkgs-dockerTools-fetchFromRegistry">
+   <title>pullImage</title>
 
-  <para>
-  This function is analogous to the <command>docker pull</command> command,
-  in that can be used to fetch a Docker image from a Docker registry.
-  Currently only registry <literal>v1</literal> is supported.
-  By default <link xlink:href="https://hub.docker.com/">Docker Hub</link>
-  is used to pull images.
-  </para>
+   <para>
+    This function is analogous to the <command>docker pull</command> command,
+    in that 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.
+   </para>
 
-  <para>
-  Its parameters are described in the example below:
-  </para>
+   <para>
+    Its parameters are described in the example below:
+   </para>
 
-  <example xml:id='ex-dockerTools-pullImage'><title>Docker pull</title>
-  <programlisting>
+   <example xml:id='ex-dockerTools-pullImage'>
+    <title>Docker pull</title>
+<programlisting>
   pullImage {
-    imageName = "debian"; <co xml:id='ex-dockerTools-pullImage-1' />
-    imageTag = "jessie"; <co xml:id='ex-dockerTools-pullImage-2' />
-    imageId = null; <co xml:id='ex-dockerTools-pullImage-3' />
-    sha256 = "1bhw5hkz6chrnrih0ymjbmn69hyfriza2lr550xyvpdrnbzr4gk2"; <co xml:id='ex-dockerTools-pullImage-4' />
-
-    indexUrl = "https://index.docker.io"; <co xml:id='ex-dockerTools-pullImage-5' />
-    registryVersion = "v1";
+    imageName = "nixos/nix"; <co xml:id='ex-dockerTools-pullImage-1' />
+    imageDigest = "sha256:20d9485b25ecfd89204e843a962c1bd70e9cc6858d65d7f5fadc340246e2116b"; <co xml:id='ex-dockerTools-pullImage-2' />
+    finalImageTag = "1.11";  <co xml:id='ex-dockerTools-pullImage-3' />
+    sha256 = "0mqjy3zq2v6rrhizgb9nvhczl87lcfphq9601wcprdika2jz7qh8"; <co xml:id='ex-dockerTools-pullImage-4' />
   }
   </programlisting>
-  </example>
-
-  <calloutlist>
-  <callout arearefs='ex-dockerTools-pullImage-1'>
-    <para>
-    <varname>imageName</varname> specifies the name of the image to be downloaded,
-    which can also include the registry namespace (e.g. <literal>library/debian</literal>).
-    This argument is required.
-    </para>
-  </callout>
-
-  <callout arearefs='ex-dockerTools-pullImage-2'>
-    <para>
-    <varname>imageTag</varname> specifies the tag of the image to be downloaded.
-    By default it's <literal>latest</literal>.
-    </para>
-  </callout>
-
-  <callout arearefs='ex-dockerTools-pullImage-3'>
-    <para>
-    <varname>imageId</varname>, if specified this exact image will be fetched, instead
-    of <varname>imageName/imageTag</varname>. However, the resulting repository
-    will still be named <varname>imageName/imageTag</varname>.
-    By default it's <literal>null</literal>.
-    </para>
-  </callout>
-
-  <callout arearefs='ex-dockerTools-pullImage-4'>
-    <para>
-    <varname>sha256</varname> is the checksum of the whole fetched image.
-    This argument is required.
-    </para>
+   </example>
+
+   <calloutlist>
+    <callout arearefs='ex-dockerTools-pullImage-1'>
+     <para>
+      <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.
+     </para>
+    </callout>
+    <callout arearefs='ex-dockerTools-pullImage-2'>
+     <para>
+      <varname>imageDigest</varname> specifies the digest of the image
+      to be downloaded. Skopeo can be used to get the digest of an image
+<programlisting>
+  $ skopeo inspect docker://docker.io/nixos/nix:1.11 | jq -r '.Digest'
+  sha256:20d9485b25ecfd89204e843a962c1bd70e9cc6858d65d7f5fadc340246e2116b
+  </programlisting>
+      This argument is required.
+     </para>
+    </callout>
+    <callout arearefs='ex-dockerTools-pullImage-3'>
+     <para>
+      <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>.
+     </para>
+    </callout>
+    <callout arearefs='ex-dockerTools-pullImage-4'>
+     <para>
+      <varname>sha256</varname> is the checksum of the whole fetched image.
+      This argument is required.
+     </para>
+    </callout>
+   </calloutlist>
+  </section>
 
-    <note>
-    <para>The checksum is computed on the unpacked directory, not on the final tarball.</para>
-    </note>
+  <section xml:id="ssec-pkgs-dockerTools-exportImage">
+   <title>exportImage</title>
 
-  </callout>
+   <para>
+    This function is analogous to the <command>docker export</command> command,
+    in that can 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>.
+   </para>
 
-  <callout arearefs='ex-dockerTools-pullImage-5'>
+   <note>
     <para>
-    In the above example the default values are shown for the variables
-    <varname>indexUrl</varname> and <varname>registryVersion</varname>.
-    Hence by default the Docker.io registry is used to pull the images.
+     Using this function requires the <literal>kvm</literal> device to be
+     available.
     </para>
-  </callout>
-  </calloutlist>
-
-</section>
-
-<section xml:id="ssec-pkgs-dockerTools-exportImage">
-  <title>exportImage</title>
-
-  <para>
-  This function is analogous to the <command>docker export</command> command,
-  in that can 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>.
-  </para>
-
-  <note>
-  <para>
-    Using this function requires the <literal>kvm</literal>
-    device to be available.
-  </para>
-  </note>
+   </note>
 
-  <para>
-  The parameters of <varname>exportImage</varname> are the following:
-  </para>
+   <para>
+    The parameters of <varname>exportImage</varname> are the following:
+   </para>
 
-  <example xml:id='ex-dockerTools-exportImage'><title>Docker export</title>
-  <programlisting>
+   <example xml:id='ex-dockerTools-exportImage'>
+    <title>Docker export</title>
+<programlisting>
   exportImage {
     fromImage = someLayeredImage;
     fromImageName = null;
@@ -720,33 +714,35 @@ merge:"diff3"
     name = someLayeredImage.name;
   }
   </programlisting>
-  </example>
-
-  <para>
-  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.
-  </para>
-
-  <para>
-  The <varname>name</varname> argument is the name of the derivation output,
-  which defaults to <varname>fromImage.name</varname>.
-  </para>
-</section>
+   </example>
+
+   <para>
+    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.
+   </para>
+
+   <para>
+    The <varname>name</varname> argument is the name of the derivation output,
+    which defaults to <varname>fromImage.name</varname>.
+   </para>
+  </section>
 
-<section xml:id="ssec-pkgs-dockerTools-shadowSetup">
-  <title>shadowSetup</title>
+  <section xml:id="ssec-pkgs-dockerTools-shadowSetup">
+   <title>shadowSetup</title>
 
-  <para>
-  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:
-  </para>
+   <para>
+    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:
+   </para>
 
-  <example xml:id='ex-dockerTools-shadowSetup'><title>Shadow base files</title>
-  <programlisting>
+   <example xml:id='ex-dockerTools-shadowSetup'>
+    <title>Shadow base files</title>
+<programlisting>
   buildImage {
     name = "shadow-basic";
 
@@ -760,16 +756,13 @@ merge:"diff3"
     '';
   }
   </programlisting>
-  </example>
-
-  <para>
-  Creating base files like <literal>/etc/passwd</literal> or
-  <literal>/etc/login.defs</literal> are necessary for shadow-utils to
-  manipulate users and groups.
-  </para>
-
-</section>
-
-</section>
+   </example>
 
+   <para>
+    Creating base files like <literal>/etc/passwd</literal> or
+    <literal>/etc/login.defs</literal> are necessary for shadow-utils to
+    manipulate users and groups.
+   </para>
+  </section>
+ </section>
 </chapter>
diff --git a/doc/languages-frameworks/beam.xml b/doc/languages-frameworks/beam.xml
index 1a18ed27237..ac7a83ed426 100644
--- a/doc/languages-frameworks/beam.xml
+++ b/doc/languages-frameworks/beam.xml
@@ -1,124 +1,137 @@
 <section xmlns="http://docbook.org/ns/docbook"
          xmlns:xlink="http://www.w3.org/1999/xlink"
          xml:id="sec-beam">
+ <title>BEAM Languages (Erlang, Elixir &amp; LFE)</title>
 
-  <title>BEAM Languages (Erlang, Elixir &amp; LFE)</title>
-  <section xml:id="beam-introduction">
-    <title>Introduction</title>
-    <para>
-      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.
-    </para>
-  </section>
-  <section xml:id="beam-structure">
-    <title>Structure</title>
-    <para>
-      All BEAM-related expressions are available via the top-level
-      <literal>beam</literal> attribute, which includes:
-    </para>
-    <itemizedlist>
-      <listitem>
-        <para>
-          <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>).
-        </para>
-      </listitem>
-      <listitem>
-        <para>
-          <literal>packages</literal>: a set of package sets, each compiled with
-          a specific Erlang/OTP version, e.g.
-          <literal>beam.packages.erlangR19</literal>.
-        </para>
-      </listitem>
-    </itemizedlist>
-    <para>
-      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>.
-    </para>
+ <section xml:id="beam-introduction">
+  <title>Introduction</title>
+
+  <para>
+   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.
+  </para>
+ </section>
+
+ <section xml:id="beam-structure">
+  <title>Structure</title>
+
+  <para>
+   All BEAM-related expressions are available via the top-level
+   <literal>beam</literal> attribute, which includes:
+  </para>
+
+  <itemizedlist>
+   <listitem>
     <para>
-      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>.
+     <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>).
     </para>
+   </listitem>
+   <listitem>
     <para>
-      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>.
+     <literal>packages</literal>: a set of package sets, each compiled with a
+     specific Erlang/OTP version, e.g.
+     <literal>beam.packages.erlangR19</literal>.
     </para>
-    <para xml:id="erlang-call-package">
-      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.
-    </para>
-  </section>
-  <section xml:id="build-tools">
+   </listitem>
+  </itemizedlist>
+
+  <para>
+   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>.
+  </para>
+
+  <para>
+   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>.
+  </para>
+
+  <para>
+   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>.
+  </para>
+
+  <para xml:id="erlang-call-package">
+   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.
+  </para>
+ </section>
+
+ <section xml:id="build-tools">
   <title>Build Tools</title>
+
   <section xml:id="build-tools-rebar3">
-    <title>Rebar3</title>
-    <para>
-      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:
-      <itemizedlist>
-        <listitem>
-          <para>
-            <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.
-          </para>
-        </listitem>
-        <listitem>
-          <para>
-            <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
+   <title>Rebar3</title>
+
+   <para>
+    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:
+    <itemizedlist>
+     <listitem>
+      <para>
+       <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.
+      </para>
+     </listitem>
+     <listitem>
+      <para>
+       <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
             linkend="rebar3-packages"/>.
-          </para>
-        </listitem>
-      </itemizedlist>
-    </para>
+      </para>
+     </listitem>
+    </itemizedlist>
+   </para>
   </section>
+
   <section xml:id="build-tools-other">
-    <title>Mix &amp; Erlang.mk</title>
-    <para>
-      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.
-    </para>
+   <title>Mix &amp; Erlang.mk</title>
+
+   <para>
+    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.
+   </para>
   </section>
-</section>
+ </section>
 
-<section xml:id="how-to-install-beam-packages">
+ <section xml:id="how-to-install-beam-packages">
   <title>How to Install BEAM Packages</title>
+
   <para>
-    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:
+   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:
   </para>
 
-  <programlisting>
+<programlisting>
 $ nix-env -f &quot;&lt;nixpkgs&gt;&quot; -qaP -A beamPackages
 beamPackages.esqlite    esqlite-0.2.1
 beamPackages.goldrush   goldrush-0.1.7
@@ -128,34 +141,43 @@ beamPackages.lager      lager-3.0.2
 beamPackages.meck       meck-0.8.3
 beamPackages.rebar3-pc  pc-1.1.0
   </programlisting>
+
   <para>
-    To install any of those packages into your profile, refer to them by their
-    attribute path (first column):
+   To install any of those packages into your profile, refer to them by their
+   attribute path (first column):
   </para>
-  <programlisting>
+
+<programlisting>
 $ nix-env -f &quot;&lt;nixpkgs&gt;&quot; -iA beamPackages.ibrowse
   </programlisting>
+
   <para>
-    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.
+   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.
   </para>
-</section>
-<section xml:id="packaging-beam-applications">
+ </section>
+
+ <section xml:id="packaging-beam-applications">
   <title>Packaging BEAM Applications</title>
+
   <section  xml:id="packaging-erlang-applications">
-    <title>Erlang Applications</title>
-    <section xml:id="rebar3-packages">
-      <title>Rebar3 Packages</title>
-      <para>
-        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
-        xlink:href="https://github.com/erlang-nix/hex2nix">hex2nix</link> as
-        follows:
-      </para>
-      <programlisting>
+   <title>Erlang Applications</title>
+
+   <section xml:id="rebar3-packages">
+    <title>Rebar3 Packages</title>
+
+    <para>
+     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
+        xlink:href="https://github.com/erlang-nix/hex2nix">hex2nix</link>
+     as follows:
+    </para>
+
+<programlisting>
         { stdenv, fetchFromGitHub, buildRebar3, ibrowse, jsx, erlware_commons }:
 
         buildRebar3 rec {
@@ -172,33 +194,40 @@ $ nix-env -f &quot;&lt;nixpkgs&gt;&quot; -iA beamPackages.ibrowse
           beamDeps = [ ibrowse jsx erlware_commons ];
         }
       </programlisting>
-      <para>
-        Such derivations are callable with
-        <literal>beam.packages.erlang.callPackage</literal> (see <xref
-        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>.
-      </para>
-      <para>
-        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.
-      </para>
-      <para>
-        If a package needs to compile native code via Rebar3's port compilation
-        mechanism, add <literal>compilePort = true;</literal> to the derivation.
-      </para>
-    </section>
-    <section xml:id="erlang-mk-packages">
-      <title>Erlang.mk Packages</title>
-      <para>
-        Erlang.mk functions similarly to Rebar3, except we use
-        <literal>buildErlangMk</literal> instead of
-        <literal>buildRebar3</literal>.
-      </para>
-      <programlisting>
+
+    <para>
+     Such derivations are callable with
+     <literal>beam.packages.erlang.callPackage</literal> (see
+     <xref
+        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>.
+    </para>
+
+    <para>
+     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.
+    </para>
+
+    <para>
+     If a package needs to compile native code via Rebar3's port compilation
+     mechanism, add <literal>compilePort = true;</literal> to the derivation.
+    </para>
+   </section>
+
+   <section xml:id="erlang-mk-packages">
+    <title>Erlang.mk Packages</title>
+
+    <para>
+     Erlang.mk functions similarly to Rebar3, except we use
+     <literal>buildErlangMk</literal> instead of
+     <literal>buildRebar3</literal>.
+    </para>
+
+<programlisting>
         { buildErlangMk, fetchHex, cowlib, ranch }:
 
         buildErlangMk {
@@ -222,14 +251,17 @@ $ nix-env -f &quot;&lt;nixpkgs&gt;&quot; -iA beamPackages.ibrowse
           };
         }
       </programlisting>
-    </section>
-    <section xml:id="mix-packages">
-      <title>Mix Packages</title>
-      <para>
-        Mix functions similarly to Rebar3, except we use
-        <literal>buildMix</literal> instead of <literal>buildRebar3</literal>.
-      </para>
-      <programlisting>
+   </section>
+
+   <section xml:id="mix-packages">
+    <title>Mix Packages</title>
+
+    <para>
+     Mix functions similarly to Rebar3, except we use
+     <literal>buildMix</literal> instead of <literal>buildRebar3</literal>.
+    </para>
+
+<programlisting>
         { buildMix, fetchHex, plug, absinthe }:
 
         buildMix {
@@ -253,10 +285,12 @@ $ nix-env -f &quot;&lt;nixpkgs&gt;&quot; -iA beamPackages.ibrowse
           };
         }
       </programlisting>
-      <para>
-        Alternatively, we can use <literal>buildHex</literal> as a shortcut:
-      </para>
-      <programlisting>
+
+    <para>
+     Alternatively, we can use <literal>buildHex</literal> as a shortcut:
+    </para>
+
+<programlisting>
         { buildHex, buildMix, plug, absinthe }:
 
         buildHex {
@@ -278,21 +312,25 @@ $ nix-env -f &quot;&lt;nixpkgs&gt;&quot; -iA beamPackages.ibrowse
          };
        }
       </programlisting>
-    </section>
+   </section>
   </section>
-</section>
-<section xml:id="how-to-develop">
+ </section>
+
+ <section xml:id="how-to-develop">
   <title>How to Develop</title>
+
   <section xml:id="accessing-an-environment">
-    <title>Accessing an Environment</title>
-    <para>
-      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:
-    </para>
-    <programlisting>
+   <title>Accessing an Environment</title>
+
+   <para>
+    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:
+   </para>
+
+<programlisting>
       $ nix-shell -A beamPackages.ibrowse.env --run "erl"
       Erlang/OTP 18 [erts-7.0] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]
 
@@ -333,22 +371,25 @@ $ nix-env -f &quot;&lt;nixpkgs&gt;&quot; -iA beamPackages.ibrowse
       ok
       2>
     </programlisting>
-    <para>
-      Notice the <literal>-A beamPackages.ibrowse.env</literal>. That is the key
-      to this functionality.
-    </para>
+
+   <para>
+    Notice the <literal>-A beamPackages.ibrowse.env</literal>. That is the key
+    to this functionality.
+   </para>
   </section>
+
   <section xml:id="creating-a-shell">
-    <title>Creating a Shell</title>
-    <para>
-      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.
-    </para>
-    <programlisting>
+   <title>Creating a Shell</title>
+
+   <para>
+    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.
+   </para>
+
+<programlisting>
 { pkgs ? import &quot;&lt;nixpkgs&quot;&gt; {} }:
 
 with pkgs;
@@ -368,13 +409,16 @@ in
 
   drv
     </programlisting>
-    <section xml:id="building-in-a-shell">
+
+   <section xml:id="building-in-a-shell">
     <title>Building in a Shell (for Mix Projects)</title>
+
     <para>
-      We can leverage the support of the derivation, irrespective of the build
-      derivation, by calling the commands themselves.
+     We can leverage the support of the derivation, irrespective of the build
+     derivation, by calling the commands themselves.
     </para>
-    <programlisting>
+
+<programlisting>
 # =============================================================================
 # Variables
 # =============================================================================
@@ -431,44 +475,54 @@ analyze: build plt
         $(NIX_SHELL) --run "mix dialyzer --no-compile"
 
     </programlisting>
+
     <para>
-      Using a <literal>shell.nix</literal> as described (see <xref
+     Using a <literal>shell.nix</literal> as described (see
+     <xref
       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.
+     <literal>test</literal>, <literal>plt</literal>, and
+     <literal>analyze</literal>, the Make targets work just fine for all of the
+     build derivations.
     </para>
+   </section>
   </section>
-</section>
-</section>
-<section xml:id="generating-packages-from-hex-with-hex2nix">
+ </section>
+
+ <section xml:id="generating-packages-from-hex-with-hex2nix">
   <title>Generating Packages from Hex with <literal>hex2nix</literal></title>
+
   <para>
-    Updating the <link xlink:href="https://hex.pm">Hex</link> package set
-    requires <link
-    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
-    xlink:href="https://hex.pm">Hex</link>. It can't be determined, however,
-    whether every package is buildable.
-    </para>
-    <para>
-      To make life easier for our users, try to build every <link
-      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:
-    </para>
-    <programlisting>
+   Updating the <link xlink:href="https://hex.pm">Hex</link> package set
+   requires
+   <link
+    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
+    xlink:href="https://hex.pm">Hex</link>. It can't be determined,
+   however, whether every package is buildable.
+  </para>
+
+  <para>
+   To make life easier for our users, try to build every
+   <link
+      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:
+  </para>
+
+<programlisting>
 $ nix-build -A beamPackages
     </programlisting>
-    <para>
-      That will attempt to build every package in
-      <literal>beamPackages</literal>. Then manually remove those that fail.
-      Hopefully, someone will improve <link
-      xlink:href="https://github.com/erlang-nix/hex2nix">hex2nix</link> in the
-      future to automate the process.
-    </para>
-</section>
+
+  <para>
+   That will attempt to build every package in <literal>beamPackages</literal>.
+   Then manually remove those that fail. Hopefully, someone will improve
+   <link
+      xlink:href="https://github.com/erlang-nix/hex2nix">hex2nix</link>
+   in the future to automate the process.
+  </para>
+ </section>
 </section>
diff --git a/doc/languages-frameworks/bower.xml b/doc/languages-frameworks/bower.xml
index 742d3c2e9fe..db7536cdc14 100644
--- a/doc/languages-frameworks/bower.xml
+++ b/doc/languages-frameworks/bower.xml
@@ -1,40 +1,37 @@
 <section xmlns="http://docbook.org/ns/docbook"
          xmlns:xlink="http://www.w3.org/1999/xlink"
          xml:id="sec-bower">
-
-<title>Bower</title>
-
-<para>
-  <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.
-</para>
-
-<para>
-  The end result of running Bower is a
-  <filename>bower_components</filename> directory which can be included
-  in the web app's build process.
-</para>
-
-<para>
+ <title>Bower</title>
+
+ <para>
+  <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.
+ </para>
+
+ <para>
+  The end result of running Bower is a <filename>bower_components</filename>
+  directory which can be included in the web app's build process.
+ </para>
+
+ <para>
   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>.
-</para>
+ </para>
 
-<section xml:id="ssec-bower2nix-usage">
+ <section xml:id="ssec-bower2nix-usage">
   <title><command>bower2nix</command> usage</title>
 
-<para>
-  Suppose you have a <filename>bower.json</filename> with the following contents:
-
-
-<example xml:id="ex-bowerJson"><title><filename>bower.json</filename></title>
+  <para>
+   Suppose you have a <filename>bower.json</filename> with the following
+   contents:
+   <example xml:id="ex-bowerJson">
+    <title><filename>bower.json</filename></title>
 <programlisting language="json">
 <![CDATA[{
   "name": "my-web-app",
@@ -44,14 +41,12 @@
   }
 }]]>
 </programlisting>
-</example>
-</para>
-
-
-<para>
-  Running <command>bower2nix</command> will produce something like the
-  following output:
+   </example>
+  </para>
 
+  <para>
+   Running <command>bower2nix</command> will produce something like the
+   following output:
 <programlisting language="nix">
 <![CDATA[{ fetchbower, buildEnv }:
 buildEnv { name = "bower-env"; ignoreCollisions = true; paths = [
@@ -60,31 +55,31 @@ buildEnv { name = "bower-env"; ignoreCollisions = true; paths = [
   (fetchbower "jquery" "2.2.2" "1.9.1 - 2" "10sp5h98sqwk90y4k6hbdviwqzvzwqf47r3r51pakch5ii2y7js1")
 ]; }]]>
 </programlisting>
-</para>
-
+  </para>
 
-<para>
-  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.
-</para>
+  <para>
+   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.
+  </para>
 
-<para>
-  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.
-</para>
-</section>
+  <para>
+   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.
+  </para>
+ </section>
 
-<section xml:id="ssec-build-bower-components"><title><varname>buildBowerComponents</varname> function</title>
+ <section xml:id="ssec-build-bower-components">
+  <title><varname>buildBowerComponents</varname> function</title>
 
   <para>
-  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:
-
-<example xml:id="ex-buildBowerComponents"><title>buildBowerComponents</title>
+   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:
+   <example xml:id="ex-buildBowerComponents">
+    <title>buildBowerComponents</title>
 <programlisting language="nix">
 bowerComponents = buildBowerComponents {
   name = "my-web-app";
@@ -92,42 +87,42 @@ bowerComponents = buildBowerComponents {
   src = myWebApp; <co xml:id="ex-buildBowerComponents-2" />
 };
 </programlisting>
-</example>
+   </example>
   </para>
 
-<para>
-In <xref linkend="ex-buildBowerComponents" />, the following arguments
-are of special significance to the function:
-
-<calloutlist>
-  <callout arearefs="ex-buildBowerComponents-1">
-    <para>
-      <varname>generated</varname> specifies the file which was created by <command>bower2nix</command>.
-    </para>
-  </callout>
-
-  <callout arearefs="ex-buildBowerComponents-2">
-    <para>
-      <varname>src</varname> is your project's sources. It needs to
-      contain a <filename>bower.json</filename> file.
-    </para>
-  </callout>
-</calloutlist>
-</para>
-
-<para>
-  <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.
-</para>
-
-<para>
-  Here is an example of a web frontend build process using
-  <command>gulp</command>. You might use <command>grunt</command>, or
-  anything else.
-</para>
-
-<example xml:id="ex-bowerGulpFile"><title>Example build script (<filename>gulpfile.js</filename>)</title>
+  <para>
+   In <xref linkend="ex-buildBowerComponents" />, the following arguments are
+   of special significance to the function:
+   <calloutlist>
+    <callout arearefs="ex-buildBowerComponents-1">
+     <para>
+      <varname>generated</varname> specifies the file which was created by
+      <command>bower2nix</command>.
+     </para>
+    </callout>
+    <callout arearefs="ex-buildBowerComponents-2">
+     <para>
+      <varname>src</varname> is your project's sources. It needs to contain a
+      <filename>bower.json</filename> file.
+     </para>
+    </callout>
+   </calloutlist>
+  </para>
+
+  <para>
+   <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.
+  </para>
+
+  <para>
+   Here is an example of a web frontend build process using
+   <command>gulp</command>. You might use <command>grunt</command>, or anything
+   else.
+  </para>
+
+  <example xml:id="ex-bowerGulpFile">
+   <title>Example build script (<filename>gulpfile.js</filename>)</title>
 <programlisting language="javascript">
 <![CDATA[var gulp = require('gulp');
 
@@ -142,10 +137,10 @@ gulp.task('build', [], function () {
     .pipe(gulp.dest("./gulpdist/"));
 });]]>
 </programlisting>
-</example>
+  </example>
 
-<example xml:id="ex-buildBowerComponentsDefaultNix">
-  <title>Full example — <filename>default.nix</filename></title>
+  <example xml:id="ex-buildBowerComponentsDefaultNix">
+   <title>Full example — <filename>default.nix</filename></title>
 <programlisting language="nix">
 { myWebApp ? { outPath = ./.; name = "myWebApp"; }
 , pkgs ? import &lt;nixpkgs&gt; {}
@@ -172,73 +167,63 @@ pkgs.stdenv.mkDerivation {
   installPhase = "mv gulpdist $out";
 }
 </programlisting>
-</example>
-
-<para>
-A few notes about <xref linkend="ex-buildBowerComponentsDefaultNix" />:
-
-<calloutlist>
-  <callout arearefs="ex-buildBowerComponentsDefault-1">
-    <para>
-      The result of <varname>buildBowerComponents</varname> is an
-      input to the frontend build.
-    </para>
-  </callout>
-
-  <callout arearefs="ex-buildBowerComponentsDefault-2">
-    <para>
-      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.
-    </para>
-  </callout>
-
-  <callout arearefs="ex-buildBowerComponentsDefault-3">
-    <para>
-      <command>gulp</command> requires <varname>HOME</varname> to
-      refer to a writeable directory.
-    </para>
-  </callout>
-
-  <callout arearefs="ex-buildBowerComponentsDefault-4">
-    <para>
+  </example>
+
+  <para>
+   A few notes about <xref linkend="ex-buildBowerComponentsDefaultNix" />:
+   <calloutlist>
+    <callout arearefs="ex-buildBowerComponentsDefault-1">
+     <para>
+      The result of <varname>buildBowerComponents</varname> is an input to the
+      frontend build.
+     </para>
+    </callout>
+    <callout arearefs="ex-buildBowerComponentsDefault-2">
+     <para>
+      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.
+     </para>
+    </callout>
+    <callout arearefs="ex-buildBowerComponentsDefault-3">
+     <para>
+      <command>gulp</command> requires <varname>HOME</varname> to refer to a
+      writeable directory.
+     </para>
+    </callout>
+    <callout arearefs="ex-buildBowerComponentsDefault-4">
+     <para>
       The actual build command. Other tools could be used.
-    </para>
-  </callout>
-</calloutlist>
-</para>
-</section>
+     </para>
+    </callout>
+   </calloutlist>
+  </para>
+ </section>
 
-<section xml:id="ssec-bower2nix-troubleshooting">
+ <section xml:id="ssec-bower2nix-troubleshooting">
   <title>Troubleshooting</title>
 
-<variablelist>
-
-  <varlistentry>
-    <term>
-    <literal>ENOCACHE</literal> errors from
+  <variablelist>
+   <varlistentry>
+    <term><literal>ENOCACHE</literal> errors from
     <varname>buildBowerComponents</varname>
     </term>
     <listitem>
-      <para>
-        This means that Bower was looking for a package version which
-        doesn't exist in the generated
-        <filename>bower-packages.nix</filename>.
-      </para>
-      <para>
-        If <filename>bower.json</filename> has been updated, then run
-        <command>bower2nix</command> again.
-      </para>
-      <para>
-        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>.
-      </para>
+     <para>
+      This means that Bower was looking for a package version which doesn't
+      exist in the generated <filename>bower-packages.nix</filename>.
+     </para>
+     <para>
+      If <filename>bower.json</filename> has been updated, then run
+      <command>bower2nix</command> again.
+     </para>
+     <para>
+      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>.
+     </para>
     </listitem>
-  </varlistentry>
-</variablelist>
-
-</section>
-
+   </varlistentry>
+  </variablelist>
+ </section>
 </section>
diff --git a/doc/languages-frameworks/coq.xml b/doc/languages-frameworks/coq.xml
index 0ce1abd6194..d5f2574039f 100644
--- a/doc/languages-frameworks/coq.xml
+++ b/doc/languages-frameworks/coq.xml
@@ -1,36 +1,38 @@
 <section xmlns="http://docbook.org/ns/docbook"
          xmlns:xlink="http://www.w3.org/1999/xlink"
          xml:id="sec-language-coq">
+ <title>Coq</title>
 
-<title>Coq</title>
-  <para>
-    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.
-  </para>
-  <para>
-    Some libraries require OCaml and sometimes also Camlp5 or findlib.
-    The exact versions that were used to build Coq are saved in the
-    <literal>coq.ocaml</literal> and <literal>coq.camlp5</literal>
-    and <literal>coq.findlib</literal> attributes.
-  </para>
-  <para>
-    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.
-  </para>
-  <para>
-    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.
-  </para>
-  <programlisting>
+ <para>
+  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.
+ </para>
+
+ <para>
+  Some libraries require OCaml and sometimes also Camlp5 or findlib. The exact
+  versions that were used to build Coq are saved in the
+  <literal>coq.ocaml</literal> and <literal>coq.camlp5</literal> and
+  <literal>coq.findlib</literal> attributes.
+ </para>
+
+ <para>
+  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.
+ </para>
+
+ <para>
+  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.
+ </para>
+
+<programlisting>
 { stdenv, fetchFromGitHub, coq, mathcomp }:
 
 stdenv.mkDerivation rec {
diff --git a/doc/languages-frameworks/go.xml b/doc/languages-frameworks/go.xml
index 54ea60c9021..ab4c9f0f7c8 100644
--- a/doc/languages-frameworks/go.xml
+++ b/doc/languages-frameworks/go.xml
@@ -1,14 +1,14 @@
 <section xmlns="http://docbook.org/ns/docbook"
          xmlns:xlink="http://www.w3.org/1999/xlink"
          xml:id="sec-language-go">
+ <title>Go</title>
 
-<title>Go</title>
+ <para>
+  The function <varname>buildGoPackage</varname> builds standard Go programs.
+ </para>
 
-<para>The function <varname>buildGoPackage</varname> builds
-standard Go programs.
-</para>
-
-<example xml:id='ex-buildGoPackage'><title>buildGoPackage</title>
+ <example xml:id='ex-buildGoPackage'>
+  <title>buildGoPackage</title>
 <programlisting>
 deis = buildGoPackage rec {
   name = "deis-${version}";
@@ -29,55 +29,56 @@ deis = buildGoPackage rec {
   buildFlags = "--tags release"; <co xml:id='ex-buildGoPackage-4' />
 }
 </programlisting>
-</example>
-
-<para><xref linkend='ex-buildGoPackage'/> is an example expression using buildGoPackage,
-the following arguments are of special significance to the function:
-
-<calloutlist>
-
-  <callout arearefs='ex-buildGoPackage-1'>
+ </example>
+
+ <para>
+  <xref linkend='ex-buildGoPackage'/> is an example expression using
+  buildGoPackage, the following arguments are of special significance to the
+  function:
+  <calloutlist>
+   <callout arearefs='ex-buildGoPackage-1'>
     <para>
-      <varname>goPackagePath</varname> specifies the package's canonical Go import path.
+     <varname>goPackagePath</varname> specifies the package's canonical Go
+     import path.
     </para>
-  </callout>
-
-  <callout arearefs='ex-buildGoPackage-2'>
+   </callout>
+   <callout arearefs='ex-buildGoPackage-2'>
     <para>
-      <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.
+     <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.
     </para>
     <para>
-      In this example only <literal>github.com/deis/deis/client</literal> will be built.
+     In this example only <literal>github.com/deis/deis/client</literal> will
+     be built.
     </para>
-  </callout>
-
-  <callout arearefs='ex-buildGoPackage-3'>
+   </callout>
+   <callout arearefs='ex-buildGoPackage-3'>
     <para>
-      <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.
+     <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.
     </para>
-  </callout>
-
-  <callout arearefs='ex-buildGoPackage-4'>
+   </callout>
+   <callout arearefs='ex-buildGoPackage-4'>
     <para>
-      <varname>buildFlags</varname> is a list of flags passed to the go build command.
+     <varname>buildFlags</varname> is a list of flags passed to the go build
+     command.
     </para>
-  </callout>
-
-</calloutlist>
-
-</para>
-
-<para>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>.
-</para>
-
-<example xml:id='ex-goDeps'><title>deps.nix</title>
+   </callout>
+  </calloutlist>
+ </para>
+
+ <para>
+  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>.
+ </para>
+
+ <example xml:id='ex-goDeps'>
+  <title>deps.nix</title>
 <programlisting>
 [ <co xml:id='ex-goDeps-1' />
   {
@@ -100,67 +101,60 @@ the following arguments are of special significance to the function:
   }
 ]
 </programlisting>
-</example>
+ </example>
 
-<para>
-
-<calloutlist>
-
-  <callout arearefs='ex-goDeps-1'>
+ <para>
+  <calloutlist>
+   <callout arearefs='ex-goDeps-1'>
     <para>
-      <varname>goDeps</varname> is a list of Go dependencies.
+     <varname>goDeps</varname> is a list of Go dependencies.
     </para>
-  </callout>
-
-  <callout arearefs='ex-goDeps-2'>
+   </callout>
+   <callout arearefs='ex-goDeps-2'>
     <para>
-      <varname>goPackagePath</varname> specifies Go package import path.
+     <varname>goPackagePath</varname> specifies Go package import path.
     </para>
-  </callout>
-
-  <callout arearefs='ex-goDeps-3'>
+   </callout>
+   <callout arearefs='ex-goDeps-3'>
     <para>
-      <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.
+     <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.
     </para>
-  </callout>
-
-</calloutlist>
-
-</para>
-
-<para>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.</para>
-
-<para>
-  <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:
-
-  <screen>
+   </callout>
+  </calloutlist>
+ </para>
+
+ <para>
+  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.
+ </para>
+
+ <para>
+  <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:
+<screen>
     $ nix-build -A deis.bin
   </screen>
-
   or build all outputs with:
-
-  <screen>
+<screen>
     $ nix-build -A deis.all
   </screen>
+  <varname>bin</varname> output will be installed by default with
+  <varname>nix-env -i</varname> or <varname>systemPackages</varname>.
+ </para>
 
-  <varname>bin</varname> output will be installed by default with <varname>nix-env -i</varname>
-  or <varname>systemPackages</varname>.
-
-</para>
-
-<para>
-You may use Go packages installed into the active Nix profiles by adding
-the following to your ~/.bashrc:
-
+ <para>
+  You may use Go packages installed into the active Nix profiles by adding the
+  following to your ~/.bashrc:
 <screen>
 for p in $NIX_PROFILES; do
     GOPATH="$p/share/go:$GOPATH"
 done
 </screen>
-</para>
-
+ </para>
 </section>
diff --git a/doc/languages-frameworks/index.xml b/doc/languages-frameworks/index.xml
index a1c265f6748..f22984cb56b 100644
--- a/doc/languages-frameworks/index.xml
+++ b/doc/languages-frameworks/index.xml
@@ -1,36 +1,31 @@
 <chapter xmlns="http://docbook.org/ns/docbook"
          xmlns:xi="http://www.w3.org/2001/XInclude"
          xml:id="chap-language-support">
-
-<title>Support for specific programming languages and frameworks</title>
-
-<para>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.</para>
-
-
-<xi:include href="beam.xml" />
-<xi:include href="bower.xml" />
-<xi:include href="coq.xml" />
-<xi:include href="go.xml" />
-<xi:include href="haskell.section.xml" />
-<xi:include href="idris.section.xml" />
-<xi:include href="java.xml" />
-<xi:include href="lua.xml" />
-<xi:include href="node.section.xml" />
-<xi:include href="perl.xml" />
-<xi:include href="python.section.xml" />
-<xi:include href="qt.xml" />
-<xi:include href="r.section.xml" />
-<xi:include href="ruby.xml" />
-<xi:include href="rust.section.xml" />
-<xi:include href="texlive.xml" />
-<xi:include href="vim.section.xml" />
-<xi:include href="emscripten.section.xml" />
-
-
+ <title>Support for specific programming languages and frameworks</title>
+ <para>
+  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.
+ </para>
+ <xi:include href="beam.xml" />
+ <xi:include href="bower.xml" />
+ <xi:include href="coq.xml" />
+ <xi:include href="go.xml" />
+ <xi:include href="haskell.section.xml" />
+ <xi:include href="idris.section.xml" />
+ <xi:include href="java.xml" />
+ <xi:include href="lua.xml" />
+ <xi:include href="node.section.xml" />
+ <xi:include href="perl.xml" />
+ <xi:include href="python.section.xml" />
+ <xi:include href="qt.xml" />
+ <xi:include href="r.section.xml" />
+ <xi:include href="ruby.xml" />
+ <xi:include href="rust.section.xml" />
+ <xi:include href="texlive.xml" />
+ <xi:include href="vim.section.xml" />
+ <xi:include href="emscripten.section.xml" />
 </chapter>
diff --git a/doc/languages-frameworks/java.xml b/doc/languages-frameworks/java.xml
index 2507cc2c469..dcf4d17fa57 100644
--- a/doc/languages-frameworks/java.xml
+++ b/doc/languages-frameworks/java.xml
@@ -1,11 +1,10 @@
 <section xmlns="http://docbook.org/ns/docbook"
          xmlns:xlink="http://www.w3.org/1999/xlink"
          xml:id="sec-language-java">
+ <title>Java</title>
 
-<title>Java</title>
-
-<para>Ant-based Java packages are typically built from source as follows:
-
+ <para>
+  Ant-based Java packages are typically built from source as follows:
 <programlisting>
 stdenv.mkDerivation {
   name = "...";
@@ -16,33 +15,33 @@ stdenv.mkDerivation {
   buildPhase = "ant";
 }
 </programlisting>
-
-Note that <varname>jdk</varname> is an alias for the OpenJDK.</para>
-
-<para>JAR files that are intended to be used by other packages should
-be installed in <filename>$out/share/java</filename>.  The OpenJDK has
-a stdenv setup hook that adds 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
-
+  Note that <varname>jdk</varname> is an alias for the OpenJDK.
+ </para>
+
+ <para>
+  JAR files that are intended to be used by other packages should be installed
+  in <filename>$out/share/java</filename>. The OpenJDK has a stdenv setup hook
+  that adds 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
 <programlisting>
 buildInputs = [ jdk libfoo ];
 </programlisting>
-
-then <envar>CLASSPATH</envar> will be set to
-<filename>/nix/store/...-libfoo/share/java/foo.jar</filename>.</para>
-
-<para>Private JARs
-should be installed in a location like
-<filename>$out/share/<replaceable>package-name</replaceable></filename>.</para>
-
-<para>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:
-
+  then <envar>CLASSPATH</envar> will be set to
+  <filename>/nix/store/...-libfoo/share/java/foo.jar</filename>.
+ </para>
+
+ <para>
+  Private JARs should be installed in a location like
+  <filename>$out/share/<replaceable>package-name</replaceable></filename>.
+ </para>
+
+ <para>
+  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:
 <programlisting>
 buildInputs = [ makeWrapper ];
 
@@ -53,23 +52,20 @@ installPhase =
       --add-flags "-cp $out/share/java/foo.jar org.foo.Main"
   '';
 </programlisting>
-
-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.</para>
-
-<para>It is possible to use a different Java compiler than
-<command>javac</command> from the OpenJDK.  For instance, to use the
-GNU Java Compiler:
-
+  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.
+ </para>
+
+ <para>
+  It is possible to use a different Java compiler than <command>javac</command>
+  from the OpenJDK. For instance, to use the GNU Java Compiler:
 <programlisting>
 buildInputs = [ gcj ant ];
 </programlisting>
-
-Here, Ant will automatically use <command>gij</command> (the GNU Java
-Runtime) instead of the OpenJRE.</para>
-
+  Here, Ant will automatically use <command>gij</command> (the GNU Java
+  Runtime) instead of the OpenJRE.
+ </para>
 </section>
-
diff --git a/doc/languages-frameworks/lua.xml b/doc/languages-frameworks/lua.xml
index 39b086af4cb..21014029996 100644
--- a/doc/languages-frameworks/lua.xml
+++ b/doc/languages-frameworks/lua.xml
@@ -1,24 +1,22 @@
 <section xmlns="http://docbook.org/ns/docbook"
          xmlns:xlink="http://www.w3.org/1999/xlink"
          xml:id="sec-language-lua">
+ <title>Lua</title>
 
-<title>Lua</title>
-
-<para>
-  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">
+ <para>
+  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.)
-</para>
+ </para>
 
-<para>
-  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>.
+ <para>
+  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:
-
-  <programlisting>
+<programlisting>
 fileSystem = buildLuaPackage {
   name = "filesystem-1.6.2";
   src = fetchurl {
@@ -32,20 +30,19 @@ fileSystem = buildLuaPackage {
   };
 };
   </programlisting>
-</para>
+ </para>
 
-<para>
+ <para>
   Though, more complicated package should be placed in a seperate file in
   <link
   xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/lua-modules"><filename>pkgs/development/lua-modules</filename></link>.
-</para>
-<para>
-  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.
-</para>
+ </para>
 
+ <para>
+  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.
+ </para>
 </section>
-
diff --git a/doc/languages-frameworks/perl.xml b/doc/languages-frameworks/perl.xml
index 149fcb275a0..2fe64999e13 100644
--- a/doc/languages-frameworks/perl.xml
+++ b/doc/languages-frameworks/perl.xml
@@ -1,24 +1,27 @@
 <section xmlns="http://docbook.org/ns/docbook"
          xmlns:xlink="http://www.w3.org/1999/xlink"
          xml:id="sec-language-perl">
-
-<title>Perl</title>
-
-<para>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
-xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/perl-modules/generic"><filename>pkgs/development/perl-modules/generic</filename></link>.</para>
-
-<para>Perl packages from CPAN are defined in <link
+ <title>Perl</title>
+
+ <para>
+  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
+xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/perl-modules/generic"><filename>pkgs/development/perl-modules/generic</filename></link>.
+ </para>
+
+ <para>
+  Perl packages from CPAN are defined in
+  <link
 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:
-
+  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:
 <programlisting>
 ClassC3 = buildPerlPackage rec {
   name = "Class-C3-0.21";
@@ -28,74 +31,72 @@ ClassC3 = buildPerlPackage rec {
   };
 };
 </programlisting>
-
-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
-
+  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
 <programlisting>
 foo = import ../path/to/foo.nix {
   inherit stdenv fetchurl ...;
   inherit (perlPackages) ClassC3;
 };
 </programlisting>
-
-in <filename>all-packages.nix</filename>.  You can test building a
-Perl package as follows:
-
+  in <filename>all-packages.nix</filename>. You can test building a Perl
+  package as follows:
 <screen>
 $ nix-build -A perlPackages.ClassC3
 </screen>
-
-<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:
-
+  <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:
 <screen>
 $ nix-env -i perl-Class-C3
 </screen>
-
-(Of course you can also install using the attribute name:
-<literal>nix-env -i -A perlPackages.ClassC3</literal>.)</para>
-
-<para>So what does <varname>buildPerlPackage</varname> do?  It does
-the following:
-
-<orderedlist>
-
-  <listitem><para>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></para></listitem>
-
-  <listitem><para>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.</para></listitem>
-
-  <listitem><para>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.</para></listitem>
-
-</orderedlist>
-
-</para>
-
-<para><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>:
-
+  (Of course you can also install using the attribute name: <literal>nix-env -i
+  -A perlPackages.ClassC3</literal>.)
+ </para>
+
+ <para>
+  So what does <varname>buildPerlPackage</varname> do? It does the following:
+  <orderedlist>
+   <listitem>
+    <para>
+     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>
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     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.
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     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.
+    </para>
+   </listitem>
+  </orderedlist>
+ </para>
+
+ <para>
+  <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>:
 <programlisting>
 { buildPerlPackage, fetchurl, db }:
 
@@ -113,18 +114,15 @@ buildPerlPackage rec {
   '';
 }
 </programlisting>
-
-</para>
-
-<para>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:
-
+ </para>
+
+ <para>
+  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:
 <programlisting>
 ClassC3Componentised = buildPerlPackage rec {
   name = "Class-C3-Componentised-1.0004";
@@ -137,24 +135,26 @@ ClassC3Componentised = buildPerlPackage rec {
   ];
 };
 </programlisting>
+ </para>
 
-</para>
-
-<section xml:id="ssec-generation-from-CPAN"><title>Generation from CPAN</title>
+ <section xml:id="ssec-generation-from-CPAN">
+  <title>Generation from CPAN</title>
 
-<para>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:</para>
+  <para>
+   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:
+  </para>
 
 <screen>
 $ nix-env -i nix-generate-from-cpan
 </screen>
 
-<para>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:
-
+  <para>
+   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:
 <screen>
 $ nix-generate-from-cpan XML::Simple
   XMLSimple = buildPerlPackage rec {
@@ -170,26 +170,23 @@ $ nix-generate-from-cpan XML::Simple
     };
   };
 </screen>
-
-The output can be pasted into
-<filename>pkgs/top-level/perl-packages.nix</filename> or wherever else
-you need it.</para>
-
-</section>
-
-<section xml:id="ssec-perl-cross-compilation"><title>Cross-compiling modules</title>
-
-<para>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.</para>
-
-</section>
-
+   The output can be pasted into
+   <filename>pkgs/top-level/perl-packages.nix</filename> or wherever else you
+   need it.
+  </para>
+ </section>
+
+ <section xml:id="ssec-perl-cross-compilation">
+  <title>Cross-compiling modules</title>
+
+  <para>
+   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.
+  </para>
+ </section>
 </section>
-
diff --git a/doc/languages-frameworks/qt.xml b/doc/languages-frameworks/qt.xml
index 1dbbb5341ba..b9b605b81da 100644
--- a/doc/languages-frameworks/qt.xml
+++ b/doc/languages-frameworks/qt.xml
@@ -1,58 +1,74 @@
 <section xmlns="http://docbook.org/ns/docbook"
          xmlns:xlink="http://www.w3.org/1999/xlink"
          xml:id="sec-language-qt">
+ <title>Qt</title>
 
-<title>Qt</title>
-
-<para>
-Qt is a comprehensive desktop and mobile application development toolkit for C++.
-Legacy support is available for Qt 3 and Qt 4, but all current development uses Qt 5.
-The Qt 5 packages in Nixpkgs are updated frequently to take advantage of new features,
-but older versions are typically retained until their support window ends.
-The most important consideration in packaging Qt-based software is ensuring that each package and all its dependencies use the same version of Qt 5;
-this consideration motivates most of the tools described below.
-</para>
-
-<section xml:id="ssec-qt-libraries"><title>Packaging Libraries for Nixpkgs</title>
-
-<para>
-Whenever possible, libraries that use Qt 5 should be built with each available version.
-Packages providing libraries should be added to the top-level function <varname>mkLibsForQt5</varname>,
-which is used to build a set of libraries for every Qt 5 version.
-A special <varname>callPackage</varname> function is used in this scope to ensure that the entire dependency tree uses the same Qt 5 version.
-Import dependencies unqualified, i.e., <literal>qtbase</literal> not <literal>qt5.qtbase</literal>.
-<emphasis>Do not</emphasis> import a package set such as <literal>qt5</literal> or <literal>libsForQt5</literal>.
-</para>
-
-<para>
-If a library does not support a particular version of Qt 5, it is best to mark it as broken by setting its <literal>meta.broken</literal> attribute.
-A package may be marked broken for certain versions by testing the <literal>qtbase.version</literal> attribute, which will always give the current Qt 5 version.
-</para>
+ <para>
+  Qt is a comprehensive desktop and mobile application development toolkit for
+  C++. Legacy support is available for Qt 3 and Qt 4, but all current
+  development uses Qt 5. The Qt 5 packages in Nixpkgs are updated frequently to
+  take advantage of new features, but older versions are typically retained
+  until their support window ends. The most important consideration in
+  packaging Qt-based software is ensuring that each package and all its
+  dependencies use the same version of Qt 5; this consideration motivates most
+  of the tools described below.
+ </para>
 
-</section>
+ <section xml:id="ssec-qt-libraries">
+  <title>Packaging Libraries for Nixpkgs</title>
 
-<section xml:id="ssec-qt-applications"><title>Packaging Applications for Nixpkgs</title>
+  <para>
+   Whenever possible, libraries that use Qt 5 should be built with each
+   available version. Packages providing libraries should be added to the
+   top-level function <varname>mkLibsForQt5</varname>, which is used to build a
+   set of libraries for every Qt 5 version. A special
+   <varname>callPackage</varname> function is used in this scope to ensure that
+   the entire dependency tree uses the same Qt 5 version. Import dependencies
+   unqualified, i.e., <literal>qtbase</literal> not
+   <literal>qt5.qtbase</literal>. <emphasis>Do not</emphasis> import a package
+   set such as <literal>qt5</literal> or <literal>libsForQt5</literal>.
+  </para>
 
-<para>
-Call your application expression using <literal>libsForQt5.callPackage</literal> instead of <literal>callPackage</literal>.
-Import dependencies unqualified, i.e., <literal>qtbase</literal> not <literal>qt5.qtbase</literal>.
-<emphasis>Do not</emphasis> import a package set such as <literal>qt5</literal> or <literal>libsForQt5</literal>.
-</para>
+  <para>
+   If a library does not support a particular version of Qt 5, it is best to
+   mark it as broken by setting its <literal>meta.broken</literal> attribute. A
+   package may be marked broken for certain versions by testing the
+   <literal>qtbase.version</literal> attribute, which will always give the
+   current Qt 5 version.
+  </para>
+ </section>
 
-<para>
-Qt 5 maintains strict backward compatibility, so it is generally best to build an application package against the latest version using the <varname>libsForQt5</varname> library set.
-In case a package does not build with the latest Qt version, it is possible to pick a set pinned to a particular version, e.g. <varname>libsForQt55</varname> for Qt 5.5, if that is the latest version the package supports.
-If a package must be pinned to an older Qt version, be sure to file a bug upstream;
-because Qt is strictly backwards-compatible, any incompatibility is by definition a bug in the application.
-</para>
+ <section xml:id="ssec-qt-applications">
+  <title>Packaging Applications for Nixpkgs</title>
 
-<para>
-When testing applications in Nixpkgs, it is a common practice to build the package with <literal>nix-build</literal> and run it using the created symbolic link.
-This will not work with Qt applications, however, because they have many hard runtime requirements that can only be guaranteed if the package is actually installed.
-To test a Qt application, install it with <literal>nix-env</literal> or run it inside <literal>nix-shell</literal>.
-</para>
+  <para>
+   Call your application expression using
+   <literal>libsForQt5.callPackage</literal> instead of
+   <literal>callPackage</literal>. Import dependencies unqualified, i.e.,
+   <literal>qtbase</literal> not <literal>qt5.qtbase</literal>. <emphasis>Do
+   not</emphasis> import a package set such as <literal>qt5</literal> or
+   <literal>libsForQt5</literal>.
+  </para>
 
-</section>
+  <para>
+   Qt 5 maintains strict backward compatibility, so it is generally best to
+   build an application package against the latest version using the
+   <varname>libsForQt5</varname> library set. In case a package does not build
+   with the latest Qt version, it is possible to pick a set pinned to a
+   particular version, e.g. <varname>libsForQt55</varname> for Qt 5.5, if that
+   is the latest version the package supports. If a package must be pinned to
+   an older Qt version, be sure to file a bug upstream; because Qt is strictly
+   backwards-compatible, any incompatibility is by definition a bug in the
+   application.
+  </para>
 
+  <para>
+   When testing applications in Nixpkgs, it is a common practice to build the
+   package with <literal>nix-build</literal> and run it using the created
+   symbolic link. This will not work with Qt applications, however, because
+   they have many hard runtime requirements that can only be guaranteed if the
+   package is actually installed. To test a Qt application, install it with
+   <literal>nix-env</literal> or run it inside <literal>nix-shell</literal>.
+  </para>
+ </section>
 </section>
-
diff --git a/doc/languages-frameworks/ruby.xml b/doc/languages-frameworks/ruby.xml
index 6bb809192f8..c52a72a3df4 100644
--- a/doc/languages-frameworks/ruby.xml
+++ b/doc/languages-frameworks/ruby.xml
@@ -1,17 +1,19 @@
 <section xmlns="http://docbook.org/ns/docbook"
          xmlns:xlink="http://www.w3.org/1999/xlink"
          xml:id="sec-language-ruby">
+ <title>Ruby</title>
 
-<title>Ruby</title>
+ <para>
+  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.
+ </para>
 
-<para>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.
-</para>
-
-<para>For example, to package sensu, we did:</para>
+ <para>
+  For example, to package sensu, we did:
+ </para>
 
 <screen>
 <![CDATA[$ cd pkgs/servers/monitoring
@@ -42,17 +44,18 @@ bundlerEnv rec {
 }]]>
 </screen>
 
-<para>Please check in the <filename>Gemfile</filename>,
-<filename>Gemfile.lock</filename> and the
-<filename>gemset.nix</filename> so future updates can be run easily.
-</para>
+ <para>
+  Please check in the <filename>Gemfile</filename>,
+  <filename>Gemfile.lock</filename> and the <filename>gemset.nix</filename> so
+  future updates can be run easily.
+ </para>
 
-<para>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:
-</para>
+ <para>
+  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:
+ </para>
 
 <screen>
 <![CDATA[{ lib, bundlerApp }:
@@ -72,31 +75,31 @@ bundlerApp {
 }]]>
 </screen>
 
-<para>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.
-</para>
-
-<para>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:
-</para>
+ <para>
+  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.
+ </para>
+
+ <para>
+  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:
+ </para>
 
 <programlisting>
 <![CDATA[let env = bundlerEnv {
@@ -118,5 +121,4 @@ in stdenv.mkDerivation {
   '';
 }]]>
 </programlisting>
-
 </section>
diff --git a/doc/languages-frameworks/texlive.xml b/doc/languages-frameworks/texlive.xml
index 4515e17ec09..af0b07166e3 100644
--- a/doc/languages-frameworks/texlive.xml
+++ b/doc/languages-frameworks/texlive.xml
@@ -1,27 +1,42 @@
 <section xmlns="http://docbook.org/ns/docbook"
          xmlns:xlink="http://www.w3.org/1999/xlink"
          xml:id="sec-language-texlive">
+ <title>TeX Live</title>
 
-<title>TeX Live</title>
+ <para>
+  Since release 15.09 there is a new TeX Live packaging that lives entirely
+  under attribute <varname>texlive</varname>.
+ </para>
+
+ <section>
+  <title>User's guide</title>
 
-<para>Since release 15.09 there is a new TeX Live packaging that lives entirely under attribute <varname>texlive</varname>.</para>
-<section><title>User's guide</title>
   <itemizedlist>
-    <listitem><para>
-      For basic usage just pull <varname>texlive.combined.scheme-basic</varname> for an environment with basic LaTeX support.</para></listitem>
-    <listitem><para>
-      It typically won't work to use separately installed packages together.
-      Instead, you can build a custom set of packages like this:
-      <programlisting>
+   <listitem>
+    <para>
+     For basic usage just pull <varname>texlive.combined.scheme-basic</varname>
+     for an environment with basic LaTeX support.
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     It typically won't work to use separately installed packages together.
+     Instead, you can build a custom set of packages like this:
+<programlisting>
 texlive.combine {
   inherit (texlive) scheme-small collection-langkorean algorithms cm-super;
 }
       </programlisting>
-      There are all the schemes, collections and a few thousand packages, as defined upstream (perhaps with tiny differences).
-    </para></listitem>
-    <listitem><para>
-      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>.
-      <programlisting>
+     There are all the schemes, collections and a few thousand packages, as
+     defined upstream (perhaps with tiny differences).
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     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>.
+<programlisting>
 texlive.combine {
   # inherit (texlive) whatever-you-want;
   pkgFilter = pkg:
@@ -30,34 +45,55 @@ texlive.combine {
   # there are also other attributes: version, name
 }
       </programlisting>
-    </para></listitem>
-    <listitem><para>
-      You can list packages e.g. by <command>nix-repl</command>.
-      <programlisting>
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     You can list packages e.g. by <command>nix-repl</command>.
+<programlisting>
 $ nix-repl
 nix-repl> :l &lt;nixpkgs>
 nix-repl> texlive.collection-&lt;TAB>
       </programlisting>
-    </para></listitem>
-    <listitem><para>
-      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.
-    </para></listitem>
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     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.
+    </para>
+   </listitem>
   </itemizedlist>
-</section>
+ </section>
+
+ <section>
+  <title>Known problems</title>
 
-<section><title>Known problems</title>
   <itemizedlist>
-    <listitem><para>
-      Some tools are still missing, e.g. luajittex;</para></listitem>
-    <listitem><para>
-      some apps aren't packaged/tested yet (asymptote, biber, etc.);</para></listitem>
-    <listitem><para>
-      feature/bug: when a package is rejected by <varname>pkgFilter</varname>, its dependencies are still propagated;</para></listitem>
-    <listitem><para>
-      in case of any bugs or feature requests, file a github issue or better a pull request and /cc @vcunat.</para></listitem>
+   <listitem>
+    <para>
+     Some tools are still missing, e.g. luajittex;
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     some apps aren't packaged/tested yet (asymptote, biber, etc.);
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     feature/bug: when a package is rejected by <varname>pkgFilter</varname>,
+     its dependencies are still propagated;
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     in case of any bugs or feature requests, file a github issue or better a
+     pull request and /cc @vcunat.
+    </para>
+   </listitem>
   </itemizedlist>
+ </section>
 </section>
-
-
-</section>
-
diff --git a/doc/manual.xml b/doc/manual.xml
index 385079eb578..f31897aed03 100644
--- a/doc/manual.xml
+++ b/doc/manual.xml
@@ -1,29 +1,24 @@
 <book xmlns="http://docbook.org/ns/docbook"
       xmlns:xi="http://www.w3.org/2001/XInclude">
-
-  <info>
-
-    <title>Nixpkgs Contributors Guide</title>
-
-    <subtitle>Version <xi:include href=".version" parse="text" /></subtitle>
-
-  </info>
-
-  <xi:include href="introduction.chapter.xml" />
-  <xi:include href="quick-start.xml" />
-  <xi:include href="stdenv.xml" />
-  <xi:include href="multiple-output.xml" />
-  <xi:include href="cross-compilation.xml" />
-  <xi:include href="configuration.xml" />
-  <xi:include href="functions.xml" />
-  <xi:include href="meta.xml" />
-  <xi:include href="languages-frameworks/index.xml" />
-  <xi:include href="platform-notes.xml" />
-  <xi:include href="package-notes.xml" />
-  <xi:include href="overlays.xml" />
-  <xi:include href="coding-conventions.xml" />
-  <xi:include href="submitting-changes.xml" />
-  <xi:include href="reviewing-contributions.xml" />
-  <xi:include href="contributing.xml" />
-
+ <info>
+  <title>Nixpkgs Contributors Guide</title>
+  <subtitle>Version <xi:include href=".version" parse="text" />
+  </subtitle>
+ </info>
+ <xi:include href="introduction.chapter.xml" />
+ <xi:include href="quick-start.xml" />
+ <xi:include href="stdenv.xml" />
+ <xi:include href="multiple-output.xml" />
+ <xi:include href="cross-compilation.xml" />
+ <xi:include href="configuration.xml" />
+ <xi:include href="functions.xml" />
+ <xi:include href="meta.xml" />
+ <xi:include href="languages-frameworks/index.xml" />
+ <xi:include href="platform-notes.xml" />
+ <xi:include href="package-notes.xml" />
+ <xi:include href="overlays.xml" />
+ <xi:include href="coding-conventions.xml" />
+ <xi:include href="submitting-changes.xml" />
+ <xi:include href="reviewing-contributions.xml" />
+ <xi:include href="contributing.xml" />
 </book>
diff --git a/doc/meta.xml b/doc/meta.xml
index 5dbe810810d..ad16e7683f5 100644
--- a/doc/meta.xml
+++ b/doc/meta.xml
@@ -1,14 +1,12 @@
 <chapter xmlns="http://docbook.org/ns/docbook"
          xmlns:xlink="http://www.w3.org/1999/xlink"
          xml:id="chap-meta">
-
-<title>Meta-attributes</title>
-
-<para>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:
-
+ <title>Meta-attributes</title>
+ <para>
+  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:
 <programlisting>
 meta = {
   description = "A program that produces a familiar, friendly greeting";
@@ -22,16 +20,15 @@ meta = {
   platforms = stdenv.lib.platforms.all;
 };
 </programlisting>
-
-</para>
-
-<para>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.</para>
-
-<para>The meta-attributes of a package can be queried from the
-command-line using <command>nix-env</command>:
-
+ </para>
+ <para>
+  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.
+ </para>
+ <para>
+  The meta-attributes of a package can be queried from the command-line using
+  <command>nix-env</command>:
 <screen>
 $ nix-env -qa hello --json
 {
@@ -70,252 +67,299 @@ $ nix-env -qa hello --json
 
 
 </screen>
-
-<command>nix-env</command> knows about the
-<varname>description</varname> field specifically:
-
+  <command>nix-env</command> knows about the <varname>description</varname>
+  field specifically:
 <screen>
 $ nix-env -qa hello --description
 hello-2.3  A program that produces a familiar, friendly greeting
 </screen>
-
-</para>
-
-
-<section xml:id="sec-standard-meta-attributes"><title>Standard
-meta-attributes</title>
-
-<para>It is expected that each meta-attribute is one of the following:</para>
-
-<variablelist>
-
-  <varlistentry>
-    <term><varname>description</varname></term>
-    <listitem><para>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.</para>
-
-    <para>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.</para>
-
-    <para>Wrong: <literal>"libpng is a library that allows you to decode PNG images."</literal></para>
-
-    <para>Right: <literal>"A library for decoding PNG images"</literal></para>
-
+ </para>
+ <section xml:id="sec-standard-meta-attributes">
+  <title>Standard meta-attributes</title>
+
+  <para>
+   It is expected that each meta-attribute is one of the following:
+  </para>
+
+  <variablelist>
+   <varlistentry>
+    <term><varname>description</varname>
+    </term>
+    <listitem>
+     <para>
+      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.
+     </para>
+     <para>
+      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.
+     </para>
+     <para>
+      Wrong: <literal>"libpng is a library that allows you to decode PNG
+      images."</literal>
+     </para>
+     <para>
+      Right: <literal>"A library for decoding PNG images"</literal>
+     </para>
     </listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>longDescription</varname></term>
-    <listitem><para>An arbitrarily long description of the
-    package.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>branch</varname></term>
-    <listitem><para>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.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>homepage</varname></term>
-    <listitem><para>The package’s homepage.  Example:
-    <literal>http://www.gnu.org/software/hello/manual/</literal></para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>downloadPage</varname></term>
-    <listitem><para>The page where a link to the current version can be found.  Example:
-    <literal>http://ftp.gnu.org/gnu/hello/</literal></para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>license</varname></term>
+   </varlistentry>
+   <varlistentry>
+    <term><varname>longDescription</varname>
+    </term>
     <listitem>
-      <para>
-        The license, or licenses, for the package. One from the attribute set
-        defined in <link
+     <para>
+      An arbitrarily long description of the package.
+     </para>
+    </listitem>
+   </varlistentry>
+   <varlistentry>
+    <term><varname>branch</varname>
+    </term>
+    <listitem>
+     <para>
+      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.
+     </para>
+    </listitem>
+   </varlistentry>
+   <varlistentry>
+    <term><varname>homepage</varname>
+    </term>
+    <listitem>
+     <para>
+      The package’s homepage. Example:
+      <literal>http://www.gnu.org/software/hello/manual/</literal>
+     </para>
+    </listitem>
+   </varlistentry>
+   <varlistentry>
+    <term><varname>downloadPage</varname>
+    </term>
+    <listitem>
+     <para>
+      The page where a link to the current version can be found. Example:
+      <literal>http://ftp.gnu.org/gnu/hello/</literal>
+     </para>
+    </listitem>
+   </varlistentry>
+   <varlistentry>
+    <term><varname>license</varname>
+    </term>
+    <listitem>
+     <para>
+      The license, or licenses, for the package. One from the attribute set
+      defined in
+      <link
           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:
-        <itemizedlist>
-          <listitem><para>Single license referenced by attribute (preferred)
-              <literal>stdenv.lib.licenses.gpl3</literal>.
-          </para></listitem>
-          <listitem><para>Single license referenced by its attribute shortName (frowned upon)
-              <literal>"gpl3"</literal>.
-          </para></listitem>
-          <listitem><para>Single license referenced by its attribute spdxId (frowned upon)
-              <literal>"GPL-3.0"</literal>.
-          </para></listitem>
-          <listitem><para>Multiple licenses referenced by attribute (preferred)
-              <literal>with stdenv.lib.licenses; [ asl20 free ofl ]</literal>.
-          </para></listitem>
-          <listitem><para>Multiple licenses referenced as a space delimited string of attribute shortNames (frowned upon)
-              <literal>"asl20 free ofl"</literal>.
-          </para></listitem>
-        </itemizedlist>
-        For details, see <xref linkend='sec-meta-license'/>.
-      </para>
+      <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:
+      <itemizedlist>
+       <listitem>
+        <para>
+         Single license referenced by attribute (preferred)
+         <literal>stdenv.lib.licenses.gpl3</literal>.
+        </para>
+       </listitem>
+       <listitem>
+        <para>
+         Single license referenced by its attribute shortName (frowned upon)
+         <literal>"gpl3"</literal>.
+        </para>
+       </listitem>
+       <listitem>
+        <para>
+         Single license referenced by its attribute spdxId (frowned upon)
+         <literal>"GPL-3.0"</literal>.
+        </para>
+       </listitem>
+       <listitem>
+        <para>
+         Multiple licenses referenced by attribute (preferred) <literal>with
+         stdenv.lib.licenses; [ asl20 free ofl ]</literal>.
+        </para>
+       </listitem>
+       <listitem>
+        <para>
+         Multiple licenses referenced as a space delimited string of attribute
+         shortNames (frowned upon) <literal>"asl20 free ofl"</literal>.
+        </para>
+       </listitem>
+      </itemizedlist>
+      For details, see <xref linkend='sec-meta-license'/>.
+     </para>
     </listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>maintainers</varname></term>
-    <listitem><para>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
+   </varlistentry>
+   <varlistentry>
+    <term><varname>maintainers</varname>
+    </term>
+    <listitem>
+     <para>
+      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
     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>.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>priority</varname></term>
-    <listitem><para>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).</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>platforms</varname></term>
-    <listitem><para>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:
-
+      and write something like <literal>[ stdenv.lib.maintainers.alice
+      stdenv.lib.maintainers.bob ]</literal>.
+     </para>
+    </listitem>
+   </varlistentry>
+   <varlistentry>
+    <term><varname>priority</varname>
+    </term>
+    <listitem>
+     <para>
+      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).
+     </para>
+    </listitem>
+   </varlistentry>
+   <varlistentry>
+    <term><varname>platforms</varname>
+    </term>
+    <listitem>
+     <para>
+      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:
 <programlisting>
 meta.platforms = stdenv.lib.platforms.linux;
 </programlisting>
-
-    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.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>hydraPlatforms</varname></term>
-    <listitem><para>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.
-
+      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.
+     </para>
+    </listitem>
+   </varlistentry>
+   <varlistentry>
+    <term><varname>hydraPlatforms</varname>
+    </term>
+    <listitem>
+     <para>
+      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.
 <programlisting>
 meta.platforms = stdenv.lib.platforms.linux;
 meta.hydraPlatforms = [];
 </programlisting>
-
-    </para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>broken</varname></term>
-    <listitem><para>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.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>updateWalker</varname></term>
-    <listitem><para>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.</para></listitem>
-  </varlistentry>
-
-</variablelist>
-
-
-</section>
-
-
-<section xml:id="sec-meta-license"><title>Licenses</title>
-
-<para>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.</para>
-
-<para>Although it's typically better to indicate the specific license,
-a few generic options are available:
-
-<variablelist>
-
-  <varlistentry>
-    <term><varname>stdenv.lib.licenses.free</varname>,
-    <varname>"free"</varname></term>
-
-    <listitem><para>Catch-all for free software licenses not listed
-    above.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>stdenv.lib.licenses.unfreeRedistributable</varname>,
-    <varname>"unfree-redistributable"</varname></term>
-
-    <listitem><para>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.</para>
-
-    <para>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.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>stdenv.lib.licenses.unfree</varname>,
-    <varname>"unfree"</varname></term>
-
-    <listitem><para>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.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>stdenv.lib.licenses.unfreeRedistributableFirmware</varname>,
-    <varname>"unfree-redistributable-firmware"</varname></term>
-
-    <listitem><para>This package supplies unfree, redistributable
-    firmware.  This is a separate value from
-    <varname>unfree-redistributable</varname> because not everybody
-    cares whether firmware is free.</para></listitem>
-  </varlistentry>
-
-</variablelist>
-
-</para>
-
-
-</section>
-
-
+     </para>
+    </listitem>
+   </varlistentry>
+   <varlistentry>
+    <term><varname>broken</varname>
+    </term>
+    <listitem>
+     <para>
+      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.
+     </para>
+    </listitem>
+   </varlistentry>
+   <varlistentry>
+    <term><varname>updateWalker</varname>
+    </term>
+    <listitem>
+     <para>
+      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.
+     </para>
+    </listitem>
+   </varlistentry>
+  </variablelist>
+ </section>
+ <section xml:id="sec-meta-license">
+  <title>Licenses</title>
+
+  <para>
+   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.
+  </para>
+
+  <para>
+   Although it's typically better to indicate the specific license, a few
+   generic options are available:
+   <variablelist>
+    <varlistentry>
+     <term><varname>stdenv.lib.licenses.free</varname>,
+    <varname>"free"</varname>
+     </term>
+     <listitem>
+      <para>
+       Catch-all for free software licenses not listed above.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>stdenv.lib.licenses.unfreeRedistributable</varname>,
+    <varname>"unfree-redistributable"</varname>
+     </term>
+     <listitem>
+      <para>
+       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.
+      </para>
+      <para>
+       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.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>stdenv.lib.licenses.unfree</varname>,
+    <varname>"unfree"</varname>
+     </term>
+     <listitem>
+      <para>
+       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.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>stdenv.lib.licenses.unfreeRedistributableFirmware</varname>,
+    <varname>"unfree-redistributable-firmware"</varname>
+     </term>
+     <listitem>
+      <para>
+       This package supplies unfree, redistributable firmware. This is a
+       separate value from <varname>unfree-redistributable</varname> because
+       not everybody cares whether firmware is free.
+      </para>
+     </listitem>
+    </varlistentry>
+   </variablelist>
+  </para>
+ </section>
 </chapter>
diff --git a/doc/multiple-output.xml b/doc/multiple-output.xml
index 277d3d81413..040c12c9291 100644
--- a/doc/multiple-output.xml
+++ b/doc/multiple-output.xml
@@ -5,105 +5,319 @@
 <chapter xmlns="http://docbook.org/ns/docbook"
          xmlns:xlink="http://www.w3.org/1999/xlink"
          xml:id="chap-multiple-output">
+ <title>Multiple-output packages</title>
+ <section>
+  <title>Introduction</title>
 
-<title>Multiple-output packages</title>
+  <para>
+   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.
+  </para>
 
-<section><title>Introduction</title>
-  <para>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.</para>
-  <para>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.</para>
-  <note><para>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.</para></note>
-</section>
+  <para>
+   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.
+  </para>
+
+  <note>
+   <para>
+    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.
+   </para>
+  </note>
+ </section>
+ <section>
+  <title>Installing a split package</title>
+
+  <para>
+   When installing a package via <varname>systemPackages</varname> or
+   <command>nix-env</command> you have several options:
+  </para>
 
-<section><title>Installing a split package</title>
-  <para>When installing a package via <varname>systemPackages</varname> or <command>nix-env</command> you have several options:</para>
   <itemizedlist>
-    <listitem><para>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.</para></listitem>
-    <listitem><para>You can let it use the default outputs.  These are handled by <varname>meta.outputsToInstall</varname> attribute that contains a list of output names.</para>
-      <para>TODO: more about tweaking the attribute, etc.</para></listitem>
-    <listitem><para>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.</para>
-      <note><para>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.</para></note>
-    </listitem>
+   <listitem>
+    <para>
+     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.
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     You can let it use the default outputs. These are handled by
+     <varname>meta.outputsToInstall</varname> attribute that contains a list of
+     output names.
+    </para>
+    <para>
+     TODO: more about tweaking the attribute, etc.
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     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.
+    </para>
+    <note>
+     <para>
+      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.
+     </para>
+    </note>
+   </listitem>
   </itemizedlist>
-</section>
+ </section>
+ <section>
+  <title>Using a split package</title>
+
+  <para>
+   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.
+  </para>
+
+  <para>
+   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" />.)
+  </para>
+ </section>
+ <section>
+  <title>Writing a split derivation</title>
 
-<section><title>Using a split package</title>
-  <para>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.</para>
-  <para>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" />.)</para>
-</section>
+  <para>
+   Here you find how to write a derivation that produces multiple outputs.
+  </para>
 
+  <para>
+   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).
+  </para>
 
-<section><title>Writing a split derivation</title>
-  <para>Here you find how to write a derivation that produces multiple outputs.</para>
-  <para>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).</para>
-  <programlisting>outputs = [ "bin" "dev" "out" "doc" ];</programlisting>
-  <para>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.</para>
-  <note><para>There is a special handling of the <varname>debug</varname> output, described at <xref linkend="stdenv-separateDebugInfo" />.</para></note>
+<programlisting>outputs = [ "bin" "dev" "out" "doc" ];</programlisting>
+
+  <para>
+   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.
+  </para>
+
+  <note>
+   <para>
+    There is a special handling of the <varname>debug</varname> output,
+    described at <xref linkend="stdenv-separateDebugInfo" />.
+   </para>
+  </note>
 
   <section xml:id="multiple-output-file-binaries-first-convention">
-    <title><quote>Binaries first</quote></title>
-    <para>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.</para>
-    <para>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>).</para>
-    <para>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).</para>
+   <title><quote>Binaries first</quote></title>
+
+   <para>
+    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.
+   </para>
+
+   <para>
+    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>).
+   </para>
+
+   <para>
+    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).
+   </para>
   </section>
 
   <section xml:id="multiple-output-file-type-groups">
-    <title>File type groups</title>
-    <para>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.</para>
-    <variablelist>
-
-      <varlistentry><term><varname>
-         $outputDev</varname></term><listitem><para>
-         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.
-       </para></listitem>
-      </varlistentry>
-
-      <varlistentry><term><varname>
-        $outputBin</varname></term><listitem><para>
-        is meant for user-facing binaries, typically residing in bin/.  They go to <varname>bin</varname> or <varname>out</varname> by default.
-      </para></listitem></varlistentry>
-
-      <varlistentry><term><varname>
-        $outputLib</varname></term><listitem><para>
-        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.
-      </para></listitem></varlistentry>
-
-      <varlistentry><term><varname>
-        $outputDoc</varname></term><listitem><para>
-        is for user documentation, typically residing in <filename>share/doc/</filename>.  It goes to <varname>doc</varname> or <varname>out</varname> by default.
-      </para></listitem></varlistentry>
-
-      <varlistentry><term><varname>
-        $outputDevdoc</varname></term><listitem><para>
-        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.
-      </para></listitem></varlistentry>
-
-      <varlistentry><term><varname>
-        $outputMan</varname></term><listitem><para>
-        is for man pages (except for section 3). They go to <varname>man</varname> or <varname>$outputBin</varname> by default.
-      </para></listitem></varlistentry>
-
-      <varlistentry><term><varname>
-        $outputDevman</varname></term><listitem><para>
-        is for section 3 man pages. They go to <varname>devman</varname> or <varname>$outputMan</varname> by default.
-      </para></listitem></varlistentry>
-
-      <varlistentry><term><varname>
-        $outputInfo</varname></term><listitem><para>
-        is for info pages. They go to <varname>info</varname> or <varname>$outputBin</varname> by default.
-      </para></listitem></varlistentry>
-
-    </variablelist>
-  </section>
+   <title>File type groups</title>
 
-  <section><title>Common caveats</title>
-    <itemizedlist>
-      <listitem><para>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>.</para></listitem>
-      <listitem><para>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.)</para></listitem>
-      <listitem><para>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.</para></listitem>
-      <listitem><para>Some packages have hidden assumptions on install paths, which complicates splitting.</para></listitem>
-    </itemizedlist>
+   <para>
+    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.
+   </para>
+
+   <variablelist>
+    <varlistentry>
+     <term><varname>
+         $outputDev</varname>
+     </term>
+     <listitem>
+      <para>
+       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.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>
+        $outputBin</varname>
+     </term>
+     <listitem>
+      <para>
+       is meant for user-facing binaries, typically residing in bin/. They go
+       to <varname>bin</varname> or <varname>out</varname> by default.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>
+        $outputLib</varname>
+     </term>
+     <listitem>
+      <para>
+       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.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>
+        $outputDoc</varname>
+     </term>
+     <listitem>
+      <para>
+       is for user documentation, typically residing in
+       <filename>share/doc/</filename>. It goes to <varname>doc</varname> or
+       <varname>out</varname> by default.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>
+        $outputDevdoc</varname>
+     </term>
+     <listitem>
+      <para>
+       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.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>
+        $outputMan</varname>
+     </term>
+     <listitem>
+      <para>
+       is for man pages (except for section 3). They go to
+       <varname>man</varname> or <varname>$outputBin</varname> by default.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>
+        $outputDevman</varname>
+     </term>
+     <listitem>
+      <para>
+       is for section 3 man pages. They go to <varname>devman</varname> or
+       <varname>$outputMan</varname> by default.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>
+        $outputInfo</varname>
+     </term>
+     <listitem>
+      <para>
+       is for info pages. They go to <varname>info</varname> or
+       <varname>$outputBin</varname> by default.
+      </para>
+     </listitem>
+    </varlistentry>
+   </variablelist>
   </section>
 
-</section><!--Writing a split derivation-->
+  <section>
+   <title>Common caveats</title>
 
+   <itemizedlist>
+    <listitem>
+     <para>
+      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>.
+     </para>
+    </listitem>
+    <listitem>
+     <para>
+      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.)
+     </para>
+    </listitem>
+    <listitem>
+     <para>
+      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.
+     </para>
+    </listitem>
+    <listitem>
+     <para>
+      Some packages have hidden assumptions on install paths, which complicates
+      splitting.
+     </para>
+    </listitem>
+   </itemizedlist>
+  </section>
+ </section>
+<!--Writing a split derivation-->
 </chapter>
diff --git a/doc/overlays.xml b/doc/overlays.xml
index cc0aef447d2..2decf9febe8 100644
--- a/doc/overlays.xml
+++ b/doc/overlays.xml
@@ -1,95 +1,117 @@
 <chapter xmlns="http://docbook.org/ns/docbook"
          xmlns:xlink="http://www.w3.org/1999/xlink"
          xml:id="chap-overlays">
-
-<title>Overlays</title>
-
-<para>This chapter describes how to extend and change Nixpkgs packages using
-overlays. Overlays are used to add layers in the fix-point used by Nixpkgs
-to compose the set of all packages.</para>
-
-<para>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.</para>
-
+ <title>Overlays</title>
+ <para>
+  This chapter describes how to extend and change Nixpkgs packages using
+  overlays. Overlays are used to add layers in the fix-point used by Nixpkgs to
+  compose the set of all packages.
+ </para>
+ <para>
+  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.
+ </para>
 <!--============================================================-->
-
-<section xml:id="sec-overlays-install">
-<title>Installing overlays</title>
-
-<para>The list of overlays is determined as follows.</para>
-
-<para>If the <varname>overlays</varname> argument is not provided explicitly, we look for overlays in a path. The path
-is determined as follows:
-
-<orderedlist>
-
-  <listitem>
-    <para>First, if an <varname>overlays</varname> argument to the nixpkgs function itself is given,
-    then that is used.</para>
-
-    <para>This can be passed explicitly when importing nipxkgs, for example 
-    <literal>import &lt;nixpkgs> { overlays = [ overlay1 overlay2 ]; }</literal>.</para>
-  </listitem>
-
-  <listitem>
-    <para>Otherwise, if the Nix path entry <literal>&lt;nixpkgs-overlays></literal> exists, we look for overlays
-    at that path, as described below.</para>
-
-    <para>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></para>
-  </listitem>
-
-  <listitem>
-    <para>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.</para>
-  </listitem>
-
-</orderedlist>
-</para>
-
-<para>If we are looking for overlays at a path, then there are two cases:
-<itemizedlist>
-  <listitem>
-    <para>If the path is a file, then the file is imported as a Nix expression and used as the list of
-    overlays.</para>
-  </listitem>
-
-  <listitem>
-    <para>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:
-    <itemizedlist>
-      <listitem>
-        <para>Importing the file, if it is a <literal>.nix</literal> file.</para>
-      </listitem>
-      <listitem>
-        <para>Importing a top-level <filename>default.nix</filename> file, if it is a directory.</para>
-      </listitem>
-    </itemizedlist>
-    </para>
-  </listitem>
-</itemizedlist>
-</para>
-
-<para>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 looked up independently.</para>
-
-<para>The <filename>overlays.nix</filename> option therefore 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>.</para>
-
-</section>
-
+ <section xml:id="sec-overlays-install">
+  <title>Installing overlays</title>
+
+  <para>
+   The list of overlays is determined as follows.
+  </para>
+
+  <para>
+   If the <varname>overlays</varname> argument is not provided explicitly, we
+   look for overlays in a path. The path is determined as follows:
+   <orderedlist>
+    <listitem>
+     <para>
+      First, if an <varname>overlays</varname> argument to the nixpkgs function
+      itself is given, then that is used.
+     </para>
+     <para>
+      This can be passed explicitly when importing nipxkgs, for example
+      <literal>import &lt;nixpkgs> { overlays = [ overlay1 overlay2 ];
+      }</literal>.
+     </para>
+    </listitem>
+    <listitem>
+     <para>
+      Otherwise, if the Nix path entry <literal>&lt;nixpkgs-overlays></literal>
+      exists, we look for overlays at that path, as described below.
+     </para>
+     <para>
+      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>
+     </para>
+    </listitem>
+    <listitem>
+     <para>
+      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.
+     </para>
+    </listitem>
+   </orderedlist>
+  </para>
+
+  <para>
+   If we are looking for overlays at a path, then there are two cases:
+   <itemizedlist>
+    <listitem>
+     <para>
+      If the path is a file, then the file is imported as a Nix expression and
+      used as the list of overlays.
+     </para>
+    </listitem>
+    <listitem>
+     <para>
+      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:
+      <itemizedlist>
+       <listitem>
+        <para>
+         Importing the file, if it is a <literal>.nix</literal> file.
+        </para>
+       </listitem>
+       <listitem>
+        <para>
+         Importing a top-level <filename>default.nix</filename> file, if it is
+         a directory.
+        </para>
+       </listitem>
+      </itemizedlist>
+     </para>
+    </listitem>
+   </itemizedlist>
+  </para>
+
+  <para>
+   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 looked up independently.
+  </para>
+
+  <para>
+   The <filename>overlays.nix</filename> option therefore 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>.
+  </para>
+ </section>
 <!--============================================================-->
+ <section xml:id="sec-overlays-definition">
+  <title>Defining overlays</title>
 
-<section xml:id="sec-overlays-definition">
-<title>Defining overlays</title>
-
-<para>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.</para>
+  <para>
+   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.
+  </para>
 
 <programlisting>
 self: super:
@@ -104,31 +126,39 @@ self: super:
 }
 </programlisting>
 
-<para>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.</para>
-
-<para>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.</para>
-
-<para>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.</para>
-
-<para>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.</para>
-
-</section>
-
+  <para>
+   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.
+  </para>
+
+  <para>
+   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.
+  </para>
+
+  <para>
+   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.
+  </para>
+
+  <para>
+   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.
+  </para>
+ </section>
 </chapter>
diff --git a/doc/package-notes.xml b/doc/package-notes.xml
index 1fccfd5d329..f16826ae680 100644
--- a/doc/package-notes.xml
+++ b/doc/package-notes.xml
@@ -1,206 +1,185 @@
 <chapter xmlns="http://docbook.org/ns/docbook"
          xmlns:xlink="http://www.w3.org/1999/xlink"
          xml:id="chap-package-notes">
-
-<title>Package Notes</title>
-
-<para>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.</para>
-
-
+ <title>Package Notes</title>
+ <para>
+  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.
+ </para>
 <!--============================================================-->
+ <section xml:id="sec-linux-kernel">
+  <title>Linux kernel</title>
 
-<section xml:id="sec-linux-kernel">
-
-<title>Linux kernel</title>
-
-<para>The Nix expressions to build the Linux kernel are in <link
-xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/os-specific/linux/kernel"><filename>pkgs/os-specific/linux/kernel</filename></link>.</para>
-
-<para>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>).</para>
+  <para>
+   The Nix expressions to build the Linux kernel are in
+   <link
+xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/os-specific/linux/kernel"><filename>pkgs/os-specific/linux/kernel</filename></link>.
+  </para>
 
-<para>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:
+  <para>
+   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>).
+  </para>
 
+  <para>
+   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:
 <programlisting>
 modulesTree = [kernel]
   ++ pkgs.lib.optional (!kernel.features ? iwlwifi) kernelPackages.iwlwifi
   ++ ...;
 </programlisting>
+  </para>
 
-</para>
-
-<para>How to add a new (major) version of the Linux kernel to Nixpkgs:
-
-<orderedlist>
-
-  <listitem>
-    <para>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.</para>
-  </listitem>
-
-  <listitem>
-    <para>Add the new kernel to <filename>all-packages.nix</filename>
-    (e.g., create an attribute
-    <varname>kernel_2_6_22</varname>).</para>
-  </listitem>
-
-  <listitem>
-    <para>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:
-
+  <para>
+   How to add a new (major) version of the Linux kernel to Nixpkgs:
+   <orderedlist>
+    <listitem>
+     <para>
+      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.
+     </para>
+    </listitem>
+    <listitem>
+     <para>
+      Add the new kernel to <filename>all-packages.nix</filename> (e.g., create
+      an attribute <varname>kernel_2_6_22</varname>).
+     </para>
+    </listitem>
+    <listitem>
+     <para>
+      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:
       <orderedlist>
-
-        <listitem>
-          <para>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>).</para>
-        </listitem>
-
-        <listitem>
-          <para>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.
-          </para>
-        </listitem>
-
-        <listitem>
-          <para>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>).
-          </para>
-        </listitem>
-
-        <listitem>
-          <para>If needed you can also run <literal>make
-          menuconfig</literal>:
-
-            <screen>
+       <listitem>
+        <para>
+         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>).
+        </para>
+       </listitem>
+       <listitem>
+        <para>
+         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.
+        </para>
+       </listitem>
+       <listitem>
+        <para>
+         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>).
+        </para>
+       </listitem>
+       <listitem>
+        <para>
+         If needed you can also run <literal>make menuconfig</literal>:
+<screen>
 $ nix-env -i ncurses
 $ export NIX_CFLAGS_LINK=-lncurses
 $ make menuconfig ARCH=<replaceable>arch</replaceable></screen>
-
-          </para>
-        </listitem>
-
-        <listitem>
-          <para>Copy <filename>.config</filename> over the new config
-          file (e.g. <filename>config-2.6.22-i686-smp</filename>).</para>
-        </listitem>
-
+        </para>
+       </listitem>
+       <listitem>
+        <para>
+         Copy <filename>.config</filename> over the new config file (e.g.
+         <filename>config-2.6.22-i686-smp</filename>).
+        </para>
+       </listitem>
       </orderedlist>
-
-    </para>
-
-  </listitem>
-
-  <listitem>
-    <para>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.</para>
-  </listitem>
-
-  <listitem>
-    <para>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.</para>
-  </listitem>
-
-</orderedlist>
-
-</para>
-
-</section>
-
-
+     </para>
+    </listitem>
+    <listitem>
+     <para>
+      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.
+     </para>
+    </listitem>
+    <listitem>
+     <para>
+      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.
+     </para>
+    </listitem>
+   </orderedlist>
+  </para>
+ </section>
 <!--============================================================-->
+ <section xml:id="sec-xorg">
+  <title>X.org</title>
 
-<section xml:id="sec-xorg">
-
-<title>X.org</title>
-
-<para>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.</para>
-
-<para>The generator is invoked as follows:
+  <para>
+   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.
+  </para>
 
+  <para>
+   The generator is invoked as follows:
 <screen>
 $ cd pkgs/servers/x11/xorg
 $ cat tarballs-7.5.list extra.list old.list \
   | perl ./generate-expr-from-tarballs.pl
 </screen>
+   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.)
+  </para>
 
-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.)</para>
-
-<para>A file like <filename>tarballs-7.5.list</filename> contains all
-tarballs in a X.org release.  It can be generated like this:
-
+  <para>
+   A file like <filename>tarballs-7.5.list</filename> contains all tarballs in
+   a X.org release. It can be generated like this:
 <screen>
 $ export i="mirror://xorg/X11R7.4/src/everything/"
 $ cat $(PRINT_PATH=1 nix-prefetch-url $i | tail -n 1) \
   | perl -e 'while (&lt;>) { if (/(href|HREF)="([^"]*.bz2)"/) { print "$ENV{'i'}$2\n"; }; }' \
   | sort > tarballs-7.4.list
 </screen>
+   <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>).
+  </para>
 
-<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>).</para>
-
-<para>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>.</para>
-
-</section>
-
-
-
+  <para>
+   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>.
+  </para>
+ </section>
 <!--============================================================-->
-
 <!--
 <section>
   <title>Gnome</title>
@@ -208,65 +187,53 @@ you should modify
   <para>* How to update</para>
 </section>
 -->
-
-
 <!--============================================================-->
-
 <!--
 <section>
   <title>GCC</title>
   <para>…</para>
 </section>
 -->
-
 <!--============================================================-->
-
-<section xml:id="sec-eclipse">
-
+ <section xml:id="sec-eclipse">
   <title>Eclipse</title>
 
   <para>
-    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>.
+   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>.
   </para>
 
   <para>
-    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:
-
+   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:
 <screen>
 $ nix-env -f '&lt;nixpkgs&gt;' -qaP -A eclipses --description
 </screen>
-
-    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.
+   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.
   </para>
 
   <para>
-    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
-
+   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
 <screen>
 packageOverrides = pkgs: {
   myEclipse = with pkgs.eclipses; eclipseWithPlugins {
@@ -276,42 +243,38 @@ packageOverrides = pkgs: {
   };
 }
 </screen>
-
-    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
-
+   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
 <screen>
 $ nix-env -f '&lt;nixpkgs&gt;' -qaP -A eclipses.plugins --description
 </screen>
   </para>
 
   <para>
-    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.
+   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.
   </para>
 
   <para>
-    Expanding the previous example with two plugins using the above
-    functions we have
+   Expanding the previous example with two plugins using the above functions we
+   have
 <screen>
 packageOverrides = pkgs: {
   myEclipse = with pkgs.eclipses; eclipseWithPlugins {
@@ -343,210 +306,214 @@ packageOverrides = pkgs: {
 }
 </screen>
   </para>
+ </section>
+ <section xml:id="sec-elm">
+  <title>Elm</title>
 
-</section>
-
-<section xml:id="sec-elm">
-
-<title>Elm</title>
-
-<para>
-The Nix expressions for Elm reside in
-<filename>pkgs/development/compilers/elm</filename>. They are generated
-automatically by <command>update-elm.rb</command> script. One should
-specify versions of Elm packages inside the script, clear the
-<filename>packages</filename> directory and run the script from inside it.
-<literal>elm-reactor</literal> is special because it also has Elm package
-dependencies. The process is not automated very much for now -- you should
-get the <literal>elm-reactor</literal> source tree (e.g. with
-<command>nix-shell</command>) and run <command>elm2nix.rb</command> inside
-it. Place the resulting <filename>package.nix</filename> file into
-<filename>packages/elm-reactor-elm.nix</filename>.
-</para>
-
-</section>
-
-<section xml:id="sec-shell-helpers">
-
-<title>Interactive shell helpers</title>
-
-<para>
-  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:
+  <para>
+   The Nix expressions for Elm reside in
+   <filename>pkgs/development/compilers/elm</filename>. They are generated
+   automatically by <command>update-elm.rb</command> script. One should specify
+   versions of Elm packages inside the script, clear the
+   <filename>packages</filename> directory and run the script from inside it.
+   <literal>elm-reactor</literal> is special because it also has Elm package
+   dependencies. The process is not automated very much for now -- you should
+   get the <literal>elm-reactor</literal> source tree (e.g. with
+   <command>nix-shell</command>) and run <command>elm2nix.rb</command> inside
+   it. Place the resulting <filename>package.nix</filename> file into
+   <filename>packages/elm-reactor-elm.nix</filename>.
+  </para>
+ </section>
+ <section xml:id="sec-shell-helpers">
+  <title>Interactive shell helpers</title>
 
-  <itemizedlist>
+  <para>
+   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:
+   <itemizedlist>
     <listitem>
-      <para>
-        <literal>autojump</literal>: <command>autojump-share</command>
-      </para>
+     <para>
+      <literal>autojump</literal>: <command>autojump-share</command>
+     </para>
     </listitem>
     <listitem>
-      <para>
-        <literal>fzf</literal>: <command>fzf-share</command>
-      </para>
+     <para>
+      <literal>fzf</literal>: <command>fzf-share</command>
+     </para>
     </listitem>
-  </itemizedlist>
-
-  E.g. <literal>autojump</literal> can then used in the .bashrc like this:
+   </itemizedlist>
+   E.g. <literal>autojump</literal> can then used in the .bashrc like this:
 <screen>
   source "$(autojump-share)/autojump.bash"
 </screen>
-</para>
-
-</section>
-
-<section xml:id="sec-steam">
-
-<title>Steam</title>
-
-<section xml:id="sec-steam-nix">
-
-<title>Steam in Nix</title>
-
-<para>
-  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.
-</para>
-<para>
-  Nix problems and constraints:
-<itemizedlist>
-  <listitem><para>We don't have <filename>/bin/bash</filename> and many
-  scripts point there. Similarly for <filename>/usr/bin/python</filename>
-  .</para></listitem>
-  <listitem><para>We don't have the dynamic loader in <filename>/lib
-  </filename>.</para></listitem>
-  <listitem><para>The <filename>steam.sh</filename> script in $HOME can
-  not be patched, as it is checked and rewritten by steam.</para></listitem>
-  <listitem><para>The steam binary cannot be patched, it's also checked.</para></listitem>
-</itemizedlist>
-</para>
-<para>
-  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.
-</para>
-
-</section>
-
-<section xml:id="sec-steam-play">
-
-<title>How to play</title>
-
-<para>
-  For 64-bit systems it's important to have
-  <programlisting>hardware.opengl.driSupport32Bit = true;</programlisting>
-  in your <filename>/etc/nixos/configuration.nix</filename>. You'll also need
-  <programlisting>hardware.pulseaudio.support32Bit = true;</programlisting>
-  if you are using PulseAudio - this will enable 32bit ALSA apps integration.
-  To use the Steam controller, you need to add
-  <programlisting>services.udev.extraRules = ''
+  </para>
+ </section>
+ <section xml:id="sec-steam">
+  <title>Steam</title>
+
+  <section xml:id="sec-steam-nix">
+   <title>Steam in Nix</title>
+
+   <para>
+    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.
+   </para>
+
+   <para>
+    Nix problems and constraints:
+    <itemizedlist>
+     <listitem>
+      <para>
+       We don't have <filename>/bin/bash</filename> and many scripts point
+       there. Similarly for <filename>/usr/bin/python</filename> .
+      </para>
+     </listitem>
+     <listitem>
+      <para>
+       We don't have the dynamic loader in <filename>/lib </filename>.
+      </para>
+     </listitem>
+     <listitem>
+      <para>
+       The <filename>steam.sh</filename> script in $HOME can not be patched, as
+       it is checked and rewritten by steam.
+      </para>
+     </listitem>
+     <listitem>
+      <para>
+       The steam binary cannot be patched, it's also checked.
+      </para>
+     </listitem>
+    </itemizedlist>
+   </para>
+
+   <para>
+    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.
+   </para>
+  </section>
+
+  <section xml:id="sec-steam-play">
+   <title>How to play</title>
+
+   <para>
+    For 64-bit systems it's important to have
+<programlisting>hardware.opengl.driSupport32Bit = true;</programlisting>
+    in your <filename>/etc/nixos/configuration.nix</filename>. You'll also need
+<programlisting>hardware.pulseaudio.support32Bit = true;</programlisting>
+    if you are using PulseAudio - this will enable 32bit ALSA apps integration.
+    To use the Steam controller, you need to add
+<programlisting>services.udev.extraRules = ''
     SUBSYSTEM=="usb", ATTRS{idVendor}=="28de", MODE="0666"
     KERNEL=="uinput", MODE="0660", GROUP="users", OPTIONS+="static_node=uinput"
   '';</programlisting>
-  to your configuration.
-</para>
-
-</section>
-
-<section xml:id="sec-steam-troub">
-
-<title>Troubleshooting</title>
-
-<para>
-<variablelist>
-
-  <varlistentry>
-    <term>Steam fails to start. What do I do?</term>
-    <listitem><para>Try to run
-    <programlisting>strace steam</programlisting>
-    to see what is causing steam to fail.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-  <term>Using the FOSS Radeon or nouveau (nvidia) drivers</term>
-  <listitem><itemizedlist>
-    <listitem><para>The <literal>newStdcpp</literal> parameter
-    was removed since NixOS 17.09 and should not be needed anymore.
-    </para></listitem>
-
-    <listitem><para>
-    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
-    <programlisting>steam.sh: line 713: 7842 Segmentation fault (core dumped)</programlisting>
-    have a look at <link xlink:href="https://github.com/NixOS/nixpkgs/pull/20269">this pull request</link>.
-    </para></listitem>
-
-  </itemizedlist></listitem></varlistentry>
-
-  <varlistentry>
-  <term>Java</term>
-  <listitem><orderedlist>
-  <listitem><para>
-  There is no java in steam chrootenv by default. If you get a message like
-  <programlisting>/home/foo/.local/share/Steam/SteamApps/common/towns/towns.sh: line 1: java: command not found</programlisting>
-  You need to add
-  <programlisting> steam.override { withJava = true; };</programlisting>
-  to your configuration.
-  </para></listitem>
-  </orderedlist></listitem></varlistentry>
-
-</variablelist>
-</para>
-
-</section>
-
-<section xml:id="sec-steam-run">
-
-<title>steam-run</title>
-<para>
-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
+    to your configuration.
+   </para>
+  </section>
+
+  <section xml:id="sec-steam-troub">
+   <title>Troubleshooting</title>
+
+   <para>
+    <variablelist>
+     <varlistentry>
+      <term>Steam fails to start. What do I do?</term>
+      <listitem>
+       <para>
+        Try to run
+<programlisting>strace steam</programlisting>
+        to see what is causing steam to fail.
+       </para>
+      </listitem>
+     </varlistentry>
+     <varlistentry>
+      <term>Using the FOSS Radeon or nouveau (nvidia) drivers</term>
+      <listitem>
+       <itemizedlist>
+        <listitem>
+         <para>
+          The <literal>newStdcpp</literal> parameter was removed since NixOS
+          17.09 and should not be needed anymore.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          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
+<programlisting>steam.sh: line 713: 7842 Segmentation fault (core dumped)</programlisting>
+          have a look at
+          <link xlink:href="https://github.com/NixOS/nixpkgs/pull/20269">this
+          pull request</link>.
+         </para>
+        </listitem>
+       </itemizedlist>
+      </listitem>
+     </varlistentry>
+     <varlistentry>
+      <term>Java</term>
+      <listitem>
+       <orderedlist>
+        <listitem>
+         <para>
+          There is no java in steam chrootenv by default. If you get a message
+          like
+<programlisting>/home/foo/.local/share/Steam/SteamApps/common/towns/towns.sh: line 1: java: command not found</programlisting>
+          You need to add
+<programlisting> steam.override { withJava = true; };</programlisting>
+          to your configuration.
+         </para>
+        </listitem>
+       </orderedlist>
+      </listitem>
+     </varlistentry>
+    </variablelist>
+   </para>
+  </section>
+
+  <section xml:id="sec-steam-run">
+   <title>steam-run</title>
+
+   <para>
+    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
 <programlisting>pkgs.(steam.override {
           nativeOnly = true;
           newStdcpp = true;
         }).run</programlisting>
-to your configuration, rebuild, and run the game with
+    to your configuration, rebuild, and run the game with
 <programlisting>steam-run ./foo</programlisting>
-</para>
-
-</section>
-
-</section>
-
-<section xml:id="sec-emacs">
-
-<title>Emacs</title>
-
-<section xml:id="sec-emacs-config">
-
-<title>Configuring Emacs</title>
-
-<para>
-  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:
-</para>
+   </para>
+  </section>
+ </section>
+ <section xml:id="sec-emacs">
+  <title>Emacs</title>
+
+  <section xml:id="sec-emacs-config">
+   <title>Configuring Emacs</title>
+
+   <para>
+    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:
+   </para>
 
 <screen>
 {
@@ -564,17 +531,17 @@ to your configuration, rebuild, and run the game with
 }
 </screen>
 
-<para>
-  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.
-</para>
+   <para>
+    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.
+   </para>
 
 <screen>
 {
@@ -654,25 +621,24 @@ cp ${myEmacsConfig} $out/share/emacs/site-lisp/default.el
 }
 </screen>
 
-<para>
-  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.
-</para>
-
-<para>
-  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>.
-</para>
+   <para>
+    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.
+   </para>
+
+   <para>
+    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>.
+   </para>
 
 <screen>
 overrides = super: self: rec {
@@ -685,34 +651,34 @@ overrides = super: self: rec {
   dante
 ])
 </screen>
+  </section>
+ </section>
+ <section xml:id="sec-weechat">
+  <title>Weechat</title>
 
-</section>
-
-</section>
-
-<section xml:id="sec-weechat">
-<title>Weechat</title>
-<para>
-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
+  <para>
+   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
 <programlisting>weechat.override {configure = {availablePlugins, ...}: {
     plugins = with availablePlugins; [ python perl ];
   }
 }</programlisting>
-</para>
-<para>
-The plugins currently available are <literal>python</literal>,
-<literal>perl</literal>, <literal>ruby</literal>, <literal>guile</literal>,
-<literal>tcl</literal> and <literal>lua</literal>.
-</para>
-<para>
-The python plugin 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 <literal>python</literal>
-plugin's <literal>withPackages</literal> attribute:
+  </para>
+
+  <para>
+   The plugins currently available are <literal>python</literal>,
+   <literal>perl</literal>, <literal>ruby</literal>, <literal>guile</literal>,
+   <literal>tcl</literal> and <literal>lua</literal>.
+  </para>
+
+  <para>
+   The python plugin 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 <literal>python</literal> plugin's
+   <literal>withPackages</literal> attribute:
 <programlisting>weechat.override { configure = {availablePlugins, ...}: {
     plugins = with availablePlugins; [
             (python.withPackages (ps: with ps; [ pycrypto python-dbus ]))
@@ -720,16 +686,17 @@ plugin's <literal>withPackages</literal> attribute:
     }
 }
 </programlisting>
-</para>
-<para>
-In order to also keep all default plugins installed, it is possible to use
-the following method:
+  </para>
+
+  <para>
+   In order to also keep all default plugins installed, it is possible to use
+   the following method:
 <programlisting>weechat.override { configure = { availablePlugins, ... }: {
   plugins = builtins.attrValues (availablePlugins // {
     python = availablePlugins.python.withPackages (ps: with ps; [ pycrypto python-dbus ]);
   });
 }; }
 </programlisting>
-</para>
-</section>
+  </para>
+ </section>
 </chapter>
diff --git a/doc/platform-notes.xml b/doc/platform-notes.xml
index f4f6ec60029..b2c20c2d35c 100644
--- a/doc/platform-notes.xml
+++ b/doc/platform-notes.xml
@@ -1,27 +1,25 @@
 <chapter xmlns="http://docbook.org/ns/docbook"
          xmlns:xlink="http://www.w3.org/1999/xlink"
          xml:id="chap-platform-nodes">
+ <title>Platform Notes</title>
+ <section xml:id="sec-darwin">
+  <title>Darwin (macOS)</title>
 
-<title>Platform Notes</title>
+  <para>
+   Some common issues when packaging software for darwin:
+  </para>
 
-<section xml:id="sec-darwin">
-
-<title>Darwin (macOS)</title>
-<para>Some common issues when packaging software for darwin:</para>
-
-<itemizedlist>
-
-  <listitem>
+  <itemizedlist>
+   <listitem>
     <para>
-      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.
+     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.
     </para>
-
-    <programlisting>
+<programlisting>
       stdenv.mkDerivation {
         name = "libfoo-1.2.3";
         # ...
@@ -30,36 +28,33 @@
         '';
       }
     </programlisting>
-  </listitem>
-
-  <listitem>
+   </listitem>
+   <listitem>
     <para>
-      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>.
+     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>.
     </para>
-
-    <programlisting>
+<programlisting>
       stdenv.mkDerivation {
         name = "libfoo-1.2.3";
         # ...
         makeFlags = stdenv.lib.optional stdenv.isDarwin "LDFLAGS=-Wl,-install_name,$(out)/lib/libfoo.dylib";
       }
     </programlisting>
-  </listitem>
-
-  <listitem>
+   </listitem>
+   <listitem>
     <para>
-      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.
+     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.
     </para>
-
-    <programlisting>
+<programlisting>
       stdenv.mkDerivation {
         name = "libfoo-1.2.3";
         # ...
@@ -69,15 +64,12 @@
         '';
       }
     </programlisting>
-
     <para>
-      The package <literal>xcbuild</literal> can be used to build projects
-      that really depend on Xcode, however projects that build some kind of
-      graphical interface won't work without using Xcode in an impure way.
+     The package <literal>xcbuild</literal> can be used to build projects that
+     really depend on Xcode, however projects that build some kind of graphical
+     interface won't work without using Xcode in an impure way.
     </para>
-  </listitem>
-
-</itemizedlist>
-</section>
-
+   </listitem>
+  </itemizedlist>
+ </section>
 </chapter>
diff --git a/doc/quick-start.xml b/doc/quick-start.xml
index ca86e6c9519..0cba3a4769c 100644
--- a/doc/quick-start.xml
+++ b/doc/quick-start.xml
@@ -1,223 +1,219 @@
 <chapter xmlns="http://docbook.org/ns/docbook"
          xmlns:xlink="http://www.w3.org/1999/xlink"
          xml:id="chap-quick-start">
-
-<title>Quick Start to Adding a Package</title>
-
-<para>To add a package to Nixpkgs:
-
-<orderedlist>
-
-  <listitem>
-    <para>Checkout the Nixpkgs source tree:
-
+ <title>Quick Start to Adding a Package</title>
+ <para>
+  To add a package to Nixpkgs:
+  <orderedlist>
+   <listitem>
+    <para>
+     Checkout the Nixpkgs source tree:
 <screen>
 $ git clone git://github.com/NixOS/nixpkgs.git 
 $ cd nixpkgs</screen>
-
     </para>
-  </listitem>
-
-  <listitem>
-    <para>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.
-
+   </listitem>
+   <listitem>
+    <para>
+     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.
 <screen>
 $ mkdir pkgs/development/libraries/libfoo</screen>
-  
     </para>
-  </listitem>
-
-  <listitem>
-    <para>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>.
-
+   </listitem>
+   <listitem>
+    <para>
+     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>.
 <screen>
 $ emacs pkgs/development/libraries/libfoo/default.nix
 $ git add pkgs/development/libraries/libfoo/default.nix</screen>
-
     </para>
-
-    <para>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:
-
-      <itemizedlist>
-
-        <listitem>
-          <para>GNU Hello: <link
+    <para>
+     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:
+     <itemizedlist>
+      <listitem>
+       <para>
+        GNU Hello:
+        <link
           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.</para>
-        </listitem>
-
-        <listitem>
-          <para>GNU cpio: <link
+        Trivial package, which specifies some <varname>meta</varname>
+        attributes which is good practice.
+       </para>
+      </listitem>
+      <listitem>
+       <para>
+        GNU cpio:
+        <link
           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>.</para>
-        </listitem>
-
-        <listitem>
-          <para>GNU Multiple Precision arithmetic library (GMP): <link
+        Also a simple package. The generic builder in <varname>stdenv</varname>
+        does everything for you. It has no dependencies beyond
+        <varname>stdenv</varname>.
+       </para>
+      </listitem>
+      <listitem>
+       <para>
+        GNU Multiple Precision arithmetic library (GMP):
+        <link
           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>.</para>
-        </listitem>
-
-        <listitem>
-          <para>Pan, a GTK-based newsreader: <link
+        Also done by the generic builder, but has a dependency on
+        <varname>m4</varname>.
+       </para>
+      </listitem>
+      <listitem>
+       <para>
+        Pan, a GTK-based newsreader:
+        <link
           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>.</para>
-        </listitem>
-
-        <listitem>
-          <para>Apache HTTPD: <link
+        Has an optional dependency on <varname>gtkspell</varname>, which is
+        only built if <varname>spellCheck</varname> is <literal>true</literal>.
+       </para>
+      </listitem>
+      <listitem>
+       <para>
+        Apache HTTPD:
+        <link
           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.</para>
-        </listitem>
-
-        <listitem>
-          <para>Thunderbird: <link
+        A bunch of optional features, variable substitutions in the configure
+        flags, a post-install hook, and miscellaneous hackery.
+       </para>
+      </listitem>
+      <listitem>
+       <para>
+        Thunderbird:
+        <link
           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.</para>
-        </listitem>
-
-        <listitem>
-          <para>JDiskReport, a Java utility: <link
+        Lots of dependencies.
+       </para>
+      </listitem>
+      <listitem>
+       <para>
+        JDiskReport, a Java utility:
+        <link
           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
+        (and the
+        <link
           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.</para>
-        </listitem>
-
-        <listitem>
-          <para>XML::Simple, a Perl module: <link
+        Nixpkgs doesn’t have a decent <varname>stdenv</varname> for Java yet
+        so this is pretty ad-hoc.
+       </para>
+      </listitem>
+      <listitem>
+       <para>
+        XML::Simple, a Perl module:
+        <link
           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.</para>
-        </listitem>
-
-        <listitem>
-          <para>Adobe Reader: <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.
+       </para>
+      </listitem>
+      <listitem>
+       <para>
+        Adobe Reader:
+        <link
           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
+        Shows how binary-only packages can be supported. In particular the
+        <link
           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.</para>
-        </listitem>
-
-      </itemizedlist>
-
+        uses <command>patchelf</command> to set the RUNPATH and ELF interpreter
+        of the executables so that the right libraries are found at runtime.
+       </para>
+      </listitem>
+     </itemizedlist>
     </para>
-
-    <para>Some notes:
-
-      <itemizedlist>
-
-        <listitem>
-          <para>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
-          linkend="sec-meta-license">license</varname>.</para>
-        </listitem>
-
-        <listitem>
-          <para>You can use <command>nix-prefetch-url</command> (or similar nix-prefetch-git, etc)
-          <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.</para>
-        </listitem>
-
-        <listitem>
-          <para>A list of schemes for <literal>mirror://</literal>
-          URLs can be found in <link
-          xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/fetchurl/mirrors.nix"><filename>pkgs/build-support/fetchurl/mirrors.nix</filename></link>.</para>
-        </listitem>
-
-      </itemizedlist>
-
+    <para>
+     Some notes:
+     <itemizedlist>
+      <listitem>
+       <para>
+        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
+          linkend="sec-meta-license">license</varname>.
+       </para>
+      </listitem>
+      <listitem>
+       <para>
+        You can use <command>nix-prefetch-url</command> (or similar
+        nix-prefetch-git, etc) <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.
+       </para>
+      </listitem>
+      <listitem>
+       <para>
+        A list of schemes for <literal>mirror://</literal> URLs can be found in
+        <link
+          xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/fetchurl/mirrors.nix"><filename>pkgs/build-support/fetchurl/mirrors.nix</filename></link>.
+       </para>
+      </listitem>
+     </itemizedlist>
     </para>
-
-    <para>The exact syntax and semantics of the Nix expression
-    language, including the built-in function, are described in the
-    Nix manual in the <link
+    <para>
+     The exact syntax and semantics of the Nix expression language, including
+     the built-in function, are described in the Nix manual in the
+     <link
     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>.</para>
-    
-  </listitem>
-
-  <listitem>
-    <para>Add a call to the function defined in the previous step to
-    <link
+     on writing Nix expressions</link>.
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     Add a call to the function defined in the previous step to
+     <link
     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>.
-
-    <screen>
+     with some descriptive name for the variable, e.g.
+     <varname>libfoo</varname>.
+<screen>
 $ emacs pkgs/top-level/all-packages.nix</screen>
-      
     </para>
-
-    <para>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.</para>
-  </listitem>
-
-  <listitem>
-    <para>To test whether the package builds, run the following command
-    from the root of the nixpkgs source tree:
-
-    <screen>
+    <para>
+     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.
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     To test whether the package builds, run the following command from the
+     root of the nixpkgs source tree:
+<screen>
 $ nix-build -A libfoo</screen>
-
-    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.</para>
-  </listitem>
-
-  <listitem>
-    <para>If you want to install the package into your profile
-    (optional), do
-
-    <screen>
+     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.
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     If you want to install the package into your profile (optional), do
+<screen>
 $ nix-env -f . -iA libfoo</screen>
-
     </para>
-  </listitem>
-
-  <listitem>
-    <para>Optionally commit the new package and open a pull request, or send a patch to
-    <literal>https://groups.google.com/forum/#!forum/nix-devel</literal>.</para>
-  </listitem>
-
-
-</orderedlist>
-
-</para>
-
+   </listitem>
+   <listitem>
+    <para>
+     Optionally commit the new package and open a pull request, or send a patch
+     to <literal>https://groups.google.com/forum/#!forum/nix-devel</literal>.
+    </para>
+   </listitem>
+  </orderedlist>
+ </para>
 </chapter>
diff --git a/doc/release-notes.xml b/doc/release-notes.xml
index a50ee877acd..6dae6ae5620 100644
--- a/doc/release-notes.xml
+++ b/doc/release-notes.xml
@@ -1,164 +1,177 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <article xmlns="http://docbook.org/ns/docbook"
          xmlns:xlink="http://www.w3.org/1999/xlink">
+ <title>Nixpkgs Release Notes</title>
+ <section>
+  <title>Release 0.14 (June 4, 2012)</title>
+
+  <para>
+   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.)
+  </para>
 
-<title>Nixpkgs Release Notes</title>
-
-
-<section><title>Release 0.14 (June 4, 2012)</title>
-
-<para>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.)</para>
-
-<para>Since the last release, there have been thousands of changes and
-new packages by numerous contributors.  For details, see the commit
-logs.</para>
-
-</section>
-
-
-<section><title>Release 0.13 (February 5, 2010)</title>
-
-<para>As always, there are many changes.  Some of the most important
-updates are:
-
-<itemizedlist>
-
-  <listitem><para>Glibc 2.9.</para></listitem>
-
-  <listitem><para>GCC 4.3.3.</para></listitem>
-
-  <listitem><para>Linux 2.6.32.</para></listitem>
-
-  <listitem><para>X.org 7.5.</para></listitem>
-
-  <listitem><para>KDE 4.3.4.</para></listitem>
-
-</itemizedlist>
-
-</para>
-
-
-</section>
-
-
-<section><title>Release 0.12 (April 24, 2009)</title>
-
-<para>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:
-
-<itemizedlist>
-
-  <listitem><para>Nixpkgs now has a manual.  In particular, it
-  describes the standard build environment in
-  detail.</para></listitem>
-
-  <listitem><para>Major new packages:
-
-    <itemizedlist>
-
-      <listitem><para>KDE 4.</para></listitem>
-
-      <listitem><para>TeXLive.</para></listitem>
-
-      <listitem><para>VirtualBox.</para></listitem>
-
-    </itemizedlist>
-
-    … and many others.
-
-  </para></listitem>
-
-  <listitem><para>Important updates:
-
-    <itemizedlist>
-
-      <listitem><para>Glibc 2.7.</para></listitem>
-      
-      <listitem><para>GCC 4.2.4.</para></listitem>
-
-      <listitem><para>Linux 2.6.25 — 2.6.28.</para></listitem>
-
-      <listitem><para>Firefox 3.</para></listitem>
-
-      <listitem><para>X.org 7.3.</para></listitem>
-
-    </itemizedlist>
-
-  </para></listitem>
-
-  <listitem><para>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.</para></listitem>
-
-  <listitem><para>Improved support for building Haskell
-  packages.</para></listitem>
-  
-</itemizedlist>
-
-</para>
-
-<para>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.</para>
-
-</section>
-  
-
-<section><title>Release 0.11 (September 11, 2007)</title>
-
-<para>This release has the following improvements:
-
-<itemizedlist>
-
-  
-  <listitem><para>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.</para></listitem>
-
-  
-  <listitem><para>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:
+  <para>
+   Since the last release, there have been thousands of changes and new
+   packages by numerous contributors. For details, see the commit logs.
+  </para>
+ </section>
+ <section>
+  <title>Release 0.13 (February 5, 2010)</title>
+
+  <para>
+   As always, there are many changes. Some of the most important updates are:
+   <itemizedlist>
+    <listitem>
+     <para>
+      Glibc 2.9.
+     </para>
+    </listitem>
+    <listitem>
+     <para>
+      GCC 4.3.3.
+     </para>
+    </listitem>
+    <listitem>
+     <para>
+      Linux 2.6.32.
+     </para>
+    </listitem>
+    <listitem>
+     <para>
+      X.org 7.5.
+     </para>
+    </listitem>
+    <listitem>
+     <para>
+      KDE 4.3.4.
+     </para>
+    </listitem>
+   </itemizedlist>
+  </para>
+ </section>
+ <section>
+  <title>Release 0.12 (April 24, 2009)</title>
+
+  <para>
+   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:
+   <itemizedlist>
+    <listitem>
+     <para>
+      Nixpkgs now has a manual. In particular, it describes the standard build
+      environment in detail.
+     </para>
+    </listitem>
+    <listitem>
+     <para>
+      Major new packages:
+      <itemizedlist>
+       <listitem>
+        <para>
+         KDE 4.
+        </para>
+       </listitem>
+       <listitem>
+        <para>
+         TeXLive.
+        </para>
+       </listitem>
+       <listitem>
+        <para>
+         VirtualBox.
+        </para>
+       </listitem>
+      </itemizedlist>
+      … and many others.
+     </para>
+    </listitem>
+    <listitem>
+     <para>
+      Important updates:
+      <itemizedlist>
+       <listitem>
+        <para>
+         Glibc 2.7.
+        </para>
+       </listitem>
+       <listitem>
+        <para>
+         GCC 4.2.4.
+        </para>
+       </listitem>
+       <listitem>
+        <para>
+         Linux 2.6.25 — 2.6.28.
+        </para>
+       </listitem>
+       <listitem>
+        <para>
+         Firefox 3.
+        </para>
+       </listitem>
+       <listitem>
+        <para>
+         X.org 7.3.
+        </para>
+       </listitem>
+      </itemizedlist>
+     </para>
+    </listitem>
+    <listitem>
+     <para>
+      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.
+     </para>
+    </listitem>
+    <listitem>
+     <para>
+      Improved support for building Haskell packages.
+     </para>
+    </listitem>
+   </itemizedlist>
+  </para>
 
+  <para>
+   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.
+  </para>
+ </section>
+ <section>
+  <title>Release 0.11 (September 11, 2007)</title>
+
+  <para>
+   This release has the following improvements:
+   <itemizedlist>
+    <listitem>
+     <para>
+      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.
+     </para>
+    </listitem>
+    <listitem>
+     <para>
+      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:
 <programlisting>
 source $stdenv/setup
 
@@ -169,290 +182,311 @@ postInstall() {
 }
 
 genericBuild</programlisting>
-
-  (the <literal>gzip</literal> builder), you can just add this
-  attribute to the derivation:
-
+      (the <literal>gzip</literal> builder), you can just add this attribute to
+      the derivation:
 <programlisting>
 postInstall = "ln -sf gzip $out/bin/gunzip; ln -sf gzip $out/bin/zcat";</programlisting>
-
-  and so a separate build script becomes unnecessary.  This should
-  allow us to get rid of most builders in Nixpkgs.</para></listitem>
-
-
-  <listitem><para>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,
-
+      and so a separate build script becomes unnecessary. This should allow us
+      to get rid of most builders in Nixpkgs.
+     </para>
+    </listitem>
+    <listitem>
+     <para>
+      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,
 <programlisting>
 configureFlags="CFLAGS=-O0"</programlisting>
-
-  but not
-
+      but not
 <programlisting>
 configureFlags="CFLAGS=-O0 -g"</programlisting>
-
-  since the <literal>-g</literal> would be interpreted as a separate
-  argument to <command>configure</command>.  Now you can say
-
+      since the <literal>-g</literal> would be interpreted as a separate
+      argument to <command>configure</command>. Now you can say
 <programlisting>
 configureFlagsArray=("CFLAGS=-O0 -g")</programlisting>
-
-  or similarly
-
+      or similarly
 <programlisting>
 configureFlagsArray=("CFLAGS=-O0 -g" "LDFLAGS=-L/foo -L/bar")</programlisting>
-
-  which does the right thing.  Idem for <literal>makeFlags</literal>,
-  <literal>installFlags</literal>, <literal>checkFlags</literal> and
-  <literal>distFlags</literal>.</para>
-
-  <para>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.,
-
+      which does the right thing. Idem for <literal>makeFlags</literal>,
+      <literal>installFlags</literal>, <literal>checkFlags</literal> and
+      <literal>distFlags</literal>.
+     </para>
+     <para>
+      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.,
 <programlisting>
 configureFlagsArray = ["CFLAGS=-O0 -g"];</programlisting>
-
-  since it would just be flattened to a since string.  However, you
-  <emphasis>can</emphasis> use the inline hooks described above:
-
+      since it would just be flattened to a since string. However, you
+      <emphasis>can</emphasis> use the inline hooks described above:
 <programlisting>
 preConfigure = "configureFlagsArray=(\"CFLAGS=-O0 -g\")";</programlisting>
-
-  </para></listitem>
-
-
-  <listitem><para>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
-
+     </para>
+    </listitem>
+    <listitem>
+     <para>
+      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
 <programlisting>
 fetchurl {
   url = http://releases.mozilla.org/<replaceable>...</replaceable>/firefox-2.0.0.6-source.tar.bz2;
   sha1 = "eb72f55e4a8bf08e8c6ef227c0ade3d068ba1082";
 }</programlisting>
-
-  <function>fetchurl</function> will first try to download this file
-  from <link
+      <function>fetchurl</function> will first try to download this file from
+      <link
   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
+      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
   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.</para>
-
-  <para>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:
+      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.
+     </para>
+     <para>
+      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:
 <programlisting>
 fetchurl {
   url = mirror://gnu/gcc/gcc-4.2.0/gcc-core-4.2.0.tar.bz2;
   sha256 = "0ykhzxhr8857dr97z0j9wyybfz1kjr71xk457cfapfw5fjas4ny1";
 }</programlisting>
-  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.
+      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.
 <programlisting>
 export NIX_MIRRORS_sourceforge=http://osdn.dl.sourceforge.net/sourceforge/</programlisting>
+     </para>
+    </listitem>
+    <listitem>
+     <para>
+      Important updates:
+      <itemizedlist>
+       <listitem>
+        <para>
+         Glibc 2.5.
+        </para>
+       </listitem>
+       <listitem>
+        <para>
+         GCC 4.1.2.
+        </para>
+       </listitem>
+       <listitem>
+        <para>
+         Gnome 2.16.3.
+        </para>
+       </listitem>
+       <listitem>
+        <para>
+         X11R7.2.
+        </para>
+       </listitem>
+       <listitem>
+        <para>
+         Linux 2.6.21.7 and 2.6.22.6.
+        </para>
+       </listitem>
+       <listitem>
+        <para>
+         Emacs 22.1.
+        </para>
+       </listitem>
+      </itemizedlist>
+     </para>
+    </listitem>
+    <listitem>
+     <para>
+      Major new packages:
+      <itemizedlist>
+       <listitem>
+        <para>
+         KDE 3.5.6 Base.
+        </para>
+       </listitem>
+       <listitem>
+        <para>
+         Wine 0.9.43.
+        </para>
+       </listitem>
+       <listitem>
+        <para>
+         OpenOffice 2.2.1.
+        </para>
+       </listitem>
+       <listitem>
+        <para>
+         Many Linux system packages to support NixOS.
+        </para>
+       </listitem>
+      </itemizedlist>
+     </para>
+    </listitem>
+   </itemizedlist>
   </para>
 
-  </listitem>
-
-
-  <listitem><para>Important updates:
-
-    <itemizedlist>
-
-      <listitem><para>Glibc 2.5.</para></listitem>
-      
-      <listitem><para>GCC 4.1.2.</para></listitem>
-      
-      <listitem><para>Gnome 2.16.3.</para></listitem>
-      
-      <listitem><para>X11R7.2.</para></listitem>
-      
-      <listitem><para>Linux 2.6.21.7 and 2.6.22.6.</para></listitem>
-      
-      <listitem><para>Emacs 22.1.</para></listitem>
-      
-    </itemizedlist>
-
-  </para></listitem>
-
-  
-  <listitem><para>Major new packages:
-
-    <itemizedlist>
-
-      <listitem><para>KDE 3.5.6 Base.</para></listitem>
-      
-      <listitem><para>Wine 0.9.43.</para></listitem>
-      
-      <listitem><para>OpenOffice 2.2.1.</para></listitem>
-      
-      <listitem><para>Many Linux system packages to support
-      NixOS.</para></listitem>
-      
-    </itemizedlist>
-
-  </para></listitem>
-
-</itemizedlist>
-
-</para>
-
-<para>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.
-
-</para>
-  
-</section>
-
-
-<section><title>Release 0.10 (October 12, 2006)</title>
-
-<note><para>This release of Nixpkgs requires <link
-xlink:href='http://nixos.org/releases/nix/nix-0.10/'>Nix
-0.10</link> or higher.</para></note>
-
-<para>This release has the following improvements:</para>
-
-<itemizedlist>
-
-  <listitem><para><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.</para></listitem>
-
-  <listitem><para>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.</para>
-
-  <para>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:
+  <para>
+   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.
+  </para>
+ </section>
+ <section>
+  <title>Release 0.10 (October 12, 2006)</title>
+
+  <note>
+   <para>
+    This release of Nixpkgs requires
+    <link
+xlink:href='http://nixos.org/releases/nix/nix-0.10/'>Nix 0.10</link>
+    or higher.
+   </para>
+  </note>
+
+  <para>
+   This release has the following improvements:
+  </para>
 
+  <itemizedlist>
+   <listitem>
+    <para>
+     <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.
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     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.
+    </para>
+    <para>
+     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:
 <programlisting>
 {
   firefox = {
     enableRealPlayer = true;
   };
 }</programlisting>
-
-  persistently enables RealPlayer support in the Firefox
-  build.</para>
-
-  <para>(Actually, <literal>firefox.enableRealPlayer</literal> is the
-  <emphasis>only</emphasis> configuration option currently available,
-  but more are sure to be added.)</para></listitem>
-
-  <listitem><para>Support for new platforms:
-
-    <itemizedlist>
-
-      <listitem><para><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
-      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>.</para></listitem>
-
-      <listitem><para><literal>i686-darwin</literal>, i.e., Mac OS X
-      on Intel CPUs.</para></listitem>
-
-      <listitem><para><literal>powerpc-linux</literal>.</para></listitem>
-
-      <listitem><para><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.</para></listitem>
-
-    </itemizedlist>
-
+     persistently enables RealPlayer support in the Firefox build.
     </para>
-
-  </listitem>
-        
-  <listitem><para>The default compiler is now GCC 4.1.1.</para></listitem>
-
-  <listitem><para>X11 updated to X.org’s X11R7.1.</para></listitem>
-
-  <listitem><para>Notable new packages:
-
-    <itemizedlist>
-
-      <listitem><para>Opera.</para></listitem>
-
-      <listitem><para>Microsoft Visual C++ 2005 Express Edition and
-      the Windows SDK.</para></listitem>
-
-    </itemizedlist>
-
-    In total there are now around 809 packages in Nixpkgs.</para>
-
-  </listitem>
-
-  
-  <listitem><para>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.</para>
-
-  <para>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:
-
+    <para>
+     (Actually, <literal>firefox.enableRealPlayer</literal> is the
+     <emphasis>only</emphasis> configuration option currently available, but
+     more are sure to be added.)
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     Support for new platforms:
+     <itemizedlist>
+      <listitem>
+       <para>
+        <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
+      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>.
+       </para>
+      </listitem>
+      <listitem>
+       <para>
+        <literal>i686-darwin</literal>, i.e., Mac OS X on Intel CPUs.
+       </para>
+      </listitem>
+      <listitem>
+       <para>
+        <literal>powerpc-linux</literal>.
+       </para>
+      </listitem>
+      <listitem>
+       <para>
+        <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.
+       </para>
+      </listitem>
+     </itemizedlist>
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     The default compiler is now GCC 4.1.1.
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     X11 updated to X.org’s X11R7.1.
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     Notable new packages:
+     <itemizedlist>
+      <listitem>
+       <para>
+        Opera.
+       </para>
+      </listitem>
+      <listitem>
+       <para>
+        Microsoft Visual C++ 2005 Express Edition and the Windows SDK.
+       </para>
+      </listitem>
+     </itemizedlist>
+     In total there are now around 809 packages in Nixpkgs.
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     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.
+    </para>
+    <para>
+     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:
 <programlisting>
 strategoxt = (import ../development/compilers/strategoxt) {
   inherit fetchurl pkgconfig sdf aterm;
@@ -460,44 +494,37 @@ strategoxt = (import ../development/compilers/strategoxt) {
 };
 
 gnumake380 = <replaceable>...</replaceable>;</programlisting>
-
-  Likewise, there are many packages that don’t compile with the
-  default GCC (4.1.1), but that’s easily fixed:
-
+     Likewise, there are many packages that don’t compile with the default
+     GCC (4.1.1), but that’s easily fixed:
 <programlisting>
 exult = import ../games/exult {
   inherit fetchurl SDL SDL_mixer zlib libpng unzip;
   stdenv = overrideGCC stdenv gcc34;
 };</programlisting>
-
-  </para></listitem>
-
-
-  <listitem><para>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:
-
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     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:
 <programlisting>
 pkg = import <replaceable>...</replaceable> {
   stdenv = stdenv.regenerate ./my-setup.sh;
   <replaceable>...</replaceable>
 }</programlisting>
-
-  </para></listitem>
-
-
-  <listitem><para>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:
-
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     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:
 <programlisting>
 stdenv.mkDerivation {
   name = "exult-1.2";
@@ -506,228 +533,268 @@ stdenv.mkDerivation {
     description = "A reimplementation of the Ultima VII game engine";
   };
 }</programlisting>
-
-  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.).</para></listitem>
-  
-</itemizedlist>
-
-
-<para>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.
-
-</para>
-  
-</section>
-
-
-<section><title>Release 0.9 (January 31, 2006)</title>
-
-<para>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:</para>
-
-<itemizedlist>
-
-  <listitem><para>Distribution files have been moved to <link
-  xlink:href="http://nixos.org/" />.</para></listitem>
-
-  <listitem><para>The C library on Linux, Glibc, has been updated to
-  version 2.3.6.</para></listitem>
-
-  <listitem><para>The default compiler is now GCC 3.4.5.  GCC 4.0.2 is
-  also available.</para></listitem>
-
-  <listitem><para>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.</para></listitem>
-
-  <listitem><para>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.</para></listitem>
-
-  <listitem><para>Hardware-accelerated OpenGL support, used by games
-  like Quake 3 (which is now built from source).</para></listitem>
-
-  <listitem><para>Improved support for FreeBSD on
-  x86.</para></listitem>
-
-  <listitem><para>Improved Haskell support; e.g., the GHC build is now
-  pure.</para></listitem>
-
-  <listitem><para>Some support for cross-compilation: cross-compiling
-  builds of GCC and Binutils, and cross-compiled builds of the C
-  library uClibc.</para></listitem>
-
-  <listitem><para>Notable new packages:
-
-    <itemizedlist>
-
-      <listitem><para>teTeX, including support for building LaTeX
-      documents using Nix (with automatic dependency
-      determination).</para></listitem>
-      
-      <listitem><para>Ruby.</para></listitem>
-
-      <listitem><para>System-level packages to support NixOS,
-      e.g. Grub, GNU <literal>parted</literal> and so
-      on.</para></listitem>
-
-      <listitem><para><literal>ecj</literal>, the Eclipse Compiler for
-      Java, so we finally have a freely distributable compiler that
-      supports Java 5.0.</para></listitem>
-
-      <listitem><para><literal>php</literal>.</para></listitem>
-
-      <listitem><para>The GIMP.</para></listitem>
-
-      <listitem><para>Inkscape.</para></listitem>
-
-      <listitem><para>GAIM.</para></listitem>
-
-      <listitem><para><literal>kdelibs</literal>.  This allows us to
-      add KDE-based packages (such as
-      <literal>kcachegrind</literal>).</para></listitem>
-
-    </itemizedlist>
-
-  </para></listitem>
-
-</itemizedlist>
-
-<para>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.
-
-</para>
-
-</section>
-
-
-<section><title>Release 0.8 (April 11, 2005)</title>
-
-<para>This release is mostly to remain synchronised with the changed
-hashing scheme in Nix 0.8.</para>
-
-<para>Notable updates:
-
-<itemizedlist>
-
-  <listitem><para>Adobe Reader 7.0</para></listitem>
-
-  <listitem><para>Various security updates (zlib 1.2.2, etc.)</para></listitem>
-
-</itemizedlist>
-
-</para>
-
-</section>
-
-
-<section><title>Release 0.7 (March 14, 2005)</title>
-
-<itemizedlist>
-
-<listitem>
-
-  <para>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.</para>
-
-  <para>This change also makes the bootstrap process faster.  For
-  instance, GCC is built only once instead of three times.</para>
-
-  <para>(Contributed by Armijn Hemel.)</para>
-
-</listitem>
-
-<listitem>
-
-  <para>Tarballs used by Nixpkgs are now obtained from the same server
-  that hosts Nixpkgs (<link
-  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.</para>
-
-</listitem>
-
-<listitem>
-
-  <para>There now is a generic mechanism for building Perl modules.
-  See the various Perl modules defined in
-  pkgs/system/all-packages-generic.nix.</para>
-
-</listitem>
-
-<listitem>
-
-  <para>Notable new packages:
-
-  <itemizedlist>
-
-    <listitem><para>Qt 3</para></listitem>
-    <listitem><para>MySQL</para></listitem>
-    <listitem><para>MythTV</para></listitem>
-    <listitem><para>Mono</para></listitem>
-    <listitem><para>MonoDevelop (alpha)</para></listitem>
-    <listitem><para>Xine</para></listitem>
-
+     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.).
+    </para>
+   </listitem>
   </itemizedlist>
 
+  <para>
+   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.
+  </para>
+ </section>
+ <section>
+  <title>Release 0.9 (January 31, 2006)</title>
+
+  <para>
+   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:
   </para>
-
-</listitem>
-
-<listitem>
-
-  <para>Notable updates:
 
   <itemizedlist>
-
-    <listitem><para>GCC 3.4.3</para></listitem>
-    <listitem><para>Glibc 2.3.4</para></listitem>
-    <listitem><para>GTK 2.6</para></listitem>
-
+   <listitem>
+    <para>
+     Distribution files have been moved to
+     <link
+  xlink:href="http://nixos.org/" />.
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     The C library on Linux, Glibc, has been updated to version 2.3.6.
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     The default compiler is now GCC 3.4.5. GCC 4.0.2 is also available.
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     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.
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     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.
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     Hardware-accelerated OpenGL support, used by games like Quake 3 (which is
+     now built from source).
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     Improved support for FreeBSD on x86.
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     Improved Haskell support; e.g., the GHC build is now pure.
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     Some support for cross-compilation: cross-compiling builds of GCC and
+     Binutils, and cross-compiled builds of the C library uClibc.
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     Notable new packages:
+     <itemizedlist>
+      <listitem>
+       <para>
+        teTeX, including support for building LaTeX documents using Nix (with
+        automatic dependency determination).
+       </para>
+      </listitem>
+      <listitem>
+       <para>
+        Ruby.
+       </para>
+      </listitem>
+      <listitem>
+       <para>
+        System-level packages to support NixOS, e.g. Grub, GNU
+        <literal>parted</literal> and so on.
+       </para>
+      </listitem>
+      <listitem>
+       <para>
+        <literal>ecj</literal>, the Eclipse Compiler for Java, so we finally
+        have a freely distributable compiler that supports Java 5.0.
+       </para>
+      </listitem>
+      <listitem>
+       <para>
+        <literal>php</literal>.
+       </para>
+      </listitem>
+      <listitem>
+       <para>
+        The GIMP.
+       </para>
+      </listitem>
+      <listitem>
+       <para>
+        Inkscape.
+       </para>
+      </listitem>
+      <listitem>
+       <para>
+        GAIM.
+       </para>
+      </listitem>
+      <listitem>
+       <para>
+        <literal>kdelibs</literal>. This allows us to add KDE-based packages
+        (such as <literal>kcachegrind</literal>).
+       </para>
+      </listitem>
+     </itemizedlist>
+    </para>
+   </listitem>
   </itemizedlist>
 
+  <para>
+   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.
   </para>
+ </section>
+ <section>
+  <title>Release 0.8 (April 11, 2005)</title>
 
-</listitem>
-
-</itemizedlist>
+  <para>
+   This release is mostly to remain synchronised with the changed hashing
+   scheme in Nix 0.8.
+  </para>
 
-</section>
+  <para>
+   Notable updates:
+   <itemizedlist>
+    <listitem>
+     <para>
+      Adobe Reader 7.0
+     </para>
+    </listitem>
+    <listitem>
+     <para>
+      Various security updates (zlib 1.2.2, etc.)
+     </para>
+    </listitem>
+   </itemizedlist>
+  </para>
+ </section>
+ <section>
+  <title>Release 0.7 (March 14, 2005)</title>
 
-  
+  <itemizedlist>
+   <listitem>
+    <para>
+     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.
+    </para>
+    <para>
+     This change also makes the bootstrap process faster. For instance, GCC is
+     built only once instead of three times.
+    </para>
+    <para>
+     (Contributed by Armijn Hemel.)
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     Tarballs used by Nixpkgs are now obtained from the same server that hosts
+     Nixpkgs (<link
+  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.
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     There now is a generic mechanism for building Perl modules. See the
+     various Perl modules defined in pkgs/system/all-packages-generic.nix.
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     Notable new packages:
+     <itemizedlist>
+      <listitem>
+       <para>
+        Qt 3
+       </para>
+      </listitem>
+      <listitem>
+       <para>
+        MySQL
+       </para>
+      </listitem>
+      <listitem>
+       <para>
+        MythTV
+       </para>
+      </listitem>
+      <listitem>
+       <para>
+        Mono
+       </para>
+      </listitem>
+      <listitem>
+       <para>
+        MonoDevelop (alpha)
+       </para>
+      </listitem>
+      <listitem>
+       <para>
+        Xine
+       </para>
+      </listitem>
+     </itemizedlist>
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     Notable updates:
+     <itemizedlist>
+      <listitem>
+       <para>
+        GCC 3.4.3
+       </para>
+      </listitem>
+      <listitem>
+       <para>
+        Glibc 2.3.4
+       </para>
+      </listitem>
+      <listitem>
+       <para>
+        GTK 2.6
+       </para>
+      </listitem>
+     </itemizedlist>
+    </para>
+   </listitem>
+  </itemizedlist>
+ </section>
 </article>
diff --git a/doc/reviewing-contributions.xml b/doc/reviewing-contributions.xml
index 7b017f0a8cc..b648691183b 100644
--- a/doc/reviewing-contributions.xml
+++ b/doc/reviewing-contributions.xml
@@ -3,95 +3,148 @@
         xmlns:xi="http://www.w3.org/2001/XInclude"
         version="5.0"
         xml:id="sec-reviewing-contributions">
-
-<title>Reviewing contributions</title>
-
-<warning>
-  <para>The following section is a draft and reviewing policy is still being
-    discussed.</para>
-</warning>
-
-<para>The nixpkgs projects 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.</para>
-
-<para>The high change rate of nixpkgs make any pull request that is open for
-  long enough subject to conflicts that will require extra work from the
-  submitter or the merger. Reviewing pull requests in a timely manner and being
+ <title>Reviewing contributions</title>
+ <warning>
+  <para>
+   The following section is a draft and reviewing policy is still being
+   discussed.
+  </para>
+ </warning>
+ <para>
+  The nixpkgs projects 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.
+ </para>
+ <para>
+  The high change rate of nixpkgs make any pull request that is open for long
+  enough 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 these. GitHub provides sort
-  filters that can be used to see the <link
+  filters that can be used to see the
+  <link
     xlink:href="https://github.com/NixOS/nixpkgs/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-desc">most
-    recently</link> and the <link
+  recently</link> and the
+  <link
     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>.</para>
-
-<para>When reviewing a pull request, please always be nice and polite.
+  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>.
+ </para>
+ <para>
+  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 members and their work.</para>
-
-<para>GitHub provides reactions, they are a simple and quick way to provide
+  to respect every community members and their work.
+ </para>
+ <para>
+  GitHub provides reactions, they are 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 explanations so the
-  submitter has directions to improve his contribution.</para>
-
-<para>Pull-requests 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.</para>
-
-<para>All the review template samples provided in this section are generic and
+  submitter has directions to improve his contribution.
+ </para>
+ <para>
+  Pull-requests 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.
+ </para>
+ <para>
+  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 his liking.</para>
-
-<section><title>Package updates</title>
-
-<para>A package update is the most trivial and common type of pull-request.
-  These pull-requests mainly consist in updating the version part of the package
-  name and the source hash.</para>
-<para>It can happen that non trivial updates include patches or more complex
-  changes.</para>
-
-<para>Reviewing process:</para>
-
-<itemizedlist>
-  <listitem><para>Add labels to the pull-request. (Requires commit
-      rights)</para>
+  them to his liking.
+ </para>
+ <section>
+  <title>Package updates</title>
+
+  <para>
+   A package update is the most trivial and common type of pull-request. These
+   pull-requests mainly consist in updating the version part of the package
+   name and the source hash.
+  </para>
+
+  <para>
+   It can happen that non trivial updates include patches or more complex
+   changes.
+  </para>
+
+  <para>
+   Reviewing process:
+  </para>
+
+  <itemizedlist>
+   <listitem>
+    <para>
+     Add labels to the pull-request. (Requires commit rights)
+    </para>
     <itemizedlist>
-      <listitem><para><literal>8.has: package (update)</literal> and any topic
-          label that fit the updated package.</para></listitem>
+     <listitem>
+      <para>
+       <literal>8.has: package (update)</literal> and any topic label that fit
+       the updated package.
+      </para>
+     </listitem>
     </itemizedlist>
-  </listitem>
-  <listitem><para>Ensure that the package versioning is fitting the
-      guidelines.</para></listitem>
-  <listitem><para>Ensure that the commit text is fitting the
-      guidelines.</para></listitem>
-  <listitem><para>Ensure that the package maintainers are notified.</para>
+   </listitem>
+   <listitem>
+    <para>
+     Ensure that the package versioning is fitting the guidelines.
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     Ensure that the commit text is fitting the guidelines.
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     Ensure that the package maintainers are notified.
+    </para>
     <itemizedlist>
-      <listitem><para>mention-bot usually notify GitHub users based on the
-          submitted changes, but it can happen that it misses some of the
-          package maintainers.</para></listitem>
+     <listitem>
+      <para>
+       mention-bot usually notify GitHub users based on the submitted changes,
+       but it can happen that it misses some of the package maintainers.
+      </para>
+     </listitem>
     </itemizedlist>
-  </listitem>
-  <listitem><para>Ensure that the meta field contains correct
-      information.</para>
+   </listitem>
+   <listitem>
+    <para>
+     Ensure that the meta field contains correct information.
+    </para>
     <itemizedlist>
-      <listitem><para>License can change with version updates, so it should be
-          checked to be fitting upstream license.</para></listitem>
-      <listitem><para>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.</para></listitem>
+     <listitem>
+      <para>
+       License can change with version updates, so it should be checked to be
+       fitting upstream license.
+      </para>
+     </listitem>
+     <listitem>
+      <para>
+       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.
+      </para>
+     </listitem>
     </itemizedlist>
-  </listitem>
-  <listitem><para>Ensure that the code contains no typos.</para></listitem>
-  <listitem><para>Building the package locally.</para>
+   </listitem>
+   <listitem>
+    <para>
+     Ensure that the code contains no typos.
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     Building the package locally.
+    </para>
     <itemizedlist>
-      <listitem><para>Pull-requests are often targeted to the master or staging
-          branch so building the pull-request locally as it is submitted can
-          trigger a large amount of source builds.</para>
-        <para>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.
+     <listitem>
+      <para>
+       Pull-requests are often targeted to the master or staging branch so
+       building the pull-request locally as it is submitted can trigger a large
+       amount of source builds.
+      </para>
+      <para>
+       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.
 <screen>
 $ git remote add channels https://github.com/NixOS/nixpkgs-channels.git <co
   xml:id='reviewing-rebase-1' />
@@ -100,43 +153,56 @@ $ git fetch origin pull/PRNUMBER/head <co xml:id='reviewing-rebase-3' />
 $ git rebase --onto nixos-unstable BASEBRANCH FETCH_HEAD <co
   xml:id='reviewing-rebase-4' />
 </screen>
-        <calloutlist>
-          <callout arearefs='reviewing-rebase-1'>
-            <para>This should be done only once to be able to fetch channel
-              branches from the nixpkgs-channels repository.</para>
-          </callout>
-          <callout arearefs='reviewing-rebase-2'>
-            <para>Fetching the nixos-unstable branch.</para>
-          </callout>
-          <callout arearefs='reviewing-rebase-3'>
-            <para>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.</para>
-          </callout>
-          <callout arearefs='reviewing-rebase-4'>
-            <para>Rebasing the pull-request changes to the nixos-unstable
-              branch.</para>
-          </callout>
-        </calloutlist>
-        </para>
-      </listitem>
-      <listitem>
-        <para>The <link xlink:href="https://github.com/madjar/nox">nox</link>
-          tool can be used to review a pull-request content in a single command.
-          It doesn't rebase on a channel branch so it might trigger multiple
-          source builds. <varname>PRNUMBER</varname> should be replaced by the
-          number at the end of the pull-request title.</para>
+       <calloutlist>
+        <callout arearefs='reviewing-rebase-1'>
+         <para>
+          This should be done only once to be able to fetch channel branches
+          from the nixpkgs-channels repository.
+         </para>
+        </callout>
+        <callout arearefs='reviewing-rebase-2'>
+         <para>
+          Fetching the nixos-unstable branch.
+         </para>
+        </callout>
+        <callout arearefs='reviewing-rebase-3'>
+         <para>
+          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.
+         </para>
+        </callout>
+        <callout arearefs='reviewing-rebase-4'>
+         <para>
+          Rebasing the pull-request changes to the nixos-unstable branch.
+         </para>
+        </callout>
+       </calloutlist>
+      </para>
+     </listitem>
+     <listitem>
+      <para>
+       The <link xlink:href="https://github.com/madjar/nox">nox</link> tool can
+       be used to review a pull-request content in a single command. It doesn't
+       rebase on a channel branch so it might trigger multiple source builds.
+       <varname>PRNUMBER</varname> should be replaced by the number at the end
+       of the pull-request title.
+      </para>
 <screen>
 $ nix-shell -p nox --run "nox-review -k pr PRNUMBER"
 </screen>
-      </listitem>
+     </listitem>
     </itemizedlist>
-  </listitem>
-  <listitem><para>Running every binary.</para></listitem>
-</itemizedlist>
-
-<example><title>Sample template for a package update review</title>
+   </listitem>
+   <listitem>
+    <para>
+     Running every binary.
+    </para>
+   </listitem>
+  </itemizedlist>
+
+  <example>
+   <title>Sample template for a package update review</title>
 <screen>
 ##### Reviewed points
 
@@ -150,55 +216,105 @@ $ nix-shell -p nox --run "nox-review -k pr PRNUMBER"
 
 ##### Comments
 
-</screen></example>
-</section>
-
-<section><title>New packages</title>
-
-<para>New packages are a common type of pull-requests. These pull requests
-  consists in adding a new nix-expression for a package.</para>
-
-<para>Reviewing process:</para>
-
-<itemizedlist>
-  <listitem><para>Add labels to the pull-request. (Requires commit
-      rights)</para>
+</screen>
+  </example>
+ </section>
+ <section>
+  <title>New packages</title>
+
+  <para>
+   New packages are a common type of pull-requests. These pull requests
+   consists in adding a new nix-expression for a package.
+  </para>
+
+  <para>
+   Reviewing process:
+  </para>
+
+  <itemizedlist>
+   <listitem>
+    <para>
+     Add labels to the pull-request. (Requires commit rights)
+    </para>
     <itemizedlist>
-      <listitem><para><literal>8.has: package (new)</literal> and any topic
-          label that fit the new package.</para></listitem>
+     <listitem>
+      <para>
+       <literal>8.has: package (new)</literal> and any topic label that fit the
+       new package.
+      </para>
+     </listitem>
     </itemizedlist>
-  </listitem>
-  <listitem><para>Ensure that the package versioning is fitting the
-      guidelines.</para></listitem>
-  <listitem><para>Ensure that the commit name is fitting the
-      guidelines.</para></listitem>
-  <listitem><para>Ensure that the meta field contains correct
-      information.</para>
+   </listitem>
+   <listitem>
+    <para>
+     Ensure that the package versioning is fitting the guidelines.
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     Ensure that the commit name is fitting the guidelines.
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     Ensure that the meta field contains correct information.
+    </para>
     <itemizedlist>
-      <listitem><para>License must be checked to be fitting upstream
-          license.</para></listitem>
-      <listitem><para>Platforms should be set or the package will not get binary
-          substitutes.</para></listitem>
-      <listitem><para>A maintainer must be set, this can be the package
-          submitter or a community member that accepts to take maintainership of
-          the package.</para></listitem>
+     <listitem>
+      <para>
+       License must be checked to be fitting upstream license.
+      </para>
+     </listitem>
+     <listitem>
+      <para>
+       Platforms should be set or the package will not get binary substitutes.
+      </para>
+     </listitem>
+     <listitem>
+      <para>
+       A maintainer must be set, this can be the package submitter or a
+       community member that accepts to take maintainership of the package.
+      </para>
+     </listitem>
     </itemizedlist>
-  </listitem>
-  <listitem><para>Ensure that the code contains no typos.</para></listitem>
-  <listitem><para>Ensure the package source.</para>
+   </listitem>
+   <listitem>
+    <para>
+     Ensure that the code contains no typos.
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     Ensure the package source.
+    </para>
     <itemizedlist>
-      <listitem><para>Mirrors urls should be used when
-          available.</para></listitem>
-      <listitem><para>The most appropriate function should be used (e.g.
-          packages from GitHub should use
-          <literal>fetchFromGitHub</literal>).</para></listitem>
+     <listitem>
+      <para>
+       Mirrors urls should be used when available.
+      </para>
+     </listitem>
+     <listitem>
+      <para>
+       The most appropriate function should be used (e.g. packages from GitHub
+       should use <literal>fetchFromGitHub</literal>).
+      </para>
+     </listitem>
     </itemizedlist>
-  </listitem>
-  <listitem><para>Building the package locally.</para></listitem>
-  <listitem><para>Running every binary.</para></listitem>
-</itemizedlist>
-
-<example><title>Sample template for a new package review</title>
+   </listitem>
+   <listitem>
+    <para>
+     Building the package locally.
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     Running every binary.
+    </para>
+   </listitem>
+  </itemizedlist>
+
+  <example>
+   <title>Sample template for a new package review</title>
 <screen>
 ##### Reviewed points
 
@@ -220,58 +336,107 @@ $ nix-shell -p nox --run "nox-review -k pr PRNUMBER"
 
 ##### Comments
 
-</screen></example>
-</section>
-
-<section><title>Module updates</title>
-
-<para>Module updates are submissions changing modules in some ways. These often
-  contains changes to the options or introduce new options.</para>
-
-<para>Reviewing process</para>
-
-<itemizedlist>
-  <listitem><para>Add labels to the pull-request. (Requires commit
-      rights)</para>
+</screen>
+  </example>
+ </section>
+ <section>
+  <title>Module updates</title>
+
+  <para>
+   Module updates are submissions changing modules in some ways. These often
+   contains changes to the options or introduce new options.
+  </para>
+
+  <para>
+   Reviewing process
+  </para>
+
+  <itemizedlist>
+   <listitem>
+    <para>
+     Add labels to the pull-request. (Requires commit rights)
+    </para>
     <itemizedlist>
-      <listitem><para><literal>8.has: module (update)</literal> and any topic
-          label that fit the module.</para></listitem>
+     <listitem>
+      <para>
+       <literal>8.has: module (update)</literal> and any topic label that fit
+       the module.
+      </para>
+     </listitem>
     </itemizedlist>
-  </listitem>
-  <listitem><para>Ensure that the module maintainers are notified.</para>
+   </listitem>
+   <listitem>
+    <para>
+     Ensure that the module maintainers are notified.
+    </para>
     <itemizedlist>
-      <listitem><para>Mention-bot notify GitHub users based on the submitted
-          changes, but it can happen that it miss some of the package
-          maintainers.</para></listitem>
+     <listitem>
+      <para>
+       Mention-bot notify GitHub users based on the submitted changes, but it
+       can happen that it miss some of the package maintainers.
+      </para>
+     </listitem>
     </itemizedlist>
-  </listitem>
-  <listitem><para>Ensure that the module tests, if any, are
-      succeeding.</para></listitem>
-  <listitem><para>Ensure that the introduced options are correct.</para>
+   </listitem>
+   <listitem>
+    <para>
+     Ensure that the module tests, if any, are succeeding.
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     Ensure that the introduced options are correct.
+    </para>
     <itemizedlist>
-      <listitem><para>Type should be appropriate (string related types differs
-          in their merging capabilities, <literal>optionSet</literal> and
-          <literal>string</literal> types are deprecated).</para></listitem>
-      <listitem><para>Description, default and example should be
-          provided.</para></listitem>
+     <listitem>
+      <para>
+       Type should be appropriate (string related types differs in their
+       merging capabilities, <literal>optionSet</literal> and
+       <literal>string</literal> types are deprecated).
+      </para>
+     </listitem>
+     <listitem>
+      <para>
+       Description, default and example should be provided.
+      </para>
+     </listitem>
     </itemizedlist>
-  </listitem>
-  <listitem><para>Ensure that option changes are backward compatible.</para>
+   </listitem>
+   <listitem>
+    <para>
+     Ensure that option changes are backward compatible.
+    </para>
     <itemizedlist>
-      <listitem><para><literal>mkRenamedOptionModule</literal> and
-          <literal>mkAliasOptionModule</literal> functions provide way to make
-          option changes backward compatible.</para></listitem>
+     <listitem>
+      <para>
+       <literal>mkRenamedOptionModule</literal> and
+       <literal>mkAliasOptionModule</literal> functions provide way to make
+       option changes backward compatible.
+      </para>
+     </listitem>
     </itemizedlist>
-  </listitem>
-  <listitem><para>Ensure that removed options are declared with
-      <literal>mkRemovedOptionModule</literal></para></listitem>
-  <listitem><para>Ensure that changes that are not backward compatible are
-      mentioned in release notes.</para></listitem>
-  <listitem><para>Ensure that documentations affected by the change is
-      updated.</para></listitem>
-</itemizedlist>
-
-<example><title>Sample template for a module update review</title>
+   </listitem>
+   <listitem>
+    <para>
+     Ensure that removed options are declared with
+     <literal>mkRemovedOptionModule</literal>
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     Ensure that changes that are not backward compatible are mentioned in
+     release notes.
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     Ensure that documentations affected by the change is updated.
+    </para>
+   </listitem>
+  </itemizedlist>
+
+  <example>
+   <title>Sample template for a module update review</title>
 <screen>
 ##### Reviewed points
 
@@ -288,51 +453,89 @@ $ nix-shell -p nox --run "nox-review -k pr PRNUMBER"
 
 ##### Comments
 
-</screen></example>
-</section>
-
-<section><title>New modules</title>
-
-<para>New modules submissions introduce a new module to NixOS.</para>
-
-<itemizedlist>
-  <listitem><para>Add labels to the pull-request. (Requires commit
-      rights)</para>
+</screen>
+  </example>
+ </section>
+ <section>
+  <title>New modules</title>
+
+  <para>
+   New modules submissions introduce a new module to NixOS.
+  </para>
+
+  <itemizedlist>
+   <listitem>
+    <para>
+     Add labels to the pull-request. (Requires commit rights)
+    </para>
     <itemizedlist>
-      <listitem><para><literal>8.has: module (new)</literal> and any topic label
-          that fit the module.</para></listitem>
+     <listitem>
+      <para>
+       <literal>8.has: module (new)</literal> and any topic label that fit the
+       module.
+      </para>
+     </listitem>
     </itemizedlist>
-  </listitem>
-  <listitem><para>Ensure that the module tests, if any, are
-      succeeding.</para></listitem>
-  <listitem><para>Ensure that the introduced options are correct.</para>
+   </listitem>
+   <listitem>
+    <para>
+     Ensure that the module tests, if any, are succeeding.
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     Ensure that the introduced options are correct.
+    </para>
     <itemizedlist>
-      <listitem><para>Type should be appropriate (string related types differs
-          in their merging capabilities, <literal>optionSet</literal> and
-          <literal>string</literal> types are deprecated).</para></listitem>
-      <listitem><para>Description, default and example should be
-          provided.</para></listitem>
+     <listitem>
+      <para>
+       Type should be appropriate (string related types differs in their
+       merging capabilities, <literal>optionSet</literal> and
+       <literal>string</literal> types are deprecated).
+      </para>
+     </listitem>
+     <listitem>
+      <para>
+       Description, default and example should be provided.
+      </para>
+     </listitem>
     </itemizedlist>
-  </listitem>
-  <listitem><para>Ensure that module <literal>meta</literal> field is
-      present</para>
+   </listitem>
+   <listitem>
+    <para>
+     Ensure that module <literal>meta</literal> field is present
+    </para>
     <itemizedlist>
-      <listitem><para>Maintainers should be declared in
-          <literal>meta.maintainers</literal>.</para></listitem>
-      <listitem><para>Module documentation should be declared with
-          <literal>meta.doc</literal>.</para></listitem>
+     <listitem>
+      <para>
+       Maintainers should be declared in <literal>meta.maintainers</literal>.
+      </para>
+     </listitem>
+     <listitem>
+      <para>
+       Module documentation should be declared with
+       <literal>meta.doc</literal>.
+      </para>
+     </listitem>
     </itemizedlist>
-  </listitem>
-  <listitem><para>Ensure that the module respect other modules
-      functionality.</para>
+   </listitem>
+   <listitem>
+    <para>
+     Ensure that the module respect other modules functionality.
+    </para>
     <itemizedlist>
-      <listitem><para>For example, enabling a module should not open firewall
-          ports by default.</para></listitem>
+     <listitem>
+      <para>
+       For example, enabling a module should not open firewall ports by
+       default.
+      </para>
+     </listitem>
     </itemizedlist>
-  </listitem>
-</itemizedlist>
+   </listitem>
+  </itemizedlist>
 
-<example><title>Sample template for a new module review</title>
+  <example>
+   <title>Sample template for a new module review</title>
 <screen>
 ##### Reviewed points
 
@@ -350,32 +553,41 @@ $ nix-shell -p nox --run "nox-review -k pr PRNUMBER"
 
 ##### Comments
 
-</screen></example>
-</section>
-
-<section><title>Other submissions</title>
-
-<para>Other type of submissions requires different reviewing steps.</para>
-
-<para>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.</para>
-
-<para>Container system, boot system and library changes are some examples of the
-  pull requests fitting this category.</para>
-
-</section>
-
-<section><title>Merging pull-requests</title>
-
-<para>It is possible for community members that have enough knowledge and
-  experience on a special topic to contribute by merging pull requests.</para>
-
-<para>TODO: add the procedure to request merging rights.</para>
+</screen>
+  </example>
+ </section>
+ <section>
+  <title>Other submissions</title>
+
+  <para>
+   Other type of submissions requires different reviewing steps.
+  </para>
+
+  <para>
+   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.
+  </para>
+
+  <para>
+   Container system, boot system and library changes are some examples of the
+   pull requests fitting this category.
+  </para>
+ </section>
+ <section>
+  <title>Merging pull-requests</title>
+
+  <para>
+   It is possible for community members that have enough knowledge and
+   experience on a special topic to contribute by merging pull requests.
+  </para>
+
+  <para>
+   TODO: add the procedure to request merging rights.
+  </para>
 
 <!--
 The following paragraph about how to deal with unactive contributors is just a
@@ -386,10 +598,11 @@ policy.
   three months will have their commit rights revoked.</para>
 -->
 
-<para>In a case a contributor leaves definitively the Nix community, he should
-  create an issue or notify the mailing list with references of packages and
-  modules he maintains so the maintainership can be taken over by other
-  contributors.</para>
-
-</section>
+  <para>
+   In a case a contributor leaves definitively the Nix community, he should
+   create an issue or notify the mailing list with references of packages and
+   modules he maintains so the maintainership can be taken over by other
+   contributors.
+  </para>
+ </section>
 </chapter>
diff --git a/doc/shell.nix b/doc/shell.nix
index 22590142ee1..e8da2eaf16b 100644
--- a/doc/shell.nix
+++ b/doc/shell.nix
@@ -1,4 +1,5 @@
 { pkgs ? import ../. {} }:
 (import ./default.nix).overrideAttrs (x: {
   buildInputs = x.buildInputs ++ [ pkgs.xmloscopy ];
+
 })
diff --git a/doc/stdenv.xml b/doc/stdenv.xml
index 31d3d0ca3c4..78fa1d209b5 100644
--- a/doc/stdenv.xml
+++ b/doc/stdenv.xml
@@ -1,27 +1,24 @@
 <chapter xmlns="http://docbook.org/ns/docbook"
          xmlns:xlink="http://www.w3.org/1999/xlink"
          xml:id="chap-stdenv">
-
-<title>The Standard Environment</title>
-
-
-<para>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.</para>
-
-
-<section xml:id="sec-using-stdenv"><title>Using
-<literal>stdenv</literal></title>
-
-<para>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.
-
+ <title>The Standard Environment</title>
+ <para>
+  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.
+ </para>
+ <section xml:id="sec-using-stdenv">
+  <title>Using <literal>stdenv</literal></title>
+
+  <para>
+   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.
 <programlisting>
 stdenv.mkDerivation {
   name = "libfoo-1.2.3";
@@ -30,39 +27,35 @@ stdenv.mkDerivation {
     sha256 = "0x2g1jqygyr5wiwg4ma1nd7w4ydpy82z9gkcv8vh2v8dn3y58v5m";
   };
 }</programlisting>
-
-(<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 you need to do.  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:
-
+   (<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
+   you need to do. 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:
 <programlisting>
 stdenv.mkDerivation {
   name = "libfoo-1.2.3";
   ...
   buildInputs = [libbar perl ncurses];
 }</programlisting>
-
-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.)</para>
-
-<para>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:
-
+   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.)
+  </para>
+
+  <para>
+   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:
 <programlisting>
 stdenv.mkDerivation {
   name = "fnord-4.5";
@@ -75,35 +68,33 @@ stdenv.mkDerivation {
     cp foo $out/bin
   '';
 }</programlisting>
-
-(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.)</para>
-
-<para>There are many other attributes to customise the build.  These
-are listed in <xref linkend="ssec-stdenv-attributes"/>.</para>
-
-<para>While the standard environment provides a generic builder, you
-can still supply your own build script:
-
+   (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.)
+  </para>
+
+  <para>
+   There are many other attributes to customise the build. These are listed in
+   <xref linkend="ssec-stdenv-attributes"/>.
+  </para>
+
+  <para>
+   While the standard environment provides a generic builder, you can still
+   supply your own build script:
 <programlisting>
 stdenv.mkDerivation {
   name = "libfoo-1.2.3";
   ...
   builder = ./builder.sh;
 }</programlisting>
-
-where the builder can do anything it wants, but typically starts with
-
+   where the builder can do anything it wants, but typically starts with
 <programlisting>
 source $stdenv/setup
 </programlisting>
-
-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:
-
+   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:
 <programlisting>
 source $stdenv/setup
 
@@ -119,116 +110,186 @@ installPhase() {
 
 genericBuild
 </programlisting>
-
-</para>
-
-</section>
-
-
-<section xml:id="sec-tools-of-stdenv"><title>Tools provided by
-<literal>stdenv</literal></title>
-
-<para>The standard environment provides the following packages:
-
-<itemizedlist>
-
-  <listitem><para>The GNU C Compiler, configured with C and C++
-  support.</para></listitem>
-
-  <listitem><para>GNU coreutils (contains a few dozen standard Unix
-  commands).</para></listitem>
-
-  <listitem><para>GNU findutils (contains
-  <command>find</command>).</para></listitem>
-
-  <listitem><para>GNU diffutils (contains <command>diff</command>,
-  <command>cmp</command>).</para></listitem>
-
-  <listitem><para>GNU <command>sed</command>.</para></listitem>
-
-  <listitem><para>GNU <command>grep</command>.</para></listitem>
-
-  <listitem><para>GNU <command>awk</command>.</para></listitem>
-
-  <listitem><para>GNU <command>tar</command>.</para></listitem>
-
-  <listitem><para><command>gzip</command>, <command>bzip2</command>
-  and <command>xz</command>.</para></listitem>
-
-  <listitem><para>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.</para></listitem>
-
-  <listitem><para>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.</para></listitem>
-
-  <listitem><para>The <command>patch</command>
-  command.</para></listitem>
-
-</itemizedlist>
-
-</para>
-
-<para>On Linux, <literal>stdenv</literal> also includes the
-<command>patchelf</command> utility.</para>
-
-</section>
-
-
-<section xml:id="ssec-stdenv-dependencies"><title>Specifying dependencies</title>
-
-<para>
-  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.
-</para>
-<para>
-  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.
-  <footnote><para>
-    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.
-  </para></footnote>
-  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.
-  For now, the run-time/build-time distinction is just a hint for mental clarity, but in the future it perhaps could be enforced.
-</para>
-<para>
-  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. which run on the platform where the new derivation will be built.
-  <footnote><para>
-    Currently, that 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>nativeBuildDependencies</varname> dependencies would affect the <envar>PATH</envar>.
-  </para></footnote>
-  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.
-</para>
-<para>
-  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.
-</para>
-<para>
-  It is important to note dependencies are not necessary 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 each sort of dependency two integers based one how it's host and target platforms are offset from the depending derivation's platforms.
-  Those offsets are given are given below in the descriptions of each dependency list attribute.
-  Algorithmically, we traverse propagated inputs, accumulating every propagated dep's propagated deps and adjusting them to account for the "shift in perspective" described by the current dep'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 deps whose combined offsets go out-of-bounds, which can be viewed as a filter over that transitive closure removing dependencies that are blatantly absurd.
-</para>
-<para>
-  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!
-  <footnote><para>
-    The <function>findInputs</function> function, currently residing in <filename>pkgs/stdenv/generic/setup.sh</filename>, implements the propagation logic.
-  </para></footnote>
-  They're confusing in very different ways so...hopefully if something doesn't make sense in one presentation, it does in the other!
-  <programlisting>
+  </para>
+ </section>
+ <section xml:id="sec-tools-of-stdenv">
+  <title>Tools provided by <literal>stdenv</literal></title>
+
+  <para>
+   The standard environment provides the following packages:
+   <itemizedlist>
+    <listitem>
+     <para>
+      The GNU C Compiler, configured with C and C++ support.
+     </para>
+    </listitem>
+    <listitem>
+     <para>
+      GNU coreutils (contains a few dozen standard Unix commands).
+     </para>
+    </listitem>
+    <listitem>
+     <para>
+      GNU findutils (contains <command>find</command>).
+     </para>
+    </listitem>
+    <listitem>
+     <para>
+      GNU diffutils (contains <command>diff</command>, <command>cmp</command>).
+     </para>
+    </listitem>
+    <listitem>
+     <para>
+      GNU <command>sed</command>.
+     </para>
+    </listitem>
+    <listitem>
+     <para>
+      GNU <command>grep</command>.
+     </para>
+    </listitem>
+    <listitem>
+     <para>
+      GNU <command>awk</command>.
+     </para>
+    </listitem>
+    <listitem>
+     <para>
+      GNU <command>tar</command>.
+     </para>
+    </listitem>
+    <listitem>
+     <para>
+      <command>gzip</command>, <command>bzip2</command> and
+      <command>xz</command>.
+     </para>
+    </listitem>
+    <listitem>
+     <para>
+      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.
+     </para>
+    </listitem>
+    <listitem>
+     <para>
+      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.
+     </para>
+    </listitem>
+    <listitem>
+     <para>
+      The <command>patch</command> command.
+     </para>
+    </listitem>
+   </itemizedlist>
+  </para>
+
+  <para>
+   On Linux, <literal>stdenv</literal> also includes the
+   <command>patchelf</command> utility.
+  </para>
+ </section>
+ <section xml:id="ssec-stdenv-dependencies">
+  <title>Specifying dependencies</title>
+
+  <para>
+   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.
+  </para>
+
+  <para>
+   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.
+   <footnote>
+    <para>
+     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.
+    </para>
+   </footnote>
+   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. For now, the run-time/build-time
+   distinction is just a hint for mental clarity, but in the future it perhaps
+   could be enforced.
+  </para>
+
+  <para>
+   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. which run on the platform where the new derivation
+   will be built.
+   <footnote>
+    <para>
+     Currently, that 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>nativeBuildDependencies</varname> dependencies would affect the
+     <envar>PATH</envar>.
+    </para>
+   </footnote>
+   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.
+  </para>
+
+  <para>
+   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.
+  </para>
+
+  <para>
+   It is important to note dependencies are not necessary 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 each sort of dependency
+   two integers based one how it's host and target platforms are offset from
+   the depending derivation's platforms. Those offsets are given are given
+   below in the descriptions of each dependency list attribute.
+   Algorithmically, we traverse propagated inputs, accumulating every
+   propagated dep's propagated deps and adjusting them to account for the
+   "shift in perspective" described by the current dep'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 deps whose combined offsets go out-of-bounds, which
+   can be viewed as a filter over that transitive closure removing dependencies
+   that are blatantly absurd.
+  </para>
+
+  <para>
+   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!
+   <footnote>
+    <para>
+     The <function>findInputs</function> function, currently residing in
+     <filename>pkgs/stdenv/generic/setup.sh</filename>, implements the
+     propagation logic.
+    </para>
+   </footnote>
+   They're confusing in very different ways so...hopefully if something doesn't
+   make sense in one presentation, it does in the other!
+<programlisting>
 let mapOffset(h, t, i) = i + (if i &lt;= 0 then h else t - 1)
 
 propagated-dep(h0, t0, A, B)
@@ -239,7 +300,7 @@ h0 + t1 in {-1, 0, 1}
 propagated-dep(mapOffset(h0, t0, h1),
                mapOffset(h0, t0, t1),
                A, C)</programlisting>
-  <programlisting>
+<programlisting>
 let mapOffset(h, t, i) = i + (if i &lt;= 0 then h else t - 1)
 
 dep(h0, _, A, B)
@@ -250,1153 +311,1467 @@ h0 + t1 in {-1, 0, -1}
 propagated-dep(mapOffset(h0, t0, h1),
                mapOffset(h0, t0, t1),
                A, C)</programlisting>
-  <programlisting>
+<programlisting>
 propagated-dep(h, t, A, B)
 -------------------------------------- Propagated deps count as deps
 dep(h, t, A, B)</programlisting>
-  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:
-  <programlisting>
+   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:
+<programlisting>
 let f(h, t, i) = i + (if i &lt;= 0 then h else t - 1)
 let f(h, h + 1, i) = i + (if i &lt;= 0 then h else (h + 1) - 1)
 let f(h, h + 1, i) = i + (if i &lt;= 0 then h else h)
 let f(h, h + 1, i) = i + h
   </programlisting>
-  This is where the "sum-like" comes from above:
-  We can just sum all the host offset to get the host offset of the transitive dependency.
-  The target offset is the transitive dep 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.
-</para>
-<para>
-  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 dep 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.
-</para>
-<para>
-Overall, the unifying theme here is that propagation shouldn't be introducing transitive dependencies involving platforms the needing package is unaware of.
-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.
-</para>
-
-<variablelist>
-  <title>Variables specifying dependencies</title>
-
+   This is where the "sum-like" comes from above: We can just sum all the host
+   offset to get the host offset of the transitive dependency. The target
+   offset is the transitive dep 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.
+  </para>
+
+  <para>
+   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 dep 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.
+  </para>
+
+  <para>
+   Overall, the unifying theme here is that propagation shouldn't be
+   introducing transitive dependencies involving platforms the needing package
+   is unaware of. 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.
+  </para>
+
+  <variablelist>
+   <title>Variables specifying dependencies</title>
    <varlistentry>
-     <term><varname>depsBuildBuild</varname></term>
-     <listitem>
-       <para>
-         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.
-         They are programs/libraries used at build time that furthermore produce programs/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 for 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.
-       </para>
-       <para>
-         Since these packages are able to be run at build time, that 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.
-       </para>
-     </listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>nativeBuildInputs</varname></term>
+    <term><varname>depsBuildBuild</varname>
+    </term>
     <listitem>
-      <para>
-        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.
-        They are programs/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 would be called <varname>depsBuildHost</varname> but for historical continuity.
-      </para>
-      <para>
-         Since these packages are able to be run at build time, that are added to the <envar>PATH</envar>, as described above.
-         But since these packages only are 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.
-       </para>
+     <para>
+      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.
+      They are programs/libraries used at build time that furthermore produce
+      programs/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 for 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.
+     </para>
+     <para>
+      Since these packages are able to be run at build time, that 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.
+     </para>
     </listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>depsBuildTarget</varname></term>
+   </varlistentry>
+   <varlistentry>
+    <term><varname>nativeBuildInputs</varname>
+    </term>
     <listitem>
-      <para>
-        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.
-        They are programs used at build time that produce code to run at run with code produced by the depending package.
-        Most commonly, these would tools used to build the runtime or standard library 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 the dependency is unconditional.
-      </para>
-      <para>
-        This is a somewhat confusing dependency to wrap ones head around, and for good reason.
-        As the only one 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 it's use-case go hand in hand and are both considered poor form:
-        try not to need this sort dependency, and try not avoid building standard libraries / 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.
+     <para>
+      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. They are programs/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 would be called <varname>depsBuildHost</varname> but for historical
+      continuity.
      </para>
      <para>
-       Since these packages are able to be run at build time, that are added to the <envar>PATH</envar>, as described above.
-       But since these packages only are 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.
+      Since these packages are able to be run at build time, that are added to
+      the <envar>PATH</envar>, as described above. But since these packages
+      only are 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.
      </para>
     </listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>depsHostHost</varname></term>
-    <listitem><para>
-      A list of dependencies whose host and target platforms match the new derivation's host platform.
-      This means a both <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, that would usually be tools used by compilers for metaprogramming/macro systems, or libraries used by the macros/metaprogramming code itself.
-      It's always preferable to use a <varname>depsBuildBuild</varname> dependency in the derivation being built than a <varname>depsHostHost</varname> on the tool doing the building for this purpose.
-    </para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>buildInputs</varname></term>
+   </varlistentry>
+   <varlistentry>
+    <term><varname>depsBuildTarget</varname>
+    </term>
     <listitem>
-      <para>
-        A list of dependencies whose host platform and target platform match the new derivation's.
-        This means a <literal>0</literal> host offset and <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>.
-      </para>
-      <para>
-        These often are programs/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.
-      </para>
+     <para>
+      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. They are programs used
+      at build time that produce code to run at run with code produced by the
+      depending package. Most commonly, these would tools used to build the
+      runtime or standard library 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 the dependency is unconditional.
+     </para>
+     <para>
+      This is a somewhat confusing dependency to wrap ones head around, and for
+      good reason. As the only one 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 it's use-case
+      go hand in hand and are both considered poor form: try not to need this
+      sort dependency, and try not avoid building standard libraries / 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.
+     </para>
+     <para>
+      Since these packages are able to be run at build time, that are added to
+      the <envar>PATH</envar>, as described above. But since these packages
+      only are 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.
+     </para>
     </listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>depsTargetTarget</varname></term>
-    <listitem><para>
-      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.
-    </para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>depsBuildBuildPropagated</varname></term>
-    <listitem><para>
-      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].
-    </para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>propagatedNativeBuildInputs</varname></term>
-    <listitem><para>
-      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.
-    </para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>depsBuildTargetPropagated</varname></term>
-    <listitem><para>
-      The propagated equivalent of <varname>depsBuildTarget</varname>.
-      This is prefixed for the same reason of alerting potential users.
-    </para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>depsHostHostPropagated</varname></term>
-    <listitem><para>
-      The propagated equivalent of <varname>depsHostHost</varname>.
-    </para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>propagatedBuildInputs</varname></term>
-    <listitem><para>
-      The propagated equivalent of <varname>buildInputs</varname>.
-      This would be called <varname>depsHostTargetPropagated</varname> but for historical continuity.
-    </para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>depsTargetTarget</varname></term>
-    <listitem><para>
-      The propagated equivalent of <varname>depsTargetTarget</varname>.
-      This is prefixed for the same reason of alerting potential users.
-    </para></listitem>
-  </varlistentry>
-
-</variablelist>
-
-</section>
-
-
-<section xml:id="ssec-stdenv-attributes"><title>Attributes</title>
-
-<variablelist>
-  <title>Variables affecting <literal>stdenv</literal>
-  initialisation</title>
-
-  <varlistentry>
-    <term><varname>NIX_DEBUG</varname></term>
-    <listitem><para>
-      A natural number indicating how much information to log.
-      If set to 1 or higher, <literal>stdenv</literal> will print moderate debug 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.
-    </para></listitem>
-  </varlistentry>
-
-</variablelist>
-
-<variablelist>
-  <title>Variables affecting build properties</title>
-
-  <varlistentry>
-    <term><varname>enableParallelBuilding</varname></term>
+   </varlistentry>
+   <varlistentry>
+    <term><varname>depsHostHost</varname>
+    </term>
     <listitem>
-      <para>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.</para>
-
-      <para>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>.</para>
+     <para>
+      A list of dependencies whose host and target platforms match the new
+      derivation's host platform. This means a both <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, that would usually be tools used by
+      compilers for metaprogramming/macro systems, or libraries used by the
+      macros/metaprogramming code itself. It's always preferable to use a
+      <varname>depsBuildBuild</varname> dependency in the derivation being
+      built than a <varname>depsHostHost</varname> on the tool doing the
+      building for this purpose.
+     </para>
     </listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>preferLocalBuild</varname></term>
-    <listitem><para>If set, specifies that the package is so lightweight
-    in terms of build operations (e.g. write a text file from a Nix string
-    to the store) that there's no need to look for it in binary caches --
-    it's faster to just build it locally. It also tells Hydra and other
-    facilities that this package doesn't need to be exported in binary
-    caches (noone would use it, after all).</para></listitem>
-  </varlistentry>
-
-</variablelist>
-
-<variablelist>
-  <title>Special variables</title>
-
-  <varlistentry>
-    <term><varname>passthru</varname></term>
-    <listitem><para>This is an attribute set which can be filled with arbitrary
-    values. For example:
-
-<programlisting>
-passthru = {
-  foo = "bar";
-  baz = {
-    value1 = 4;
-    value2 = 5;
-  };
-}
-</programlisting>
-
-</para>
-
-    <para>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.</para></listitem>
-  </varlistentry>
-
-</variablelist>
-
-</section>
-
-
-<section xml:id="sec-stdenv-phases"><title>Phases</title>
-
-<para>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.</para>
-
-<para>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.
-</para>
-
-
-<section xml:id="ssec-controlling-phases"><title>Controlling
-phases</title>
-
-<para>There are a number of variables that control what phases are
-executed and in what order:
-
-<variablelist>
-  <title>Variables affecting phase control</title>
-
-  <varlistentry>
-    <term><varname>phases</varname></term>
+   </varlistentry>
+   <varlistentry>
+    <term><varname>buildInputs</varname>
+    </term>
     <listitem>
-      <para>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 $preDistPhases
-      distPhase $postPhases</literal>.
-      </para>
-
-      <para>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.</para>
+     <para>
+      A list of dependencies whose host platform and target platform match the
+      new derivation's. This means a <literal>0</literal> host offset and
+      <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>.
+     </para>
+     <para>
+      These often are programs/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.
+     </para>
     </listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>prePhases</varname></term>
+   </varlistentry>
+   <varlistentry>
+    <term><varname>depsTargetTarget</varname>
+    </term>
     <listitem>
-      <para>Additional phases executed before any of the default phases.</para>
+     <para>
+      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.
+     </para>
     </listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>preConfigurePhases</varname></term>
+   </varlistentry>
+   <varlistentry>
+    <term><varname>depsBuildBuildPropagated</varname>
+    </term>
     <listitem>
-      <para>Additional phases executed just before the configure phase.</para>
+     <para>
+      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].
+     </para>
     </listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>preBuildPhases</varname></term>
+   </varlistentry>
+   <varlistentry>
+    <term><varname>propagatedNativeBuildInputs</varname>
+    </term>
     <listitem>
-      <para>Additional phases executed just before the build phase.</para>
+     <para>
+      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.
+     </para>
     </listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>preInstallPhases</varname></term>
+   </varlistentry>
+   <varlistentry>
+    <term><varname>depsBuildTargetPropagated</varname>
+    </term>
     <listitem>
-      <para>Additional phases executed just before the install phase.</para>
+     <para>
+      The propagated equivalent of <varname>depsBuildTarget</varname>. This is
+      prefixed for the same reason of alerting potential users.
+     </para>
     </listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>preFixupPhases</varname></term>
+   </varlistentry>
+   <varlistentry>
+    <term><varname>depsHostHostPropagated</varname>
+    </term>
+    <listitem>
+     <para>
+      The propagated equivalent of <varname>depsHostHost</varname>.
+     </para>
+    </listitem>
+   </varlistentry>
+   <varlistentry>
+    <term><varname>propagatedBuildInputs</varname>
+    </term>
     <listitem>
-      <para>Additional phases executed just before the fixup phase.</para>
+     <para>
+      The propagated equivalent of <varname>buildInputs</varname>. This would
+      be called <varname>depsHostTargetPropagated</varname> but for historical
+      continuity.
+     </para>
     </listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>preDistPhases</varname></term>
+   </varlistentry>
+   <varlistentry>
+    <term><varname>depsTargetTarget</varname>
+    </term>
+    <listitem>
+     <para>
+      The propagated equivalent of <varname>depsTargetTarget</varname>. This is
+      prefixed for the same reason of alerting potential users.
+     </para>
+    </listitem>
+   </varlistentry>
+  </variablelist>
+ </section>
+ <section xml:id="ssec-stdenv-attributes">
+  <title>Attributes</title>
+
+  <variablelist>
+   <title>Variables affecting <literal>stdenv</literal> initialisation</title>
+   <varlistentry>
+    <term><varname>NIX_DEBUG</varname>
+    </term>
     <listitem>
-      <para>Additional phases executed just before the distribution phase.</para>
+     <para>
+      A natural number indicating how much information to log. If set to 1 or
+      higher, <literal>stdenv</literal> will print moderate debug 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.
+     </para>
     </listitem>
-  </varlistentry>
+   </varlistentry>
+  </variablelist>
 
-  <varlistentry>
-    <term><varname>postPhases</varname></term>
+  <variablelist>
+   <title>Variables affecting build properties</title>
+   <varlistentry>
+    <term><varname>enableParallelBuilding</varname>
+    </term>
+    <listitem>
+     <para>
+      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.
+     </para>
+     <para>
+      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>.
+     </para>
+    </listitem>
+   </varlistentry>
+   <varlistentry>
+    <term><varname>preferLocalBuild</varname>
+    </term>
     <listitem>
-      <para>Additional phases executed after any of the default
-      phases.</para>
+     <para>
+      If set, specifies that the package is so lightweight in terms of build
+      operations (e.g. write a text file from a Nix string to the store) that
+      there's no need to look for it in binary caches -- it's faster to just
+      build it locally. It also tells Hydra and other facilities that this
+      package doesn't need to be exported in binary caches (noone would use it,
+      after all).
+     </para>
     </listitem>
-  </varlistentry>
-
-</variablelist>
-
-</para>
-
-</section>
-
-
-<section xml:id="ssec-unpack-phase"><title>The unpack phase</title>
-
-<para>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:
-
-<variablelist>
-
-  <varlistentry>
-    <term>Tar files</term>
-    <listitem><para>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> or
-    <filename>.tbz2</filename>) or <command>xz</command>
-    (<filename>.tar.xz</filename> or
-    <filename>.tar.lzma</filename>).</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term>Zip files</term>
-    <listitem><para>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>buildInputs</varname> yourself.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term>Directories in the Nix store</term>
-    <listitem><para>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>.</para></listitem>
-  </varlistentry>
-
-</variablelist>
-
-Additional file types can be supported by setting the
-<varname>unpackCmd</varname> variable (see below).</para>
-
-<para></para>
-
-<variablelist>
-  <title>Variables controlling the unpack phase</title>
-
-  <varlistentry>
-    <term><varname>srcs</varname> / <varname>src</varname></term>
-    <listitem><para>The list of source files or directories to be
-    unpacked or copied.  One of these must be set.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>sourceRoot</varname></term>
-    <listitem><para>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.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>setSourceRoot</varname></term>
-    <listitem><para>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>.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>preUnpack</varname></term>
-    <listitem><para>Hook executed at the start of the unpack
-    phase.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>postUnpack</varname></term>
-    <listitem><para>Hook executed at the end of the unpack
-    phase.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>dontMakeSourcesWritable</varname></term>
-    <listitem><para>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.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>unpackCmd</varname></term>
-    <listitem><para>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.</para></listitem>
-  </varlistentry>
-
-</variablelist>
-
-</section>
-
-
-<section xml:id="ssec-patch-phase"><title>The patch phase</title>
-
-<para>The patch phase applies the list of patches defined in the
-<varname>patches</varname> variable.</para>
-
-<variablelist>
-  <title>Variables controlling the patch phase</title>
-
-  <varlistentry>
-    <term><varname>patches</varname></term>
-    <listitem><para>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>).</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>patchFlags</varname></term>
-    <listitem><para>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.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>prePatch</varname></term>
-    <listitem><para>Hook executed at the start of the patch
-    phase.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>postPatch</varname></term>
-    <listitem><para>Hook executed at the end of the patch
-    phase.</para></listitem>
-  </varlistentry>
-
-</variablelist>
-
-</section>
-
-
-<section xml:id="ssec-configure-phase"><title>The configure phase</title>
-
-<para>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.</para>
-
-<variablelist>
-  <title>Variables controlling the configure phase</title>
-
-  <varlistentry>
-    <term><varname>configureScript</varname></term>
-    <listitem><para>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>).</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>configureFlags</varname></term>
-    <listitem><para>A list of strings passed as additional arguments to the
-    configure script.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>configureFlagsArray</varname></term>
-    <listitem><para>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.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>dontAddPrefix</varname></term>
-    <listitem><para>By default, the flag
-    <literal>--prefix=$prefix</literal> is added to the configure
-    flags.  If this is undesirable, set this variable to
-    true.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>prefix</varname></term>
-    <listitem><para>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>.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>dontAddDisableDepTrack</varname></term>
-    <listitem><para>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.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>dontFixLibtool</varname></term>
-    <listitem><para>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<footnote><para>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.</para></footnote>.  If this is undesirable, set this
-    variable to true.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>dontDisableStatic</varname></term>
-    <listitem><para>By default, when the configure script has
-    <option>--enable-static</option>, the option
-    <option>--disable-static</option> is added to the configure flags.</para>
-    <para>If this is undesirable, set this variable to
-    true.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>configurePlatforms</varname></term>
-    <listitem><para>
-      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 should use this to also pass the target platform, for example.
-      <footnote><para>Eventually these will be passed when in native builds too, to improve determinism: build-time guessing, as is done today, is a risk of impurity.</para></footnote>
-    </para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>preConfigure</varname></term>
-    <listitem><para>Hook executed at the start of the configure
-    phase.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>postConfigure</varname></term>
-    <listitem><para>Hook executed at the end of the configure
-    phase.</para></listitem>
-  </varlistentry>
-
-</variablelist>
-
-
-</section>
-
-
-<section xml:id="build-phase"><title>The build phase</title>
-
-<para>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.</para>
-
-<variablelist>
-  <title>Variables controlling the build phase</title>
-
-  <varlistentry>
-    <term><varname>dontBuild</varname></term>
-    <listitem><para>Set to true to skip the build phase.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>makefile</varname></term>
-    <listitem><para>The file name of the Makefile.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>makeFlags</varname></term>
-    <listitem><para>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).
+   </varlistentry>
+  </variablelist>
 
+  <variablelist>
+   <title>Special variables</title>
+   <varlistentry>
+    <term><varname>passthru</varname>
+    </term>
+    <listitem>
+     <para>
+      This is an attribute set which can be filled with arbitrary values. For
+      example:
+<programlisting>
+passthru = {
+  foo = "bar";
+  baz = {
+    value1 = 4;
+    value2 = 5;
+  };
+}
+</programlisting>
+     </para>
+     <para>
+      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.
+     </para>
+    </listitem>
+   </varlistentry>
+  </variablelist>
+ </section>
+ <section xml:id="sec-stdenv-phases">
+  <title>Phases</title>
+
+  <para>
+   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.
+  </para>
+
+  <para>
+   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.
+  </para>
+
+  <section xml:id="ssec-controlling-phases">
+   <title>Controlling phases</title>
+
+   <para>
+    There are a number of variables that control what phases are executed and
+    in what order:
+    <variablelist>
+     <title>Variables affecting phase control</title>
+     <varlistentry>
+      <term><varname>phases</varname>
+      </term>
+      <listitem>
+       <para>
+        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 $preDistPhases distPhase $postPhases</literal>.
+       </para>
+       <para>
+        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.
+       </para>
+      </listitem>
+     </varlistentry>
+     <varlistentry>
+      <term><varname>prePhases</varname>
+      </term>
+      <listitem>
+       <para>
+        Additional phases executed before any of the default phases.
+       </para>
+      </listitem>
+     </varlistentry>
+     <varlistentry>
+      <term><varname>preConfigurePhases</varname>
+      </term>
+      <listitem>
+       <para>
+        Additional phases executed just before the configure phase.
+       </para>
+      </listitem>
+     </varlistentry>
+     <varlistentry>
+      <term><varname>preBuildPhases</varname>
+      </term>
+      <listitem>
+       <para>
+        Additional phases executed just before the build phase.
+       </para>
+      </listitem>
+     </varlistentry>
+     <varlistentry>
+      <term><varname>preInstallPhases</varname>
+      </term>
+      <listitem>
+       <para>
+        Additional phases executed just before the install phase.
+       </para>
+      </listitem>
+     </varlistentry>
+     <varlistentry>
+      <term><varname>preFixupPhases</varname>
+      </term>
+      <listitem>
+       <para>
+        Additional phases executed just before the fixup phase.
+       </para>
+      </listitem>
+     </varlistentry>
+     <varlistentry>
+      <term><varname>preDistPhases</varname>
+      </term>
+      <listitem>
+       <para>
+        Additional phases executed just before the distribution phase.
+       </para>
+      </listitem>
+     </varlistentry>
+     <varlistentry>
+      <term><varname>postPhases</varname>
+      </term>
+      <listitem>
+       <para>
+        Additional phases executed after any of the default phases.
+       </para>
+      </listitem>
+     </varlistentry>
+    </variablelist>
+   </para>
+  </section>
+
+  <section xml:id="ssec-unpack-phase">
+   <title>The unpack phase</title>
+
+   <para>
+    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:
+    <variablelist>
+     <varlistentry>
+      <term>Tar files</term>
+      <listitem>
+       <para>
+        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> or <filename>.tbz2</filename>) or
+        <command>xz</command> (<filename>.tar.xz</filename> or
+        <filename>.tar.lzma</filename>).
+       </para>
+      </listitem>
+     </varlistentry>
+     <varlistentry>
+      <term>Zip files</term>
+      <listitem>
+       <para>
+        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>buildInputs</varname> yourself.
+       </para>
+      </listitem>
+     </varlistentry>
+     <varlistentry>
+      <term>Directories in the Nix store</term>
+      <listitem>
+       <para>
+        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>.
+       </para>
+      </listitem>
+     </varlistentry>
+    </variablelist>
+    Additional file types can be supported by setting the
+    <varname>unpackCmd</varname> variable (see below).
+   </para>
+
+   <para></para>
+
+   <variablelist>
+    <title>Variables controlling the unpack phase</title>
+    <varlistentry>
+     <term><varname>srcs</varname> / <varname>src</varname>
+     </term>
+     <listitem>
+      <para>
+       The list of source files or directories to be unpacked or copied. One of
+       these must be set.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>sourceRoot</varname>
+     </term>
+     <listitem>
+      <para>
+       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.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>setSourceRoot</varname>
+     </term>
+     <listitem>
+      <para>
+       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>.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>preUnpack</varname>
+     </term>
+     <listitem>
+      <para>
+       Hook executed at the start of the unpack phase.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>postUnpack</varname>
+     </term>
+     <listitem>
+      <para>
+       Hook executed at the end of the unpack phase.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>dontMakeSourcesWritable</varname>
+     </term>
+     <listitem>
+      <para>
+       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.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>unpackCmd</varname>
+     </term>
+     <listitem>
+      <para>
+       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.
+      </para>
+     </listitem>
+    </varlistentry>
+   </variablelist>
+  </section>
+
+  <section xml:id="ssec-patch-phase">
+   <title>The patch phase</title>
+
+   <para>
+    The patch phase applies the list of patches defined in the
+    <varname>patches</varname> variable.
+   </para>
+
+   <variablelist>
+    <title>Variables controlling the patch phase</title>
+    <varlistentry>
+     <term><varname>patches</varname>
+     </term>
+     <listitem>
+      <para>
+       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>).
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>patchFlags</varname>
+     </term>
+     <listitem>
+      <para>
+       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.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>prePatch</varname>
+     </term>
+     <listitem>
+      <para>
+       Hook executed at the start of the patch phase.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>postPatch</varname>
+     </term>
+     <listitem>
+      <para>
+       Hook executed at the end of the patch phase.
+      </para>
+     </listitem>
+    </varlistentry>
+   </variablelist>
+  </section>
+
+  <section xml:id="ssec-configure-phase">
+   <title>The configure phase</title>
+
+   <para>
+    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.
+   </para>
+
+   <variablelist>
+    <title>Variables controlling the configure phase</title>
+    <varlistentry>
+     <term><varname>configureScript</varname>
+     </term>
+     <listitem>
+      <para>
+       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>).
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>configureFlags</varname>
+     </term>
+     <listitem>
+      <para>
+       A list of strings passed as additional arguments to the configure
+       script.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>configureFlagsArray</varname>
+     </term>
+     <listitem>
+      <para>
+       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.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>dontAddPrefix</varname>
+     </term>
+     <listitem>
+      <para>
+       By default, the flag <literal>--prefix=$prefix</literal> is added to the
+       configure flags. If this is undesirable, set this variable to true.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>prefix</varname>
+     </term>
+     <listitem>
+      <para>
+       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>.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>dontAddDisableDepTrack</varname>
+     </term>
+     <listitem>
+      <para>
+       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.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>dontFixLibtool</varname>
+     </term>
+     <listitem>
+      <para>
+       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
+       <footnote>
+        <para>
+         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.
+        </para>
+       </footnote>
+       . If this is undesirable, set this variable to true.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>dontDisableStatic</varname>
+     </term>
+     <listitem>
+      <para>
+       By default, when the configure script has
+       <option>--enable-static</option>, the option
+       <option>--disable-static</option> is added to the configure flags.
+      </para>
+      <para>
+       If this is undesirable, set this variable to true.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>configurePlatforms</varname>
+     </term>
+     <listitem>
+      <para>
+       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 should use this to also pass the target
+       platform, for example.
+       <footnote>
+        <para>
+         Eventually these will be passed when in native builds too, to improve
+         determinism: build-time guessing, as is done today, is a risk of
+         impurity.
+        </para>
+       </footnote>
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>preConfigure</varname>
+     </term>
+     <listitem>
+      <para>
+       Hook executed at the start of the configure phase.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>postConfigure</varname>
+     </term>
+     <listitem>
+      <para>
+       Hook executed at the end of the configure phase.
+      </para>
+     </listitem>
+    </varlistentry>
+   </variablelist>
+  </section>
+
+  <section xml:id="build-phase">
+   <title>The build phase</title>
+
+   <para>
+    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.
+   </para>
+
+   <variablelist>
+    <title>Variables controlling the build phase</title>
+    <varlistentry>
+     <term><varname>dontBuild</varname>
+     </term>
+     <listitem>
+      <para>
+       Set to true to skip the build phase.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>makefile</varname>
+     </term>
+     <listitem>
+      <para>
+       The file name of the Makefile.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+      <term><varname>checkInputs</varname>
+      </term>
+      <listitem><para>
+        A list of dependencies used by the phase. This gets included in
+        <varname>buildInputs</varname> when <varname>doCheck</varname> is set.
+      </para></listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>makeFlags</varname>
+     </term>
+     <listitem>
+      <para>
+       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).
 <programlisting>
 makeFlags = [ "PREFIX=$(out)" ];
 </programlisting>
-
-    <note><para>The flags are quoted in bash, but environment variables can
-    be specified by using the make syntax.</para></note></para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>makeFlagsArray</varname></term>
-    <listitem><para>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.
-
+       <note>
+        <para>
+         The flags are quoted in bash, but environment variables can be
+         specified by using the make syntax.
+        </para>
+       </note>
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>makeFlagsArray</varname>
+     </term>
+     <listitem>
+      <para>
+       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.
 <programlisting>
 makeFlagsArray=(CFLAGS="-O0 -g" LDFLAGS="-lfoo -lbar")
 </programlisting>
-
-    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.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>buildFlags</varname> / <varname>buildFlagsArray</varname></term>
-    <listitem><para>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.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>preBuild</varname></term>
-    <listitem><para>Hook executed at the start of the build
-    phase.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>postBuild</varname></term>
-    <listitem><para>Hook executed at the end of the build
-    phase.</para></listitem>
-  </varlistentry>
-
-</variablelist>
-
-
-<para>
-You can set flags for <command>make</command> through the
-<varname>makeFlags</varname> variable.</para>
-
-<para>Before and after running <command>make</command>, the hooks
-<varname>preBuild</varname> and <varname>postBuild</varname> are
-called, respectively.</para>
-
-</section>
-
-
-<section xml:id="ssec-check-phase"><title>The check phase</title>
-
-<para>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.</para>
-
-<variablelist>
-  <title>Variables controlling the check phase</title>
-
-  <varlistentry>
-    <term><varname>doCheck</varname></term>
-    <listitem><para>
-      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 <programlisting>doCheck = true;</programlisting> 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.
-    </para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>checkInputs</varname></term>
-    <listitem><para>
-      A list of dependencies used by the phase. This gets included in <varname>buildInputs</varname> when <varname>doCheck</varname> is set.
-    </para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>makeFlags</varname> /
+       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.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>buildFlags</varname> / <varname>buildFlagsArray</varname>
+     </term>
+     <listitem>
+      <para>
+       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.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>preBuild</varname>
+     </term>
+     <listitem>
+      <para>
+       Hook executed at the start of the build phase.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>postBuild</varname>
+     </term>
+     <listitem>
+      <para>
+       Hook executed at the end of the build phase.
+      </para>
+     </listitem>
+    </varlistentry>
+   </variablelist>
+
+   <para>
+    You can set flags for <command>make</command> through the
+    <varname>makeFlags</varname> variable.
+   </para>
+
+   <para>
+    Before and after running <command>make</command>, the hooks
+    <varname>preBuild</varname> and <varname>postBuild</varname> are called,
+    respectively.
+   </para>
+  </section>
+
+  <section xml:id="ssec-check-phase">
+   <title>The check phase</title>
+
+   <para>
+    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.
+   </para>
+
+   <variablelist>
+    <title>Variables controlling the check phase</title>
+    <varlistentry>
+     <term><varname>doCheck</varname>
+     </term>
+     <listitem>
+      <para>
+       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
+<programlisting>doCheck = true;</programlisting>
+       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.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>makeFlags</varname> /
     <varname>makeFlagsArray</varname> /
-    <varname>makefile</varname></term>
-    <listitem><para>See the build phase for details.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>checkTarget</varname></term>
-    <listitem><para>The make target that runs the tests.  Defaults to
-    <literal>check</literal>.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>checkFlags</varname> / <varname>checkFlagsArray</varname></term>
-    <listitem><para>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.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>preCheck</varname></term>
-    <listitem><para>Hook executed at the start of the check
-    phase.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>postCheck</varname></term>
-    <listitem><para>Hook executed at the end of the check
-    phase.</para></listitem>
-  </varlistentry>
-
-</variablelist>
-
-
-</section>
-
-
-<section xml:id="ssec-install-phase"><title>The install phase</title>
-
-<para>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>.</para>
-
-<variablelist>
-  <title>Variables controlling the install phase</title>
-
-  <varlistentry>
-    <term><varname>makeFlags</varname> /
+    <varname>makefile</varname>
+     </term>
+     <listitem>
+      <para>
+       See the build phase for details.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>checkTarget</varname>
+     </term>
+     <listitem>
+      <para>
+       The make target that runs the tests. Defaults to
+       <literal>check</literal>.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>checkFlags</varname> / <varname>checkFlagsArray</varname>
+     </term>
+     <listitem>
+      <para>
+       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.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>preCheck</varname>
+     </term>
+     <listitem>
+      <para>
+       Hook executed at the start of the check phase.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>postCheck</varname>
+     </term>
+     <listitem>
+      <para>
+       Hook executed at the end of the check phase.
+      </para>
+     </listitem>
+    </varlistentry>
+   </variablelist>
+  </section>
+
+  <section xml:id="ssec-install-phase">
+   <title>The install phase</title>
+
+   <para>
+    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>.
+   </para>
+
+   <variablelist>
+    <title>Variables controlling the install phase</title>
+    <varlistentry>
+     <term><varname>makeFlags</varname> /
     <varname>makeFlagsArray</varname> /
-    <varname>makefile</varname></term>
-    <listitem><para>See the build phase for details.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>installTargets</varname></term>
-    <listitem><para>The make targets that perform the installation.
-    Defaults to <literal>install</literal>.  Example:
-
+    <varname>makefile</varname>
+     </term>
+     <listitem>
+      <para>
+       See the build phase for details.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>installTargets</varname>
+     </term>
+     <listitem>
+      <para>
+       The make targets that perform the installation. Defaults to
+       <literal>install</literal>. Example:
 <programlisting>
 installTargets = "install-bin install-doc";</programlisting>
-
-    </para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>installFlags</varname> / <varname>installFlagsArray</varname></term>
-    <listitem><para>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.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>preInstall</varname></term>
-    <listitem><para>Hook executed at the start of the install
-    phase.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>postInstall</varname></term>
-    <listitem><para>Hook executed at the end of the install
-    phase.</para></listitem>
-  </varlistentry>
-
-</variablelist>
-
-
-</section>
-
-
-<section xml:id="ssec-fixup-phase"><title>The fixup phase</title>
-
-<para>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:
-
-<itemizedlist>
-
-  <listitem><para>It moves the <filename>man/</filename>,
-  <filename>doc/</filename> and <filename>info/</filename>
-  subdirectories of <envar>$out</envar> to
-  <filename>share/</filename>.</para></listitem>
-
-  <listitem><para>It strips libraries and executables of debug
-  information.</para></listitem>
-
-  <listitem><para>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.</para></listitem>
-
-  <listitem><para>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>.</para></listitem>
-
-</itemizedlist>
-
-</para>
-
-<variablelist>
-  <title>Variables controlling the fixup phase</title>
-
-  <varlistentry>
-    <term><varname>dontStrip</varname></term>
-    <listitem><para>If set, libraries and executables are not
-    stripped.  By default, they are.</para></listitem>
-  </varlistentry>
-  <varlistentry>
-    <term><varname>dontStripHost</varname></term>
-    <listitem><para>
-      Like <varname>dontStripHost</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.
-    </para></listitem>
-  </varlistentry>
-  <varlistentry>
-    <term><varname>dontStripTarget</varname></term>
-    <listitem><para>
-      Like <varname>dontStripHost</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.
-    </para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>dontMoveSbin</varname></term>
-    <listitem><para>If set, files in <filename>$out/sbin</filename> are not moved
-    to <filename>$out/bin</filename>. By default, they are.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>stripAllList</varname></term>
-    <listitem><para>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.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>stripAllFlags</varname></term>
-    <listitem><para>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>).</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>stripDebugList</varname></term>
-    <listitem><para>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>.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>stripDebugFlags</varname></term>
-    <listitem><para>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>).</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>dontPatchELF</varname></term>
-    <listitem><para>If set, the <command>patchelf</command> command is
-    not used to remove unnecessary <literal>RPATH</literal> entries.
-    Only applies to Linux.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>dontPatchShebangs</varname></term>
-    <listitem><para>If set, scripts starting with
-    <literal>#!</literal> do not have their interpreter paths
-    rewritten to paths in the Nix store.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>forceShare</varname></term>
-    <listitem><para>The list of directories that must be moved from
-    <filename>$out</filename> to <filename>$out/share</filename>.
-    Defaults to <literal>man doc info</literal>.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>setupHook</varname></term>
-    <listitem><para>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
-    linkend="fun-substituteAll">substituteAll</function>.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>preFixup</varname></term>
-    <listitem><para>Hook executed at the start of the fixup
-    phase.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>postFixup</varname></term>
-    <listitem><para>Hook executed at the end of the fixup
-    phase.</para></listitem>
-  </varlistentry>
-
-  <varlistentry xml:id="stdenv-separateDebugInfo">
-    <term><varname>separateDebugInfo</varname></term>
-    <listitem><para>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.</para>
-
-    <para>For example, with GDB, you can add
-
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>installFlags</varname> / <varname>installFlagsArray</varname>
+     </term>
+     <listitem>
+      <para>
+       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.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>preInstall</varname>
+     </term>
+     <listitem>
+      <para>
+       Hook executed at the start of the install phase.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>postInstall</varname>
+     </term>
+     <listitem>
+      <para>
+       Hook executed at the end of the install phase.
+      </para>
+     </listitem>
+    </varlistentry>
+   </variablelist>
+  </section>
+
+  <section xml:id="ssec-fixup-phase">
+   <title>The fixup phase</title>
+
+   <para>
+    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:
+    <itemizedlist>
+     <listitem>
+      <para>
+       It moves the <filename>man/</filename>, <filename>doc/</filename> and
+       <filename>info/</filename> subdirectories of <envar>$out</envar> to
+       <filename>share/</filename>.
+      </para>
+     </listitem>
+     <listitem>
+      <para>
+       It strips libraries and executables of debug information.
+      </para>
+     </listitem>
+     <listitem>
+      <para>
+       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.
+      </para>
+     </listitem>
+     <listitem>
+      <para>
+       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>.
+      </para>
+     </listitem>
+    </itemizedlist>
+   </para>
+
+   <variablelist>
+    <title>Variables controlling the fixup phase</title>
+    <varlistentry>
+     <term><varname>dontStrip</varname>
+     </term>
+     <listitem>
+      <para>
+       If set, libraries and executables are not stripped. By default, they
+       are.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>dontStripHost</varname>
+     </term>
+     <listitem>
+      <para>
+       Like <varname>dontStripHost</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.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>dontStripTarget</varname>
+     </term>
+     <listitem>
+      <para>
+       Like <varname>dontStripHost</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.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>dontMoveSbin</varname>
+     </term>
+     <listitem>
+      <para>
+       If set, files in <filename>$out/sbin</filename> are not moved to
+       <filename>$out/bin</filename>. By default, they are.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>stripAllList</varname>
+     </term>
+     <listitem>
+      <para>
+       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.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>stripAllFlags</varname>
+     </term>
+     <listitem>
+      <para>
+       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>).
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>stripDebugList</varname>
+     </term>
+     <listitem>
+      <para>
+       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>.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>stripDebugFlags</varname>
+     </term>
+     <listitem>
+      <para>
+       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>).
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>dontPatchELF</varname>
+     </term>
+     <listitem>
+      <para>
+       If set, the <command>patchelf</command> command is not used to remove
+       unnecessary <literal>RPATH</literal> entries. Only applies to Linux.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>dontPatchShebangs</varname>
+     </term>
+     <listitem>
+      <para>
+       If set, scripts starting with <literal>#!</literal> do not have their
+       interpreter paths rewritten to paths in the Nix store.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>forceShare</varname>
+     </term>
+     <listitem>
+      <para>
+       The list of directories that must be moved from
+       <filename>$out</filename> to <filename>$out/share</filename>. Defaults
+       to <literal>man doc info</literal>.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>setupHook</varname>
+     </term>
+     <listitem>
+      <para>
+       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
+    linkend="fun-substituteAll">substituteAll</function>.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>preFixup</varname>
+     </term>
+     <listitem>
+      <para>
+       Hook executed at the start of the fixup phase.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>postFixup</varname>
+     </term>
+     <listitem>
+      <para>
+       Hook executed at the end of the fixup phase.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry xml:id="stdenv-separateDebugInfo">
+     <term><varname>separateDebugInfo</varname>
+     </term>
+     <listitem>
+      <para>
+       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.
+      </para>
+      <para>
+       For example, with GDB, you can add
 <programlisting>
 set debug-file-directory ~/.nix-profile/lib/debug
 </programlisting>
-
-    to <filename>~/.gdbinit</filename>. GDB will then be able to find
-    debug information installed via <literal>nix-env
-    -i</literal>.</para>
-
-    </listitem>
-  </varlistentry>
-
-</variablelist>
-
-</section>
-
-<section xml:id="ssec-installCheck-phase"><title>The installCheck phase</title>
-
-<para>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>.</para>
-
-<variablelist>
-  <title>Variables controlling the installCheck phase</title>
-
-  <varlistentry>
-    <term><varname>doInstallCheck</varname></term>
-    <listitem><para>
-      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 <programlisting>doInstallCheck = true;</programlisting> 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.
-    </para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>installCheckInputs</varname></term>
-    <listitem><para>
-      A list of dependencies used by the phase. This gets included in <varname>buildInputs</varname> when <varname>doInstallCheck</varname> is set.
-    </para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>preInstallCheck</varname></term>
-    <listitem><para>Hook executed at the start of the installCheck
-    phase.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>postInstallCheck</varname></term>
-    <listitem><para>Hook executed at the end of the installCheck
-    phase.</para></listitem>
-  </varlistentry>
-
-</variablelist>
-
-</section>
-
-<section xml:id="ssec-distribution-phase"><title>The distribution
-phase</title>
-
-<para>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.</para>
-
-<variablelist>
-  <title>Variables controlling the distribution phase</title>
-
-  <varlistentry>
-    <term><varname>distTarget</varname></term>
-    <listitem><para>The make target that produces the distribution.
-    Defaults to <literal>dist</literal>.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>distFlags</varname> / <varname>distFlagsArray</varname></term>
-    <listitem><para>Additional flags passed to
-    <command>make</command>.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>tarballs</varname></term>
-    <listitem><para>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>.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>dontCopyDist</varname></term>
-    <listitem><para>If set, no files are copied to
-    <filename>$out/tarballs/</filename>.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>preDist</varname></term>
-    <listitem><para>Hook executed at the start of the distribution
-    phase.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>postDist</varname></term>
-    <listitem><para>Hook executed at the end of the distribution
-    phase.</para></listitem>
-  </varlistentry>
-
-</variablelist>
-
-
-</section>
-
-
-</section>
-
-
-<section xml:id="ssec-stdenv-functions"><title>Shell functions</title>
-
-<para>The standard environment provides a number of useful
-functions.</para>
-
-<variablelist>
-
-
-  <varlistentry xml:id='fun-makeWrapper'>
-    <term><function>makeWrapper</function>
-    <replaceable>executable</replaceable>
-    <replaceable>wrapperfile</replaceable>
-    <replaceable>args</replaceable></term>
-    <listitem><para>Constructs a wrapper for a program with various
-    possible arguments. For example:
-
+       to <filename>~/.gdbinit</filename>. GDB will then be able to find debug
+       information installed via <literal>nix-env -i</literal>.
+      </para>
+     </listitem>
+    </varlistentry>
+   </variablelist>
+  </section>
+
+  <section xml:id="ssec-installCheck-phase">
+   <title>The installCheck phase</title>
+
+   <para>
+    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>.
+   </para>
+
+   <variablelist>
+    <title>Variables controlling the installCheck phase</title>
+    <varlistentry>
+     <term><varname>doInstallCheck</varname>
+     </term>
+     <listitem>
+      <para>
+       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
+<programlisting>doInstallCheck = true;</programlisting>
+       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.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+      <term><varname>installCheckInputs</varname>
+      </term>
+      <listitem><para>
+        A list of dependencies used by the phase. This gets included in
+        <varname>buildInputs</varname> when <varname>doInstallCheck</varname>
+        is set.
+      </para></listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>preInstallCheck</varname>
+     </term>
+     <listitem>
+      <para>
+       Hook executed at the start of the installCheck phase.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>postInstallCheck</varname>
+     </term>
+     <listitem>
+      <para>
+       Hook executed at the end of the installCheck phase.
+      </para>
+     </listitem>
+    </varlistentry>
+   </variablelist>
+  </section>
+
+  <section xml:id="ssec-distribution-phase">
+   <title>The distribution phase</title>
+
+   <para>
+    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.
+   </para>
+
+   <variablelist>
+    <title>Variables controlling the distribution phase</title>
+    <varlistentry>
+     <term><varname>distTarget</varname>
+     </term>
+     <listitem>
+      <para>
+       The make target that produces the distribution. Defaults to
+       <literal>dist</literal>.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>distFlags</varname> / <varname>distFlagsArray</varname>
+     </term>
+     <listitem>
+      <para>
+       Additional flags passed to <command>make</command>.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>tarballs</varname>
+     </term>
+     <listitem>
+      <para>
+       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>.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>dontCopyDist</varname>
+     </term>
+     <listitem>
+      <para>
+       If set, no files are copied to <filename>$out/tarballs/</filename>.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>preDist</varname>
+     </term>
+     <listitem>
+      <para>
+       Hook executed at the start of the distribution phase.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><varname>postDist</varname>
+     </term>
+     <listitem>
+      <para>
+       Hook executed at the end of the distribution phase.
+      </para>
+     </listitem>
+    </varlistentry>
+   </variablelist>
+  </section>
+ </section>
+ <section xml:id="ssec-stdenv-functions">
+  <title>Shell functions</title>
+
+  <para>
+   The standard environment provides a number of useful functions.
+  </para>
+
+  <variablelist>
+   <varlistentry xml:id='fun-makeWrapper'>
+    <term><function>makeWrapper</function><replaceable>executable</replaceable><replaceable>wrapperfile</replaceable><replaceable>args</replaceable>
+    </term>
+    <listitem>
+     <para>
+      Constructs a wrapper for a program with various possible arguments. For
+      example:
 <programlisting>
 # adds `FOOBAR=baz` to `$out/bin/foo`’s environment
 makeWrapper $out/bin/foo $wrapperfile --set FOOBAR baz
@@ -1406,662 +1781,763 @@ makeWrapper $out/bin/foo $wrapperfile --set FOOBAR baz
 # (via string replacements or in `configurePhase`).
 makeWrapper $out/bin/foo $wrapperfile --prefix PATH : ${lib.makeBinPath [ hello git ]}
 </programlisting>
-
-    There’s many more kinds of arguments, they are documented in
-    <literal>nixpkgs/pkgs/build-support/setup-hooks/make-wrapper.sh</literal>.</para>
-
-    <para><literal>wrapProgram</literal> is a convenience function you probably
-    want to use most of the time.</para>
-
+      There’s many more kinds of arguments, they are documented in
+      <literal>nixpkgs/pkgs/build-support/setup-hooks/make-wrapper.sh</literal>.
+     </para>
+     <para>
+      <literal>wrapProgram</literal> is a convenience function you probably
+      want to use most of the time.
+     </para>
     </listitem>
-  </varlistentry>
-
-
-  <varlistentry xml:id='fun-substitute'>
-    <term><function>substitute</function>
-    <replaceable>infile</replaceable>
-    <replaceable>outfile</replaceable>
-    <replaceable>subs</replaceable></term>
-
+   </varlistentry>
+   <varlistentry xml:id='fun-substitute'>
+    <term><function>substitute</function><replaceable>infile</replaceable><replaceable>outfile</replaceable><replaceable>subs</replaceable>
+    </term>
     <listitem>
-      <para>Performs string substitution on the contents of
+     <para>
+      Performs string substitution on the contents of
       <replaceable>infile</replaceable>, writing the result to
-      <replaceable>outfile</replaceable>.  The substitutions in
+      <replaceable>outfile</replaceable>. The substitutions in
       <replaceable>subs</replaceable> are of the following form:
-
-        <variablelist>
-          <varlistentry>
-            <term><option>--replace</option>
-            <replaceable>s1</replaceable>
-            <replaceable>s2</replaceable></term>
-            <listitem><para>Replace every occurrence of the string
-            <replaceable>s1</replaceable> by
-            <replaceable>s2</replaceable>.</para></listitem>
-          </varlistentry>
-
-          <varlistentry>
-            <term><option>--subst-var</option>
-            <replaceable>varName</replaceable></term>
-            <listitem><para>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.</para></listitem>
-          </varlistentry>
-
-          <varlistentry>
-            <term><option>--subst-var-by</option>
-            <replaceable>varName</replaceable>
-            <replaceable>s</replaceable></term>
-            <listitem><para>Replace every occurrence of
-            <literal>@<replaceable>varName</replaceable>@</literal> by
-            the string <replaceable>s</replaceable>.</para></listitem>
-          </varlistentry>
-
-        </variablelist>
-
-      </para>
-
-      <para>Example:
-
+      <variablelist>
+       <varlistentry>
+        <term><option>--replace</option><replaceable>s1</replaceable><replaceable>s2</replaceable>
+        </term>
+        <listitem>
+         <para>
+          Replace every occurrence of the string <replaceable>s1</replaceable>
+          by <replaceable>s2</replaceable>.
+         </para>
+        </listitem>
+       </varlistentry>
+       <varlistentry>
+        <term><option>--subst-var</option><replaceable>varName</replaceable>
+        </term>
+        <listitem>
+         <para>
+          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.
+         </para>
+        </listitem>
+       </varlistentry>
+       <varlistentry>
+        <term><option>--subst-var-by</option><replaceable>varName</replaceable><replaceable>s</replaceable>
+        </term>
+        <listitem>
+         <para>
+          Replace every occurrence of
+          <literal>@<replaceable>varName</replaceable>@</literal> by the string
+          <replaceable>s</replaceable>.
+         </para>
+        </listitem>
+       </varlistentry>
+      </variablelist>
+     </para>
+     <para>
+      Example:
 <programlisting>
 substitute ./foo.in ./foo.out \
     --replace /usr/bin/bar $bar/bin/bar \
     --replace "a string containing spaces" "some other text" \
     --subst-var someVar
 </programlisting>
-
-      </para>
-
-      <para><function>substitute</function> is implemented using the
+     </para>
+     <para>
+      <function>substitute</function> is implemented using the
       <command
       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.</para>
-
+      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.
+     </para>
     </listitem>
-  </varlistentry>
-
-
-  <varlistentry xml:id='fun-substituteInPlace'>
-    <term><function>substituteInPlace</function>
-    <replaceable>file</replaceable>
-    <replaceable>subs</replaceable></term>
-    <listitem><para>Like <function>substitute</function>, but performs
-    the substitutions in place on the file
-    <replaceable>file</replaceable>.</para></listitem>
-  </varlistentry>
-
-
-  <varlistentry xml:id='fun-substituteAll'>
-    <term><function>substituteAll</function>
-    <replaceable>infile</replaceable>
-    <replaceable>outfile</replaceable></term>
-    <listitem><para>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
-
+   </varlistentry>
+   <varlistentry xml:id='fun-substituteInPlace'>
+    <term><function>substituteInPlace</function><replaceable>file</replaceable><replaceable>subs</replaceable>
+    </term>
+    <listitem>
+     <para>
+      Like <function>substitute</function>, but performs the substitutions in
+      place on the file <replaceable>file</replaceable>.
+     </para>
+    </listitem>
+   </varlistentry>
+   <varlistentry xml:id='fun-substituteAll'>
+    <term><function>substituteAll</function><replaceable>infile</replaceable><replaceable>outfile</replaceable>
+    </term>
+    <listitem>
+     <para>
+      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
 <programlisting>
 #! @bash@/bin/sh
 PATH=@coreutils@/bin
 echo @foo@
 </programlisting>
-
-    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
-
+      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
 <programlisting>
 #! /nix/store/bmwp0q28cf21...-bash-3.2-p39/bin/sh
 PATH=/nix/store/68afga4khv0w...-coreutils-6.12/bin
 echo @foo@
 </programlisting>
-
-    That is, no substitution is performed for undefined variables.</para>
-
-    <para>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).</para>
-  </listitem>
-  </varlistentry>
-
-
-  <varlistentry xml:id='fun-substituteAllInPlace'>
-    <term><function>substituteAllInPlace</function>
-    <replaceable>file</replaceable></term>
-    <listitem><para>Like <function>substituteAll</function>, but performs
-    the substitutions in place on the file
-    <replaceable>file</replaceable>.</para></listitem>
-  </varlistentry>
-
-
-  <varlistentry xml:id='fun-stripHash'>
-    <term><function>stripHash</function>
-    <replaceable>path</replaceable></term>
-    <listitem><para>Strips the directory and hash part of a store
-    path, outputting the name part to <literal>stdout</literal>.
-    For example:
-
+      That is, no substitution is performed for undefined variables.
+     </para>
+     <para>
+      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).
+     </para>
+    </listitem>
+   </varlistentry>
+   <varlistentry xml:id='fun-substituteAllInPlace'>
+    <term><function>substituteAllInPlace</function><replaceable>file</replaceable>
+    </term>
+    <listitem>
+     <para>
+      Like <function>substituteAll</function>, but performs the substitutions
+      in place on the file <replaceable>file</replaceable>.
+     </para>
+    </listitem>
+   </varlistentry>
+   <varlistentry xml:id='fun-stripHash'>
+    <term><function>stripHash</function><replaceable>path</replaceable>
+    </term>
+    <listitem>
+     <para>
+      Strips the directory and hash part of a store path, outputting the name
+      part to <literal>stdout</literal>. For example:
 <programlisting>
 # prints coreutils-8.24
 stripHash "/nix/store/9s9r019176g7cvn2nvcw41gsp862y6b4-coreutils-8.24"
 </programlisting>
-
-    If you wish to store the result in another variable, then the
-    following idiom may be useful:
-
+      If you wish to store the result in another variable, then the following
+      idiom may be useful:
 <programlisting>
 name="/nix/store/9s9r019176g7cvn2nvcw41gsp862y6b4-coreutils-8.24"
 someVar=$(stripHash $name)
 </programlisting>
-
-    </para></listitem>
-  </varlistentry>
-
-
-  <varlistentry xml:id='fun-wrapProgram'>
-    <term><function>wrapProgram</function>
-    <replaceable>executable</replaceable>
-    <replaceable>makeWrapperArgs</replaceable></term>
-    <listitem><para>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>.</para>
-
-    <para>It cannot be applied multiple times, since it will overwrite the wrapper
-    file.</para>
+     </para>
+    </listitem>
+   </varlistentry>
+   <varlistentry xml:id='fun-wrapProgram'>
+    <term><function>wrapProgram</function><replaceable>executable</replaceable><replaceable>makeWrapperArgs</replaceable>
+    </term>
+    <listitem>
+     <para>
+      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>.
+     </para>
+     <para>
+      It cannot be applied multiple times, since it will overwrite the wrapper
+      file.
+     </para>
     </listitem>
-  </varlistentry>
-
-
-</variablelist>
-
-</section>
-
-
-<section xml:id="ssec-setup-hooks"><title>Package setup hooks</title>
-
-<para>
-  Nix itself considers a build-time dependency 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 it's 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.
-</para>
-<para>
-  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.
-</para>
-<para>
-  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 adding 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.
-</para>
-<para>
-  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 libaries 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).
-</para>
-<para>
-  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 it 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 it's 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
-  <programlisting language="bash">
+   </varlistentry>
+  </variablelist>
+ </section>
+ <section xml:id="ssec-setup-hooks">
+  <title>Package setup hooks</title>
+
+  <para>
+   Nix itself considers a build-time dependency 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 it's 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.
+  </para>
+
+  <para>
+   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.
+  </para>
+
+  <para>
+   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 adding 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.
+  </para>
+
+  <para>
+   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 libaries 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).
+  </para>
+
+  <para>
+   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 it 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 it's 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
+<programlisting language="bash">
 addEnvHooks "$hostOffset" myBashFunction
   </programlisting>
-</para>
-<para>
-  The <emphasis>existence</emphasis> of setups hooks has long been documented and packages inside Nixpkgs are free to use these 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.
-</para>
-<para>
-  Here are some packages that provide a setup hook.
-  Since the mechanism is modular, this probably isn't an exhaustive list.
-  Then again, since the mechanism is only to be used as a last resort, it might be.
-<variablelist>
-
-  <varlistentry>
-    <term>Bintools Wrapper</term>
-    <listitem>
+  </para>
+
+  <para>
+   The <emphasis>existence</emphasis> of setups hooks has long been documented
+   and packages inside Nixpkgs are free to use these 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.
+  </para>
+
+  <para>
+   Here are some packages that provide a setup hook. Since the mechanism is
+   modular, this probably isn't an exhaustive list. Then again, since the
+   mechanism is only to be used as a last resort, it might be.
+   <variablelist>
+    <varlistentry>
+     <term>Bintools Wrapper</term>
+     <listitem>
       <para>
-        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 Bintools Wrapper.
-        Packages typically depend on CC Wrapper, which in turn (at run time) depends on Bintools Wrapper.
+       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 Bintools Wrapper.
+       Packages typically depend on CC Wrapper, which in turn (at run time)
+       depends on Bintools Wrapper.
       </para>
       <para>
-        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 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.
-        Bintools Wrapper's setup hook causes any <filename>lib</filename> and <filename>lib64</filename> subdirectories to be added to <envar>NIX_LDFLAGS</envar>.
-        Since CC Wrapper and Bintools Wrapper use the same strategy, most of the Bintools Wrapper code is sparsely commented and refers to CC Wrapper.
-        But CC Wrapper's code, by contrast, has quite lengthy comments.
-        Bintools Wrapper merely cites those, rather than repeating them, to avoid falling out of sync.
+       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 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. Bintools
+       Wrapper's setup hook causes any <filename>lib</filename> and
+       <filename>lib64</filename> subdirectories to be added to
+       <envar>NIX_LDFLAGS</envar>. Since CC Wrapper and Bintools Wrapper use
+       the same strategy, most of the Bintools Wrapper code is sparsely
+       commented and refers to CC Wrapper. But CC Wrapper's code, by contrast,
+       has quite lengthy comments. Bintools Wrapper merely cites those, rather
+       than repeating them, to avoid falling out of sync.
       </para>
       <para>
-        A final task of the setup hook is defining a number of standard environment variables to tell build systems which executables full-fill which purpose.
-        They are defined to just be the base name of the tools, under the assumption that 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.
-        <footnote><para>
-          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.
-        </para></footnote>
-        <envar>BUILD_</envar>- and <envar>TARGET_</envar>-prefixed versions of the normal environment variable are defined for the additional Bintools Wrappers, properly disambiguating them.
+       A final task of the setup hook is defining a number of standard
+       environment variables to tell build systems which executables full-fill
+       which purpose. They are defined to just be the base name of the tools,
+       under the assumption that 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.
+       <footnote>
+        <para>
+         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.
+        </para>
+       </footnote>
+       <envar>BUILD_</envar>- and <envar>TARGET_</envar>-prefixed versions of
+       the normal environment variable are defined for the additional Bintools
+       Wrappers, properly disambiguating them.
       </para>
       <para>
-        A problem with this final task is that 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>.
+       A problem with this final task is that 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>.
       </para>
-    </listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term>CC Wrapper</term>
-    <listitem>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term>CC Wrapper</term>
+     <listitem>
       <para>
-        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 CC Wrapper.
-        Packages typically depend on CC Wrapper, which in turn (at run time) depends on Bintools Wrapper.
+       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 CC Wrapper. Packages typically
+       depend on CC Wrapper, which in turn (at run time) depends on Bintools
+       Wrapper.
       </para>
       <para>
-        Dependency finding is undoubtedly the main task of CC Wrapper.
-        This works just like 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.
+       Dependency finding is undoubtedly the main task of CC Wrapper. This
+       works just like 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.
       </para>
       <para>
-        CC Wrapper also like Bintools Wrapper defines 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.
+       CC Wrapper also like Bintools Wrapper defines 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.
       </para>
-    </listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term>Perl</term>
-    <listitem>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term>Perl</term>
+     <listitem>
       <para>
-        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.
+       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.
       </para>
-    </listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term>Python</term>
-    <listitem><para>Adds the
-    <filename>lib/${python.libPrefix}/site-packages</filename> subdirectory of
-    each build input to the <envar>PYTHONPATH</envar> environment
-    variable.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term>pkg-config</term>
-    <listitem><para>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.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term>Automake</term>
-    <listitem><para>Adds the <filename>share/aclocal</filename>
-    subdirectory of each build input to the <envar>ACLOCAL_PATH</envar>
-    environment variable.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term>Autoconf</term>
-    <listitem><para>The <varname>autoreconfHook</varname> derivation adds
-    <varname>autoreconfPhase</varname>, which runs autoreconf, libtoolize and
-    automake, essentially preparing the configure script in autotools-based
-    builds.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term>libxml2</term>
-    <listitem><para>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.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term>teTeX / TeX Live</term>
-    <listitem><para>Adds the <filename>share/texmf-nix</filename>
-    subdirectory of each build input to the <envar>TEXINPUTS</envar>
-    environment variable.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term>Qt 4</term>
-    <listitem><para>Sets the <envar>QTDIR</envar> environment variable
-    to Qt’s path.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term>gdk-pixbuf</term>
-    <listitem><para>Exports <envar>GDK_PIXBUF_MODULE_FILE</envar>
-    environment variable the the builder. Add librsvg package
-    to <varname>buildInputs</varname> to get svg support.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term>GHC</term>
-    <listitem><para>Creates a temporary package database and registers
-    every Haskell build input in it (TODO: how?).</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term>GStreamer</term>
-    <listitem><para>Adds the
-    GStreamer plugins subdirectory of
-    each build input to the <envar>GST_PLUGIN_SYSTEM_PATH_1_0</envar> or
-    <envar>GST_PLUGIN_SYSTEM_PATH</envar> environment variable.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term>paxctl</term>
-    <listitem><para>Defines the <varname>paxmark</varname> helper for
-    setting per-executable PaX flags on Linux (where it is available by
-    default; on all other platforms, <varname>paxmark</varname> is a no-op).
-    For example, to disable secure memory protections on the executable
-    <replaceable>foo</replaceable>:
-    <programlisting>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term>Python</term>
+     <listitem>
+      <para>
+       Adds the <filename>lib/${python.libPrefix}/site-packages</filename>
+       subdirectory of each build input to the <envar>PYTHONPATH</envar>
+       environment variable.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term>pkg-config</term>
+     <listitem>
+      <para>
+       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.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term>Automake</term>
+     <listitem>
+      <para>
+       Adds the <filename>share/aclocal</filename> subdirectory of each build
+       input to the <envar>ACLOCAL_PATH</envar> environment variable.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term>Autoconf</term>
+     <listitem>
+      <para>
+       The <varname>autoreconfHook</varname> derivation adds
+       <varname>autoreconfPhase</varname>, which runs autoreconf, libtoolize
+       and automake, essentially preparing the configure script in
+       autotools-based builds.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term>libxml2</term>
+     <listitem>
+      <para>
+       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.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term>teTeX / TeX Live</term>
+     <listitem>
+      <para>
+       Adds the <filename>share/texmf-nix</filename> subdirectory of each build
+       input to the <envar>TEXINPUTS</envar> environment variable.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term>Qt 4</term>
+     <listitem>
+      <para>
+       Sets the <envar>QTDIR</envar> environment variable to Qt’s path.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term>gdk-pixbuf</term>
+     <listitem>
+      <para>
+       Exports <envar>GDK_PIXBUF_MODULE_FILE</envar> environment variable the
+       the builder. Add librsvg package to <varname>buildInputs</varname> to
+       get svg support.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term>GHC</term>
+     <listitem>
+      <para>
+       Creates a temporary package database and registers every Haskell build
+       input in it (TODO: how?).
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term>GStreamer</term>
+     <listitem>
+      <para>
+       Adds the GStreamer plugins subdirectory of each build input to the
+       <envar>GST_PLUGIN_SYSTEM_PATH_1_0</envar> or
+       <envar>GST_PLUGIN_SYSTEM_PATH</envar> environment variable.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term>paxctl</term>
+     <listitem>
+      <para>
+       Defines the <varname>paxmark</varname> helper for setting per-executable
+       PaX flags on Linux (where it is available by default; on all other
+       platforms, <varname>paxmark</varname> is a no-op). For example, to
+       disable secure memory protections on the executable
+       <replaceable>foo</replaceable>:
+<programlisting>
       postFixup = ''
         paxmark m $out/bin/<replaceable>foo</replaceable>
       '';
     </programlisting>
-    The <literal>m</literal> flag is the most common flag and is typically
-    required for applications that employ JIT compilation or otherwise need to
-    execute code generated at run-time.  Disabling PaX protections should be
-    considered a last resort: if possible, problematic features should be
-    disabled or patched to work with PaX.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term>autoPatchelfHook</term>
-    <listitem><para>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. All packages within the
-    <envar>runtimeDependencies</envar> environment variable are unconditionally
-    added to executables, which is useful for programs that use
-    <citerefentry>
-      <refentrytitle>dlopen</refentrytitle>
-      <manvolnum>3</manvolnum>
-    </citerefentry>
-    to load libraries at runtime.</para></listitem>
-  </varlistentry>
-
-</variablelist>
-
-</para>
-
-</section>
-
-
-<section xml:id="sec-purity-in-nixpkgs"><title>Purity in Nixpkgs</title>
-
-<para>[measures taken to prevent dependencies on packages outside the
-store, and what you can do to prevent them]</para>
-
-<para>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.</para>
-
-</section>
-
-<section xml:id="sec-hardening-in-nixpkgs"><title>Hardening in Nixpkgs</title>
-
-<para>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>.
-</para>
-
-<para>
-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.
-</para>
-
-<para>The following flags are enabled by default and might require disabling with
-<varname>hardeningDisable</varname> if the program to package is incompatible.
-</para>
-
-<variablelist>
-
-  <varlistentry>
-    <term><varname>format</varname></term>
-    <listitem><para>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>.</para>
-
-    <para>This needs to be turned off or fixed for errors similar to:</para>
-
-    <programlisting>
+       The <literal>m</literal> flag is the most common flag and is typically
+       required for applications that employ JIT compilation or otherwise need
+       to execute code generated at run-time. Disabling PaX protections should
+       be considered a last resort: if possible, problematic features should be
+       disabled or patched to work with PaX.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term>autoPatchelfHook</term>
+     <listitem>
+      <para>
+       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. All packages within the
+       <envar>runtimeDependencies</envar> environment variable are
+       unconditionally added to executables, which is useful for programs that
+       use <citerefentry>
+       <refentrytitle>dlopen</refentrytitle>
+       <manvolnum>3</manvolnum> </citerefentry> to load libraries at runtime.
+      </para>
+     </listitem>
+    </varlistentry>
+   </variablelist>
+  </para>
+ </section>
+ <section xml:id="sec-purity-in-nixpkgs">
+  <title>Purity in Nixpkgs</title>
+
+  <para>
+   [measures taken to prevent dependencies on packages outside the store, and
+   what you can do to prevent them]
+  </para>
+
+  <para>
+   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.
+  </para>
+ </section>
+ <section xml:id="sec-hardening-in-nixpkgs">
+  <title>Hardening in Nixpkgs</title>
+
+  <para>
+   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>.
+  </para>
+
+  <para>
+   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.
+  </para>
+
+  <para>
+   The following flags are enabled by default and might require disabling with
+   <varname>hardeningDisable</varname> if the program to package is
+   incompatible.
+  </para>
+
+  <variablelist>
+   <varlistentry>
+    <term><varname>format</varname>
+    </term>
+    <listitem>
+     <para>
+      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>.
+     </para>
+     <para>
+      This needs to be turned off or fixed for errors similar to:
+     </para>
+<programlisting>
 /tmp/nix-build-zynaddsubfx-2.5.2.drv-0/zynaddsubfx-2.5.2/src/UI/guimain.cpp:571:28: error: format not a string literal and no format arguments [-Werror=format-security]
          printf(help_message);
                             ^
 cc1plus: some warnings being treated as errors
-    </programlisting></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>stackprotector</varname></term>
+    </programlisting>
+    </listitem>
+   </varlistentry>
+   <varlistentry>
+    <term><varname>stackprotector</varname>
+    </term>
     <listitem>
-    <para>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).</para>
-
-    <para>This needs to be turned off or fixed for errors similar to:</para>
-
-    <programlisting>
+     <para>
+      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).
+     </para>
+     <para>
+      This needs to be turned off or fixed for errors similar to:
+     </para>
+<programlisting>
 bin/blib.a(bios_console.o): In function `bios_handle_cup':
 /tmp/nix-build-ipxe-20141124-5cbdc41.drv-0/ipxe-5cbdc41/src/arch/i386/firmware/pcbios/bios_console.c:86: undefined reference to `__stack_chk_fail'
-    </programlisting></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>fortify</varname></term>
+    </programlisting>
+    </listitem>
+   </varlistentry>
+   <varlistentry>
+    <term><varname>fortify</varname>
+    </term>
     <listitem>
-    <para>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.
-    </para>
-
-    <para>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>.</para>
-
-    <para>This needs to be turned off or fixed for errors similar to:</para>
-
-    <programlisting>
+     <para>
+      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.
+     </para>
+     <para>
+      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>.
+     </para>
+     <para>
+      This needs to be turned off or fixed for errors similar to:
+     </para>
+<programlisting>
 malloc.c:404:15: error: return type is an incomplete type
 malloc.c:410:19: error: storage size of 'ms' isn't known
     </programlisting>
-    <programlisting>
+<programlisting>
 strdup.h:22:1: error: expected identifier or '(' before '__extension__'
     </programlisting>
-    <programlisting>
+<programlisting>
 strsep.c:65:23: error: register name not specified for 'delim'
     </programlisting>
-    <programlisting>
+<programlisting>
 installwatch.c:3751:5: error: conflicting types for '__open_2'
     </programlisting>
-    <programlisting>
+<programlisting>
 fcntl2.h:50:4: error: call to '__open_missing_mode' declared with attribute error: open with O_CREAT or O_TMPFILE in second argument needs 3 arguments
     </programlisting>
     </listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>pic</varname></term>
+   </varlistentry>
+   <varlistentry>
+    <term><varname>pic</varname>
+    </term>
     <listitem>
-    <para>Adds the <option>-fPIC</option> compiler options. This options adds
-    support for position independent code in shared libraries and thus making
-    ASLR possible.</para>
-    <para>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.
-    </para>
-
-    <para>This needs to be turned off or fixed for assembler errors similar to:</para>
-
-    <programlisting>
+     <para>
+      Adds the <option>-fPIC</option> compiler options. This options adds
+      support for position independent code in shared libraries and thus making
+      ASLR possible.
+     </para>
+     <para>
+      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.
+     </para>
+     <para>
+      This needs to be turned off or fixed for assembler errors similar to:
+     </para>
+<programlisting>
 ccbLfRgg.s: Assembler messages:
 ccbLfRgg.s:33: Error: missing or invalid displacement expression `private_key_len@GOTOFF'
     </programlisting>
     </listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>strictoverflow</varname></term>
+   </varlistentry>
+   <varlistentry>
+    <term><varname>strictoverflow</varname>
+    </term>
     <listitem>
-    <para>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.
-    </para>
-
-    <para>This flag should not trigger any build or runtime errors.</para>
+     <para>
+      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.
+     </para>
+     <para>
+      This flag should not trigger any build or runtime errors.
+     </para>
     </listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>relro</varname></term>
+   </varlistentry>
+   <varlistentry>
+    <term><varname>relro</varname>
+    </term>
     <listitem>
-    <para>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.
-    </para>
-
-    <para>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.</para>
+     <para>
+      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.
+     </para>
+     <para>
+      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.
+     </para>
     </listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>bindnow</varname></term>
+   </varlistentry>
+   <varlistentry>
+    <term><varname>bindnow</varname>
+    </term>
     <listitem>
-    <para>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.
-    </para>
-
-    <para>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:</para>
-
-    <programlisting>
+     <para>
+      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.
+     </para>
+     <para>
+      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:
+     </para>
+<programlisting>
 intel_drv.so: undefined symbol: vgaHWFreeHWRec
     </programlisting>
     </listitem>
-  </varlistentry>
-
-</variablelist>
+   </varlistentry>
+  </variablelist>
 
-<para>The following flags are disabled by default and should be enabled
-with <varname>hardeningEnable</varname> for packages that take untrusted
-input like network services.
-</para>
+  <para>
+   The following flags are disabled by default and should be enabled with
+   <varname>hardeningEnable</varname> for packages that take untrusted input
+   like network services.
+  </para>
 
-<variablelist>
-
-  <varlistentry>
-    <term><varname>pie</varname></term>
+  <variablelist>
+   <varlistentry>
+    <term><varname>pie</varname>
+    </term>
     <listitem>
-    <para>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.
-    </para>
+     <para>
+      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.
+     </para>
     </listitem>
-  </varlistentry>
-
-</variablelist>
-
-<para>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>.
-</para>
-
-</section>
-
+   </varlistentry>
+  </variablelist>
+
+  <para>
+   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>.
+  </para>
+ </section>
 </chapter>
diff --git a/doc/submitting-changes.xml b/doc/submitting-changes.xml
index d3cf221c9b6..ffa3a90b5eb 100644
--- a/doc/submitting-changes.xml
+++ b/doc/submitting-changes.xml
@@ -1,447 +1,513 @@
 <chapter xmlns="http://docbook.org/ns/docbook"
          xmlns:xlink="http://www.w3.org/1999/xlink"
          xml:id="chap-submitting-changes">
+ <title>Submitting changes</title>
+ <section>
+  <title>Making patches</title>
 
-<title>Submitting changes</title>
-
-<section>
-<title>Making patches</title>
-
-<itemizedlist>
-<listitem>
-<para>Read <link xlink:href="https://nixos.org/nixpkgs/manual/">Manual (How to write packages for Nix)</link>.</para>
-</listitem>
-
-<listitem>
-<para>Fork the repository on GitHub.</para>
-</listitem>
-
-<listitem>
-<para>Create a branch for your future fix.
-
-<itemizedlist>
-<listitem>
-<para>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.
-
-<itemizedlist>
-<listitem>
-<para>For example: <command>nixos-version</command> returns <command>15.05.git.0998212 (Dingo)</command>. So you can do:</para>
-</listitem>
-</itemizedlist>
-
+  <itemizedlist>
+   <listitem>
+    <para>
+     Read <link xlink:href="https://nixos.org/nixpkgs/manual/">Manual (How to
+     write packages for Nix)</link>.
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     Fork the repository on GitHub.
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     Create a branch for your future fix.
+     <itemizedlist>
+      <listitem>
+       <para>
+        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.
+        <itemizedlist>
+         <listitem>
+          <para>
+           For example: <command>nixos-version</command> returns
+           <command>15.05.git.0998212 (Dingo)</command>. So you can do:
+          </para>
+         </listitem>
+        </itemizedlist>
 <screen>
 $ git checkout 0998212
 $ git checkout -b 'fix/pkg-name-update'
 </screen>
-</para>
-</listitem>
-
-<listitem>
-<para>Please avoid working directly on the <command>master</command> branch.</para>
-</listitem>
-</itemizedlist>
-</para>
-</listitem>
-
-<listitem>
-<para>Make commits of logical units.
-
-<itemizedlist>
-<listitem>
-<para>If you removed pkgs, made some major NixOS changes etc., write about them in <command>nixos/doc/manual/release-notes/rl-unstable.xml</command>.</para>
-</listitem>
-</itemizedlist>
-</para>
-</listitem>
-
-<listitem>
-<para>Check for unnecessary whitespace with <command>git diff --check</command> before committing.</para>
-</listitem>
-
-<listitem>
-<para>Format the commit in a following way:</para>
-<programlisting>
-(pkg-name | nixos/&lt;module>): (from -> to | init at version | refactor | etc)
-Additional information.
-</programlisting>
-
-<itemizedlist>
-<listitem>
-<para>Examples:
-
-<itemizedlist>
-<listitem>
-<para>
-<command>nginx: init at 2.0.1</command>
-</para>
-</listitem>
-
-<listitem>
-<para>
-<command>firefox: 54.0.1 -> 55.0</command>
-</para>
-</listitem>
-
-<listitem>
-<para>
-<command>nixos/hydra: add bazBaz option</command>
-</para>
-</listitem>
-
-<listitem>
-<para>
-<command>nixos/nginx: refactor config generation</command>
-</para>
-</listitem>
-</itemizedlist>
-</para>
-</listitem>
-</itemizedlist>
-</listitem>
-
-<listitem>
-<para>Test your changes. If you work with
-
-<itemizedlist>
-<listitem>
-<para>nixpkgs:
-
-<itemizedlist>
-<listitem>
-<para>update pkg ->
-
-<itemizedlist>
-<listitem>
-<para>
-<command>nix-env -i pkg-name -f &lt;path to your local nixpkgs folder&gt;</command>
-</para>
-</listitem>
-</itemizedlist>
-</para>
-</listitem>
-
-<listitem>
-<para>add pkg ->
-
-<itemizedlist>
-<listitem>
-<para>Make sure it's in <command>pkgs/top-level/all-packages.nix</command>
-</para>
-</listitem>
-
-<listitem>
-<para>
-<command>nix-env -i pkg-name -f &lt;path to your local nixpkgs folder&gt;</command>
-</para>
-</listitem>
-</itemizedlist>
-</para>
-</listitem>
-
-<listitem>
-<para>
-<emphasis>If you don't want to install pkg in you profile</emphasis>.
-
-<itemizedlist>
-<listitem>
-<para>
-<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>.</para>
-</listitem>
-</itemizedlist>
-</para>
-</listitem>
-
-<listitem>
-<para>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.</para>
-</listitem>
-</itemizedlist>
-</para>
-</listitem>
-
-<listitem>
-<para>NixOS and its modules:
-
-<itemizedlist>
-<listitem>
-<para>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>.</para>
-</listitem>
-</itemizedlist>
-</para>
-</listitem>
-</itemizedlist>
-</para>
-</listitem>
-
-<listitem>
-<para>If you have commits <command>pkg-name: oh, forgot to insert whitespace</command>: squash commits in this case. Use <command>git rebase -i</command>.</para>
-</listitem>
-
-<listitem>
-<para>Rebase you branch against current <command>master</command>.</para>
-</listitem>
-</itemizedlist>
-</section>
-
-<section>
-<title>Submitting changes</title>
-
-<itemizedlist>
-<listitem>
-<para>Push your changes to your fork of nixpkgs.</para>
-</listitem>
-
-<listitem>
-<para>Create pull request:
-
-<itemizedlist>
-<listitem>
-<para>Write the title in format <command>(pkg-name | nixos/&lt;module>): improvement</command>.
-
-<itemizedlist>
-<listitem>
-<para>If you update the pkg, write versions <command>from -> to</command>.</para>
-</listitem>
-</itemizedlist>
-</para>
-</listitem>
-
-<listitem>
-<para>Write in comment if you have tested your patch. Do not rely much on <command>TravisCI</command>.</para>
-</listitem>
-
-<listitem>
-<para>If you make an improvement, write about your motivation.</para>
-</listitem>
-
-<listitem>
-<para>Notify maintainers of the package. For example add to the message: <command>cc @jagajaga @domenkozar</command>.</para>
-</listitem>
-</itemizedlist>
-</para>
-</listitem>
-</itemizedlist>
-</section>
-
-<section>
-  <title>Pull Request Template</title>
-  <para>
-    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.
-  </para>
-  <para>When a PR is created, it will be pre-populated with some checkboxes detailed below:
-  </para>
-  <section>
-    <title>Tested using sandboxing</title>
+       </para>
+      </listitem>
+      <listitem>
+       <para>
+        Please avoid working directly on the <command>master</command> branch.
+       </para>
+      </listitem>
+     </itemizedlist>
+    </para>
+   </listitem>
+   <listitem>
     <para>
-      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
-      xlink:href="https://nixos.org/nix/manual/#description-45">build-use-sandbox</link>
-      in Nix manual for details.
+     Make commits of logical units.
+     <itemizedlist>
+      <listitem>
+       <para>
+        If you removed pkgs, made some major NixOS changes etc., write about
+        them in
+        <command>nixos/doc/manual/release-notes/rl-unstable.xml</command>.
+       </para>
+      </listitem>
+     </itemizedlist>
     </para>
+   </listitem>
+   <listitem>
     <para>
-      Sandboxing is not enabled by default in Nix due to a small performance
-      hit on each build.  In pull requests for <link
-        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
-        xlink:href="https://nixos.org/hydra/">https://nixos.org/hydra/</link>
-      sandboxing is also used.
+     Check for unnecessary whitespace with <command>git diff --check</command>
+     before committing.
     </para>
+   </listitem>
+   <listitem>
     <para>
-      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:
-      <itemizedlist>
+     Format the commit in a following way:
+    </para>
+<programlisting>
+(pkg-name | nixos/&lt;module>): (from -> to | init at version | refactor | etc)
+Additional information.
+</programlisting>
+    <itemizedlist>
+     <listitem>
+      <para>
+       Examples:
+       <itemizedlist>
         <listitem>
-          <para>
-            <emphasis role="bold">Globally enable sandboxing on NixOS</emphasis>:
-            add the following to 
-            <filename>configuration.nix</filename>
-            <screen>nix.useSandbox = true;</screen>
-          </para>
+         <para>
+          <command>nginx: init at 2.0.1</command>
+         </para>
         </listitem>
         <listitem>
-          <para>
-            <emphasis role="bold">Globally enable sandboxing on non-NixOS platforms</emphasis>:
-            add the following to: <filename>/etc/nix/nix.conf</filename>
-            <screen>build-use-sandbox = true</screen>
-          </para>
+         <para>
+          <command>firefox: 54.0.1 -> 55.0</command>
+         </para>
         </listitem>
-      </itemizedlist>
-    </para>
-    
-  </section>
-  <section>
-    <title>Built on platform(s)</title>
+        <listitem>
+         <para>
+          <command>nixos/hydra: add bazBaz option</command>
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <command>nixos/nginx: refactor config generation</command>
+         </para>
+        </listitem>
+       </itemizedlist>
+      </para>
+     </listitem>
+    </itemizedlist>
+   </listitem>
+   <listitem>
     <para>
-      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.
+     Test your changes. If you work with
+     <itemizedlist>
+      <listitem>
+       <para>
+        nixpkgs:
+        <itemizedlist>
+         <listitem>
+          <para>
+           update pkg ->
+           <itemizedlist>
+            <listitem>
+             <para>
+              <command>nix-env -i pkg-name -f &lt;path to your local nixpkgs
+              folder&gt;</command>
+             </para>
+            </listitem>
+           </itemizedlist>
+          </para>
+         </listitem>
+         <listitem>
+          <para>
+           add pkg ->
+           <itemizedlist>
+            <listitem>
+             <para>
+              Make sure it's in
+              <command>pkgs/top-level/all-packages.nix</command>
+             </para>
+            </listitem>
+            <listitem>
+             <para>
+              <command>nix-env -i pkg-name -f &lt;path to your local nixpkgs
+              folder&gt;</command>
+             </para>
+            </listitem>
+           </itemizedlist>
+          </para>
+         </listitem>
+         <listitem>
+          <para>
+           <emphasis>If you don't want to install pkg in you
+           profile</emphasis>.
+           <itemizedlist>
+            <listitem>
+             <para>
+              <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>.
+             </para>
+            </listitem>
+           </itemizedlist>
+          </para>
+         </listitem>
+         <listitem>
+          <para>
+           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.
+          </para>
+         </listitem>
+        </itemizedlist>
+       </para>
+      </listitem>
+      <listitem>
+       <para>
+        NixOS and its modules:
+        <itemizedlist>
+         <listitem>
+          <para>
+           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>.
+          </para>
+         </listitem>
+        </itemizedlist>
+       </para>
+      </listitem>
+     </itemizedlist>
     </para>
-  </section>
-  <section>
-    <title>Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)</title>
+   </listitem>
+   <listitem>
     <para>
-      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
-        xlink:href="https://nixos.org/nixos/manual/index.html#sec-nixos-tests">section
-        in the NixOS manual</link>.
+     If you have commits <command>pkg-name: oh, forgot to insert
+     whitespace</command>: squash commits in this case. Use <command>git rebase
+     -i</command>.
     </para>
-  </section>
-  <section>
-    <title>Tested compilation of all pkgs that depend on this change using <command>nox-review</command></title>
+   </listitem>
+   <listitem>
     <para>
-      If you are updating a package's version, you can use nox to make sure all
-      packages that depend on the updated package still compile correctly. This
-      can be done using the nox utility. The <command>nox-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.
+     Rebase you branch against current <command>master</command>.
     </para>
+   </listitem>
+  </itemizedlist>
+ </section>
+ <section>
+  <title>Submitting changes</title>
+
+  <itemizedlist>
+   <listitem>
     <para>
-      review uncommitted changes:
-      <screen>nix-shell -p nox --run "nox-review wip"</screen>
+     Push your changes to your fork of nixpkgs.
     </para>
+   </listitem>
+   <listitem>
     <para>
-      review changes from pull request number 12345:
-      <screen>nix-shell -p nox --run "nox-review pr 12345"</screen>
+     Create pull request:
+     <itemizedlist>
+      <listitem>
+       <para>
+        Write the title in format <command>(pkg-name | nixos/&lt;module>):
+        improvement</command>.
+        <itemizedlist>
+         <listitem>
+          <para>
+           If you update the pkg, write versions <command>from -> to</command>.
+          </para>
+         </listitem>
+        </itemizedlist>
+       </para>
+      </listitem>
+      <listitem>
+       <para>
+        Write in comment if you have tested your patch. Do not rely much on
+        <command>TravisCI</command>.
+       </para>
+      </listitem>
+      <listitem>
+       <para>
+        If you make an improvement, write about your motivation.
+       </para>
+      </listitem>
+      <listitem>
+       <para>
+        Notify maintainers of the package. For example add to the message:
+        <command>cc @jagajaga @domenkozar</command>.
+       </para>
+      </listitem>
+     </itemizedlist>
     </para>
-  </section>
+   </listitem>
+  </itemizedlist>
+ </section>
+ <section>
+  <title>Pull Request Template</title>
+
+  <para>
+   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.
+  </para>
+
+  <para>
+   When a PR is created, it will be pre-populated with some checkboxes detailed
+   below:
+  </para>
+
   <section>
-    <title>Tested execution of all binary files (usually in <filename>./result/bin/</filename>)</title>
-    <para>
-      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.
-    </para>
+   <title>Tested using sandboxing</title>
+
+   <para>
+    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
+      xlink:href="https://nixos.org/nix/manual/#description-45">build-use-sandbox</link>
+    in Nix manual for details.
+   </para>
+
+   <para>
+    Sandboxing is not enabled by default in Nix due to a small performance hit
+    on each build. In pull requests for
+    <link
+        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
+        xlink:href="https://nixos.org/hydra/">https://nixos.org/hydra/</link>
+    sandboxing is also used.
+   </para>
+
+   <para>
+    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:
+    <itemizedlist>
+     <listitem>
+      <para>
+       <emphasis role="bold">Globally enable sandboxing on NixOS</emphasis>:
+       add the following to <filename>configuration.nix</filename>
+<screen>nix.useSandbox = true;</screen>
+      </para>
+     </listitem>
+     <listitem>
+      <para>
+       <emphasis role="bold">Globally enable sandboxing on non-NixOS
+       platforms</emphasis>: add the following to:
+       <filename>/etc/nix/nix.conf</filename>
+<screen>build-use-sandbox = true</screen>
+      </para>
+     </listitem>
+    </itemizedlist>
+   </para>
   </section>
+
   <section>
-    <title>Meets nixpkgs contribution standards</title>
-    <para>
-      The last checkbox is fits <link
-        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.
-    </para>
-    
+   <title>Built on platform(s)</title>
+
+   <para>
+    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.
+   </para>
   </section>
-</section>
-
-<section>
-<title>Hotfixing pull requests</title>
 
-<itemizedlist>
-<listitem>
-<para>Make the appropriate changes in you branch.</para>
-</listitem>
-
-<listitem>
-<para>Don't create additional commits, do
+  <section>
+   <title>Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)</title>
+
+   <para>
+    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
+        xlink:href="https://nixos.org/nixos/manual/index.html#sec-nixos-tests">section
+    in the NixOS manual</link>.
+   </para>
+  </section>
 
-<itemizedlist>
-<listitem>
-<para><command>git rebase -i</command></para>
-</listitem>
-<listitem>
-<para>
-<command>git push --force</command> to your branch.</para>
-</listitem>
-</itemizedlist>
-</para>
-</listitem>
+  <section>
+   <title>Tested compilation of all pkgs that depend on this change using <command>nox-review</command></title>
+
+   <para>
+    If you are updating a package's version, you can use nox to make sure all
+    packages that depend on the updated package still compile correctly. This
+    can be done using the nox utility. The <command>nox-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.
+   </para>
+
+   <para>
+    review uncommitted changes:
+<screen>nix-shell -p nox --run "nox-review wip"</screen>
+   </para>
+
+   <para>
+    review changes from pull request number 12345:
+<screen>nix-shell -p nox --run "nox-review pr 12345"</screen>
+   </para>
+  </section>
 
-</itemizedlist>
-</section>
+  <section>
+   <title>Tested execution of all binary files (usually in <filename>./result/bin/</filename>)</title>
+
+   <para>
+    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.
+   </para>
+  </section>
 
-<section>
-<title>Commit policy</title>
+  <section>
+   <title>Meets nixpkgs contribution standards</title>
 
-<itemizedlist>
-<listitem>
-<para>Commits must be sufficiently tested before being merged, both for the master and staging branches.</para>
-</listitem>
+   <para>
+    The last checkbox is fits
+    <link
+        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.
+   </para>
+  </section>
+ </section>
+ <section>
+  <title>Hotfixing pull requests</title>
 
-<listitem>
-<para>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.</para>
-</listitem>
+  <itemizedlist>
+   <listitem>
+    <para>
+     Make the appropriate changes in you branch.
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     Don't create additional commits, do
+     <itemizedlist>
+      <listitem>
+       <para>
+        <command>git rebase -i</command>
+       </para>
+      </listitem>
+      <listitem>
+       <para>
+        <command>git push --force</command> to your branch.
+       </para>
+      </listitem>
+     </itemizedlist>
+    </para>
+   </listitem>
+  </itemizedlist>
+ </section>
+ <section>
+  <title>Commit policy</title>
 
-<listitem>
-<para>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.</para>
-</listitem>
-</itemizedlist>
+  <itemizedlist>
+   <listitem>
+    <para>
+     Commits must be sufficiently tested before being merged, both for the
+     master and staging branches.
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     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.
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     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.
+    </para>
+   </listitem>
+  </itemizedlist>
 
-<section>
-  <title>Master branch</title>
+  <section>
+   <title>Master branch</title>
 
-  <itemizedlist>
+   <itemizedlist>
     <listitem>
-      <para>
-        It should only see non-breaking commits that do not cause mass rebuilds.
-      </para>
+     <para>
+      It should only see non-breaking commits that do not cause mass rebuilds.
+     </para>
     </listitem>
-  </itemizedlist>
-</section>
+   </itemizedlist>
+  </section>
 
-<section>
-  <title>Staging branch</title>
+  <section>
+   <title>Staging branch</title>
 
-  <itemizedlist>
+   <itemizedlist>
     <listitem>
-      <para>
-        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="http://comments.gmane.org/gmane.linux.distributions.nixos/13447">Read policy here</link>.
-      </para>
+     <para>
+      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="http://comments.gmane.org/gmane.linux.distributions.nixos/13447">Read
+      policy here</link>.
+     </para>
     </listitem>
     <listitem>
-      <para>
-        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.
-      </para>
+     <para>
+      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.
+     </para>
     </listitem>
-  </itemizedlist>
-</section>
+   </itemizedlist>
+  </section>
 
-<section>
-  <title>Stable release branches</title>
+  <section>
+   <title>Stable release branches</title>
 
-  <itemizedlist>
+   <itemizedlist>
     <listitem>
-      <para>
-        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.
-      </para>
-      <para>An example of a cherry-picked commit would look like this:</para>
-      <screen>
+     <para>
+      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.
+     </para>
+     <para>
+      An example of a cherry-picked commit would look like this:
+     </para>
+<screen>
 nixos: Refactor the world.
 
 The original commit message describing the reason why the world was torn apart.
@@ -451,9 +517,7 @@ Reason: I just had a gut feeling that this would also be wanted by people from
 the stone age.
       </screen>
     </listitem>
-  </itemizedlist>
-</section>
-
-</section>
+   </itemizedlist>
+  </section>
+ </section>
 </chapter>
-