about summary refs log tree commit diff
path: root/nixpkgs/doc
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2020-01-11 23:37:02 +0000
committerAlyssa Ross <hi@alyssa.is>2020-01-11 23:41:30 +0000
commit6c557e3f1c28cf87e9fba232811d6875dd1399c1 (patch)
tree035a071d5d8980df6de0fa42e2ef8fc0cce7055e /nixpkgs/doc
parentda7500bc026e937ac7fce7b50f67a0e1765737a7 (diff)
parente4134747f5666bcab8680aff67fa3b63384f9a0f (diff)
downloadnixlib-6c557e3f1c28cf87e9fba232811d6875dd1399c1.tar
nixlib-6c557e3f1c28cf87e9fba232811d6875dd1399c1.tar.gz
nixlib-6c557e3f1c28cf87e9fba232811d6875dd1399c1.tar.bz2
nixlib-6c557e3f1c28cf87e9fba232811d6875dd1399c1.tar.lz
nixlib-6c557e3f1c28cf87e9fba232811d6875dd1399c1.tar.xz
nixlib-6c557e3f1c28cf87e9fba232811d6875dd1399c1.tar.zst
nixlib-6c557e3f1c28cf87e9fba232811d6875dd1399c1.zip
Merge commit 'e4134747f5666bcab8680aff67fa3b63384f9a0f'
Diffstat (limited to 'nixpkgs/doc')
-rw-r--r--nixpkgs/doc/builders/fetchers.xml (renamed from nixpkgs/doc/functions/fetchers.xml)28
-rw-r--r--nixpkgs/doc/builders/images.xml12
-rw-r--r--nixpkgs/doc/builders/images/appimagetools.xml (renamed from nixpkgs/doc/functions/appimagetools.xml)0
-rw-r--r--nixpkgs/doc/builders/images/dockertools.xml (renamed from nixpkgs/doc/functions/dockertools.xml)6
-rw-r--r--nixpkgs/doc/builders/images/ocitools.xml (renamed from nixpkgs/doc/functions/ocitools.xml)0
-rw-r--r--nixpkgs/doc/builders/images/snap/example-firefox.nix (renamed from nixpkgs/doc/functions/snap/example-firefox.nix)0
-rw-r--r--nixpkgs/doc/builders/images/snap/example-hello.nix (renamed from nixpkgs/doc/functions/snap/example-hello.nix)0
-rw-r--r--nixpkgs/doc/builders/images/snaptools.xml (renamed from nixpkgs/doc/functions/snaptools.xml)0
-rw-r--r--nixpkgs/doc/builders/packages/citrix.xml44
-rw-r--r--nixpkgs/doc/builders/packages/dlib.xml24
-rw-r--r--nixpkgs/doc/builders/packages/eclipse.xml72
-rw-r--r--nixpkgs/doc/builders/packages/elm.xml17
-rw-r--r--nixpkgs/doc/builders/packages/emacs.xml131
-rw-r--r--nixpkgs/doc/builders/packages/ibus.xml57
-rw-r--r--nixpkgs/doc/builders/packages/index.xml23
-rw-r--r--nixpkgs/doc/builders/packages/kakoune.xml14
-rw-r--r--nixpkgs/doc/builders/packages/linux.xml85
-rw-r--r--nixpkgs/doc/builders/packages/locales.xml13
-rw-r--r--nixpkgs/doc/builders/packages/nginx.xml25
-rw-r--r--nixpkgs/doc/builders/packages/opengl.xml9
-rw-r--r--nixpkgs/doc/builders/packages/shell-helpers.xml25
-rw-r--r--nixpkgs/doc/builders/packages/steam.xml131
-rw-r--r--nixpkgs/doc/builders/packages/unfree.xml13
-rw-r--r--nixpkgs/doc/builders/packages/weechat.xml85
-rw-r--r--nixpkgs/doc/builders/packages/xorg.xml34
-rw-r--r--nixpkgs/doc/builders/special.xml10
-rw-r--r--nixpkgs/doc/builders/special/fhs-environments.xml (renamed from nixpkgs/doc/functions/fhs-environments.xml)0
-rw-r--r--nixpkgs/doc/builders/special/mkshell.xml (renamed from nixpkgs/doc/functions/shell.xml)0
-rw-r--r--nixpkgs/doc/builders/trivial-builders.xml (renamed from nixpkgs/doc/functions/trivial-builders.xml)29
-rw-r--r--nixpkgs/doc/contributing/coding-conventions.xml (renamed from nixpkgs/doc/coding-conventions.xml)21
-rw-r--r--nixpkgs/doc/contributing/contributing-to-documentation.xml (renamed from nixpkgs/doc/contributing.xml)0
-rw-r--r--nixpkgs/doc/contributing/quick-start.xml (renamed from nixpkgs/doc/quick-start.xml)0
-rw-r--r--nixpkgs/doc/contributing/reviewing-contributions.xml (renamed from nixpkgs/doc/reviewing-contributions.xml)15
-rw-r--r--nixpkgs/doc/contributing/submitting-changes.xml (renamed from nixpkgs/doc/submitting-changes.xml)83
-rw-r--r--nixpkgs/doc/doc-support/parameters.xml2
-rw-r--r--nixpkgs/doc/functions.xml9
-rw-r--r--nixpkgs/doc/languages-frameworks/android.section.md2
-rw-r--r--nixpkgs/doc/languages-frameworks/beam.xml320
-rw-r--r--nixpkgs/doc/languages-frameworks/emscripten.section.md2
-rw-r--r--nixpkgs/doc/languages-frameworks/gnome.xml37
-rw-r--r--nixpkgs/doc/languages-frameworks/go.xml15
-rw-r--r--nixpkgs/doc/languages-frameworks/haskell.section.md65
-rw-r--r--nixpkgs/doc/languages-frameworks/idris.section.md2
-rw-r--r--nixpkgs/doc/languages-frameworks/index.xml6
-rw-r--r--nixpkgs/doc/languages-frameworks/ios.section.md12
-rw-r--r--nixpkgs/doc/languages-frameworks/node.section.md4
-rw-r--r--nixpkgs/doc/languages-frameworks/python.section.md41
-rw-r--r--nixpkgs/doc/languages-frameworks/r.section.md4
-rw-r--r--nixpkgs/doc/languages-frameworks/rust.section.md19
-rw-r--r--nixpkgs/doc/languages-frameworks/texlive.xml91
-rw-r--r--nixpkgs/doc/languages-frameworks/vim.section.md2
-rw-r--r--nixpkgs/doc/manual.xml50
-rw-r--r--nixpkgs/doc/package-notes.xml422
-rw-r--r--nixpkgs/doc/package-specific-user-notes.xml357
-rw-r--r--nixpkgs/doc/preface.chapter.md (renamed from nixpkgs/doc/introduction.chapter.md)27
-rw-r--r--nixpkgs/doc/stdenv/cross-compilation.xml (renamed from nixpkgs/doc/cross-compilation.xml)6
-rw-r--r--nixpkgs/doc/stdenv/meta.xml (renamed from nixpkgs/doc/meta.xml)0
-rw-r--r--nixpkgs/doc/stdenv/multiple-output.xml (renamed from nixpkgs/doc/multiple-output.xml)0
-rw-r--r--nixpkgs/doc/stdenv/platform-notes.xml (renamed from nixpkgs/doc/platform-notes.xml)2
-rw-r--r--nixpkgs/doc/stdenv/stdenv.xml (renamed from nixpkgs/doc/stdenv.xml)16
-rw-r--r--nixpkgs/doc/using/configuration.xml (renamed from nixpkgs/doc/configuration.xml)13
-rw-r--r--nixpkgs/doc/using/overlays.xml (renamed from nixpkgs/doc/overlays.xml)0
-rw-r--r--nixpkgs/doc/using/overrides.xml (renamed from nixpkgs/doc/functions/overrides.xml)12
63 files changed, 1272 insertions, 1272 deletions
diff --git a/nixpkgs/doc/functions/fetchers.xml b/nixpkgs/doc/builders/fetchers.xml
index 369c1fb153eb..f07c310dcdf1 100644
--- a/nixpkgs/doc/functions/fetchers.xml
+++ b/nixpkgs/doc/builders/fetchers.xml
@@ -1,17 +1,14 @@
-<section xmlns="http://docbook.org/ns/docbook"
+<chapter xmlns="http://docbook.org/ns/docbook"
          xmlns:xlink="http://www.w3.org/1999/xlink"
          xmlns:xi="http://www.w3.org/2001/XInclude"
-         xml:id="sec-pkgs-fetchers">
- <title>Fetcher functions</title>
-
+         xml:id="chap-pkgs-fetchers">
+ <title>Fetchers</title>
  <para>
   When using Nix, you will frequently need to download source code and other files from the internet. Nixpkgs comes with a few helper functions that allow you to fetch fixed-output derivations in a structured way.
  </para>
-
  <para>
   The two fetcher primitives are <function>fetchurl</function> and <function>fetchzip</function>. Both of these have two required arguments, a URL and a hash. The hash is typically <literal>sha256</literal>, although many more hash algorithms are supported. Nixpkgs contributors are currently recommended to use <literal>sha256</literal>. This hash will be used by Nix to identify your source. A typical usage of fetchurl is provided below.
  </para>
-
 <programlisting><![CDATA[
 { stdenv, fetchurl }:
 
@@ -23,19 +20,15 @@ stdenv.mkDerivation {
   };
 }
 ]]></programlisting>
-
  <para>
   The main difference between <function>fetchurl</function> and <function>fetchzip</function> is in how they store the contents. <function>fetchurl</function> will store the unaltered contents of the URL within the Nix store. <function>fetchzip</function> on the other hand will decompress the archive for you, making files and directories directly accessible in the future. <function>fetchzip</function> can only be used with archives. Despite the name, <function>fetchzip</function> is not limited to .zip files and can also be used with any tarball.
  </para>
-
  <para>
   <function>fetchpatch</function> works very similarly to <function>fetchurl</function> with the same arguments expected. It expects patch files as a source and and performs normalization on them before computing the checksum. For example it will remove comments or other unstable parts that are sometimes added by version control systems and can change over time.
  </para>
-
  <para>
   Other fetcher functions allow you to add source code directly from a VCS such as subversion or git. These are mostly straightforward names based on the name of the command used with the VCS system. Because they give you a working repository, they act most like <function>fetchzip</function>.
  </para>
-
  <variablelist>
   <varlistentry>
    <term>
@@ -88,11 +81,9 @@ stdenv.mkDerivation {
    </listitem>
   </varlistentry>
  </variablelist>
-
  <para>
   A number of fetcher functions wrap part of <function>fetchurl</function> and <function>fetchzip</function>. They are mainly convenience functions intended for commonly used destinations of source code in Nixpkgs. These wrapper fetchers are listed below.
  </para>
-
  <variablelist>
   <varlistentry>
    <term>
@@ -116,6 +107,17 @@ stdenv.mkDerivation {
   </varlistentry>
   <varlistentry>
    <term>
+    <literal>fetchFromGitiles</literal>
+   </term>
+   <listitem>
+    <para>
+     This is used with Gitiles repositories. The arguments expected
+     are similar to fetchgit.
+    </para>
+   </listitem>
+  </varlistentry>
+  <varlistentry>
+   <term>
     <literal>fetchFromBitbucket</literal>
    </term>
    <listitem>
@@ -145,4 +147,4 @@ stdenv.mkDerivation {
    </listitem>
   </varlistentry>
  </variablelist>
-</section>
+</chapter>
diff --git a/nixpkgs/doc/builders/images.xml b/nixpkgs/doc/builders/images.xml
new file mode 100644
index 000000000000..5e042a8ada80
--- /dev/null
+++ b/nixpkgs/doc/builders/images.xml
@@ -0,0 +1,12 @@
+<chapter xmlns="http://docbook.org/ns/docbook"
+         xmlns:xi="http://www.w3.org/2001/XInclude"
+         xml:id="chap-images">
+ <title>Images</title>
+ <para>
+  This chapter describes tools for creating various types of images.
+ </para>
+ <xi:include href="images/appimagetools.xml" />
+ <xi:include href="images/dockertools.xml" />
+ <xi:include href="images/ocitools.xml" />
+ <xi:include href="images/snaptools.xml" />
+</chapter>
diff --git a/nixpkgs/doc/functions/appimagetools.xml b/nixpkgs/doc/builders/images/appimagetools.xml
index 37e4251cda2e..37e4251cda2e 100644
--- a/nixpkgs/doc/functions/appimagetools.xml
+++ b/nixpkgs/doc/builders/images/appimagetools.xml
diff --git a/nixpkgs/doc/functions/dockertools.xml b/nixpkgs/doc/builders/images/dockertools.xml
index 2243453c3e97..e7f37fdaaf00 100644
--- a/nixpkgs/doc/functions/dockertools.xml
+++ b/nixpkgs/doc/builders/images/dockertools.xml
@@ -8,12 +8,6 @@
   <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.
-  </para>
- </warning>
-
  <section xml:id="ssec-pkgs-dockerTools-buildImage">
   <title>buildImage</title>
 
diff --git a/nixpkgs/doc/functions/ocitools.xml b/nixpkgs/doc/builders/images/ocitools.xml
index f61075b242f8..f61075b242f8 100644
--- a/nixpkgs/doc/functions/ocitools.xml
+++ b/nixpkgs/doc/builders/images/ocitools.xml
diff --git a/nixpkgs/doc/functions/snap/example-firefox.nix b/nixpkgs/doc/builders/images/snap/example-firefox.nix
index d58c98a65a2e..d58c98a65a2e 100644
--- a/nixpkgs/doc/functions/snap/example-firefox.nix
+++ b/nixpkgs/doc/builders/images/snap/example-firefox.nix
diff --git a/nixpkgs/doc/functions/snap/example-hello.nix b/nixpkgs/doc/builders/images/snap/example-hello.nix
index 123da80c5477..123da80c5477 100644
--- a/nixpkgs/doc/functions/snap/example-hello.nix
+++ b/nixpkgs/doc/builders/images/snap/example-hello.nix
diff --git a/nixpkgs/doc/functions/snaptools.xml b/nixpkgs/doc/builders/images/snaptools.xml
index 422fcfa37d88..422fcfa37d88 100644
--- a/nixpkgs/doc/functions/snaptools.xml
+++ b/nixpkgs/doc/builders/images/snaptools.xml
diff --git a/nixpkgs/doc/builders/packages/citrix.xml b/nixpkgs/doc/builders/packages/citrix.xml
new file mode 100644
index 000000000000..c629dc9ee503
--- /dev/null
+++ b/nixpkgs/doc/builders/packages/citrix.xml
@@ -0,0 +1,44 @@
+<section xmlns="http://docbook.org/ns/docbook"
+         xmlns:xlink="http://www.w3.org/1999/xlink"
+         xml:id="sec-citrix">
+ <title>Citrix Workspace</title>
+
+ <para>
+  <note>
+   <para>
+    Please note that the <literal>citrix_receiver</literal> package has been deprecated since its development was <link xlink:href="https://docs.citrix.com/en-us/citrix-workspace-app.html">discontinued by upstream</link> and has been replaced by <link xlink:href="https://www.citrix.com/products/workspace-app/">the citrix workspace app</link>.
+   </para>
+  </note>
+  <link xlink:href="https://www.citrix.com/products/receiver/">Citrix Receiver</link> and <link xlink:href="https://www.citrix.com/products/workspace-app/">Citrix Workspace App</link> are a remote desktop viewers which provide access to <link xlink:href="https://www.citrix.com/products/xenapp-xendesktop/">XenDesktop</link> installations.
+ </para>
+
+ <section xml:id="sec-citrix-base">
+  <title>Basic usage</title>
+
+  <para>
+   The tarball archive needs to be downloaded manually as the license agreements of the vendor for <link xlink:href="https://www.citrix.com/downloads/citrix-receiver/">Citrix Receiver</link> or <link xlink:href="https://www.citrix.de/downloads/workspace-app/linux/workspace-app-for-linux-latest.html">Citrix Workspace</link> need to be accepted first. Then run <command>nix-prefetch-url file://$PWD/linuxx64-$version.tar.gz</command>. With the archive available in the store the package can be built and installed with Nix.
+  </para>
+
+  <warning>
+   <title>Caution with <command>nix-shell</command> installs</title>
+   <para>
+    It's recommended to install <literal>Citrix Receiver</literal> and/or <literal>Citrix Workspace</literal> using <literal>nix-env -i</literal> or globally to ensure that the <literal>.desktop</literal> files are installed properly into <literal>$XDG_CONFIG_DIRS</literal>. Otherwise it won't be possible to open <literal>.ica</literal> files automatically from the browser to start a Citrix connection.
+   </para>
+  </warning>
+ </section>
+
+ <section xml:id="sec-citrix-custom-certs">
+  <title>Custom certificates</title>
+
+  <para>
+   The <literal>Citrix Workspace App</literal> in <literal>nixpkgs</literal> trust several certificates <link xlink:href="https://curl.haxx.se/docs/caextract.html">from the Mozilla database</link> by default. However several companies using Citrix might require their own corporate certificate. On distros with imperative packaging these certs can be stored easily in <link xlink:href="https://developer-docs.citrix.com/projects/receiver-for-linux-command-reference/en/13.7/"><literal>$ICAROOT</literal></link>, however this directory is a store path in <literal>nixpkgs</literal>. In order to work around this issue the package provides a simple mechanism to add custom certificates without rebuilding the entire package using <literal>symlinkJoin</literal>:
+<programlisting>
+<![CDATA[with import <nixpkgs> { config.allowUnfree = true; };
+let extraCerts = [ ./custom-cert-1.pem ./custom-cert-2.pem /* ... */ ]; in
+citrix_workspace.override {
+  inherit extraCerts;
+}]]>
+</programlisting>
+  </para>
+ </section>
+</section>
diff --git a/nixpkgs/doc/builders/packages/dlib.xml b/nixpkgs/doc/builders/packages/dlib.xml
new file mode 100644
index 000000000000..5f768dd51b62
--- /dev/null
+++ b/nixpkgs/doc/builders/packages/dlib.xml
@@ -0,0 +1,24 @@
+<section xmlns="http://docbook.org/ns/docbook"
+         xmlns:xlink="http://www.w3.org/1999/xlink"
+         xml:id="dlib">
+ <title>DLib</title>
+
+ <para>
+  <link xlink:href="http://dlib.net/">DLib</link> is a modern, C++-based toolkit which provides several machine learning algorithms.
+ </para>
+
+ <section xml:id="compiling-without-avx-support">
+  <title>Compiling without AVX support</title>
+
+  <para>
+   Especially older CPUs don't support <link xlink:href="https://en.wikipedia.org/wiki/Advanced_Vector_Extensions">AVX</link> (<abbrev>Advanced Vector Extensions</abbrev>) instructions that are used by DLib to optimize their algorithms.
+  </para>
+
+  <para>
+   On the affected hardware errors like <literal>Illegal instruction</literal> will occur. In those cases AVX support needs to be disabled:
+<programlisting>self: super: {
+  dlib = super.dlib.override { avxSupport = false; };
+}</programlisting>
+  </para>
+ </section>
+</section>
diff --git a/nixpkgs/doc/builders/packages/eclipse.xml b/nixpkgs/doc/builders/packages/eclipse.xml
new file mode 100644
index 000000000000..fc5094ed8f36
--- /dev/null
+++ b/nixpkgs/doc/builders/packages/eclipse.xml
@@ -0,0 +1,72 @@
+<section xmlns="http://docbook.org/ns/docbook"
+         xmlns:xlink="http://www.w3.org/1999/xlink"
+         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>.
+ </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:
+<screen>
+<prompt>$ </prompt>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.
+ </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
+<screen>
+packageOverrides = pkgs: {
+  myEclipse = with pkgs.eclipses; eclipseWithPlugins {
+    eclipse = eclipse-platform;
+    jvmArgs = [ "-Xmx2048m" ];
+    plugins = [ plugins.color-theme ];
+  };
+}
+</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
+<screen>
+<prompt>$ </prompt>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.
+ </para>
+
+ <para>
+  Expanding the previous example with two plugins using the above functions we have
+<screen>
+packageOverrides = pkgs: {
+  myEclipse = with pkgs.eclipses; eclipseWithPlugins {
+    eclipse = eclipse-platform;
+    jvmArgs = [ "-Xmx2048m" ];
+    plugins = [
+      plugins.color-theme
+      (plugins.buildEclipsePlugin {
+        name = "myplugin1-1.0";
+        srcFeature = fetchurl {
+          url = "http://…/features/myplugin1.jar";
+          sha256 = "123…";
+        };
+        srcPlugin = fetchurl {
+          url = "http://…/plugins/myplugin1.jar";
+          sha256 = "123…";
+        };
+      });
+      (plugins.buildEclipseUpdateSite {
+        name = "myplugin2-1.0";
+        src = fetchurl {
+          stripRoot = false;
+          url = "http://…/myplugin2.zip";
+          sha256 = "123…";
+        };
+      });
+    ];
+  };
+}
+</screen>
+ </para>
+</section>
diff --git a/nixpkgs/doc/builders/packages/elm.xml b/nixpkgs/doc/builders/packages/elm.xml
new file mode 100644
index 000000000000..a067f6c7c70e
--- /dev/null
+++ b/nixpkgs/doc/builders/packages/elm.xml
@@ -0,0 +1,17 @@
+<section xmlns="http://docbook.org/ns/docbook"
+         xmlns:xlink="http://www.w3.org/1999/xlink"
+         xml:id="sec-elm">
+ <title>Elm</title>
+
+ <para>
+  To start a development environment do <command>nix-shell -p elmPackages.elm elmPackages.elm-format</command>
+ </para>
+
+ <para>
+  To update Elm compiler, see <filename>nixpkgs/pkgs/development/compilers/elm/README.md</filename>.
+ </para>
+
+ <para>
+  To package Elm applications, <link xlink:href="https://github.com/hercules-ci/elm2nix#elm2nix">read about elm2nix</link>.
+ </para>
+</section>
diff --git a/nixpkgs/doc/builders/packages/emacs.xml b/nixpkgs/doc/builders/packages/emacs.xml
new file mode 100644
index 000000000000..9cce7c40863a
--- /dev/null
+++ b/nixpkgs/doc/builders/packages/emacs.xml
@@ -0,0 +1,131 @@
+<section xmlns="http://docbook.org/ns/docbook"
+         xmlns:xlink="http://www.w3.org/1999/xlink"
+         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>
+{
+  packageOverrides = pkgs: with pkgs; {
+    myEmacs = emacsWithPackages (epkgs: (with epkgs.melpaStablePackages; [
+      company
+      counsel
+      flycheck
+      ivy
+      magit
+      projectile
+      use-package
+    ]));
+  }
+}
+</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>
+
+<screen>
+{
+  packageOverrides = pkgs: with pkgs; rec {
+    myEmacsConfig = writeText "default.el" ''
+;; initialize package
+
+(require 'package)
+(package-initialize 'noactivate)
+(eval-when-compile
+  (require 'use-package))
+
+;; load some packages
+
+(use-package company
+  :bind ("&lt;C-tab&gt;" . company-complete)
+  :diminish company-mode
+  :commands (company-mode global-company-mode)
+  :defer 1
+  :config
+  (global-company-mode))
+
+(use-package counsel
+  :commands (counsel-descbinds)
+  :bind (([remap execute-extended-command] . counsel-M-x)
+         ("C-x C-f" . counsel-find-file)
+         ("C-c g" . counsel-git)
+         ("C-c j" . counsel-git-grep)
+         ("C-c k" . counsel-ag)
+         ("C-x l" . counsel-locate)
+         ("M-y" . counsel-yank-pop)))
+
+(use-package flycheck
+  :defer 2
+  :config (global-flycheck-mode))
+
+(use-package ivy
+  :defer 1
+  :bind (("C-c C-r" . ivy-resume)
+         ("C-x C-b" . ivy-switch-buffer)
+         :map ivy-minibuffer-map
+         ("C-j" . ivy-call))
+  :diminish ivy-mode
+  :commands ivy-mode
+  :config
+  (ivy-mode 1))
+
+(use-package magit
+  :defer
+  :if (executable-find "git")
+  :bind (("C-x g" . magit-status)
+         ("C-x G" . magit-dispatch-popup))
+  :init
+  (setq magit-completing-read-function 'ivy-completing-read))
+
+(use-package projectile
+  :commands projectile-mode
+  :bind-keymap ("C-c p" . projectile-command-map)
+  :defer 5
+  :config
+  (projectile-global-mode))
+    '';
+    myEmacs = emacsWithPackages (epkgs: (with epkgs.melpaStablePackages; [
+      (runCommand "default.el" {} ''
+mkdir -p $out/share/emacs/site-lisp
+cp ${myEmacsConfig} $out/share/emacs/site-lisp/default.el
+'')
+      company
+      counsel
+      flycheck
+      ivy
+      magit
+      projectile
+      use-package
+    ]));
+  };
+}
+</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>
+
+<screen>
+overrides = self: super: rec {
+  haskell-mode = self.melpaPackages.haskell-mode;
+  ...
+};
+((emacsPackagesGen emacs).overrideScope' overrides).emacsWithPackages (p: with p; [
+  # here both these package will use haskell-mode of our own choice
+  ghc-mod
+  dante
+])
+</screen>
+ </section>
+</section>
diff --git a/nixpkgs/doc/builders/packages/ibus.xml b/nixpkgs/doc/builders/packages/ibus.xml
new file mode 100644
index 000000000000..2ed37903a273
--- /dev/null
+++ b/nixpkgs/doc/builders/packages/ibus.xml
@@ -0,0 +1,57 @@
+<section xmlns="http://docbook.org/ns/docbook"
+         xmlns:xlink="http://www.w3.org/1999/xlink"
+         xml:id="sec-ibus-typing-booster">
+ <title>ibus-engines.typing-booster</title>
+
+ <para>
+  This package is an ibus-based completion method to speed up typing.
+ </para>
+
+ <section xml:id="sec-ibus-typing-booster-activate">
+  <title>Activating the engine</title>
+
+  <para>
+   IBus needs to be configured accordingly to activate <literal>typing-booster</literal>. The configuration depends on the desktop manager in use. For detailed instructions, please refer to the <link xlink:href="https://mike-fabian.github.io/ibus-typing-booster/documentation.html">upstream docs</link>.
+  </para>
+
+  <para>
+   On NixOS you need to explicitly enable <literal>ibus</literal> with given engines before customizing your desktop to use <literal>typing-booster</literal>. This can be achieved using the <literal>ibus</literal> module:
+<programlisting>{ pkgs, ... }: {
+  i18n.inputMethod = {
+    enabled = "ibus";
+    ibus.engines = with pkgs.ibus-engines; [ typing-booster ];
+  };
+}</programlisting>
+  </para>
+ </section>
+
+ <section xml:id="sec-ibus-typing-booster-customize-hunspell">
+  <title>Using custom hunspell dictionaries</title>
+
+  <para>
+   The IBus engine is based on <literal>hunspell</literal> to support completion in many languages. By default the dictionaries <literal>de-de</literal>, <literal>en-us</literal>, <literal>fr-moderne</literal> <literal>es-es</literal>, <literal>it-it</literal>, <literal>sv-se</literal> and <literal>sv-fi</literal> are in use. To add another dictionary, the package can be overridden like this:
+<programlisting>ibus-engines.typing-booster.override {
+  langs = [ "de-at" "en-gb" ];
+}</programlisting>
+  </para>
+
+  <para>
+   <emphasis>Note: each language passed to <literal>langs</literal> must be an attribute name in <literal>pkgs.hunspellDicts</literal>.</emphasis>
+  </para>
+ </section>
+
+ <section xml:id="sec-ibus-typing-booster-emoji-picker">
+  <title>Built-in emoji picker</title>
+
+  <para>
+   The <literal>ibus-engines.typing-booster</literal> package contains a program named <literal>emoji-picker</literal>. To display all emojis correctly, a special font such as <literal>noto-fonts-emoji</literal> is needed:
+  </para>
+
+  <para>
+   On NixOS it can be installed using the following expression:
+<programlisting>{ pkgs, ... }: {
+  fonts.fonts = with pkgs; [ noto-fonts-emoji ];
+}</programlisting>
+  </para>
+ </section>
+</section>
diff --git a/nixpkgs/doc/builders/packages/index.xml b/nixpkgs/doc/builders/packages/index.xml
new file mode 100644
index 000000000000..9f3f58a8d903
--- /dev/null
+++ b/nixpkgs/doc/builders/packages/index.xml
@@ -0,0 +1,23 @@
+<chapter xmlns="http://docbook.org/ns/docbook"
+         xmlns:xi="http://www.w3.org/2001/XInclude"
+         xml:id="chap-packages">
+ <title>Packages</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>
+ <xi:include href="citrix.xml" />
+ <xi:include href="dlib.xml" />
+ <xi:include href="eclipse.xml" />
+ <xi:include href="elm.xml" />
+ <xi:include href="emacs.xml" />
+ <xi:include href="ibus.xml" />
+ <xi:include href="kakoune.xml" />
+ <xi:include href="linux.xml" />
+ <xi:include href="locales.xml" />
+ <xi:include href="nginx.xml" />
+ <xi:include href="opengl.xml" />
+ <xi:include href="shell-helpers.xml" />
+ <xi:include href="steam.xml" />
+ <xi:include href="weechat.xml" />
+ <xi:include href="xorg.xml" />
+</chapter>
diff --git a/nixpkgs/doc/builders/packages/kakoune.xml b/nixpkgs/doc/builders/packages/kakoune.xml
new file mode 100644
index 000000000000..728d40dacc92
--- /dev/null
+++ b/nixpkgs/doc/builders/packages/kakoune.xml
@@ -0,0 +1,14 @@
+<section xmlns="http://docbook.org/ns/docbook"
+         xmlns:xlink="http://www.w3.org/1999/xlink"
+         xml:id="sec-kakoune">
+ <title>Kakoune</title>
+
+ <para>
+  Kakoune can be built to autoload plugins:
+<programlisting>(kakoune.override {
+  configure = {
+    plugins = with pkgs.kakounePlugins; [ parinfer-rust ];
+  };
+})</programlisting>
+ </para>
+</section>
diff --git a/nixpkgs/doc/builders/packages/linux.xml b/nixpkgs/doc/builders/packages/linux.xml
new file mode 100644
index 000000000000..72d0e21493b3
--- /dev/null
+++ b/nixpkgs/doc/builders/packages/linux.xml
@@ -0,0 +1,85 @@
+<section xmlns="http://docbook.org/ns/docbook"
+         xmlns:xlink="http://www.w3.org/1999/xlink"
+         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 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>
+  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>
+<prompt>$ </prompt>nix-env -i ncurses
+<prompt>$ </prompt>export NIX_CFLAGS_LINK=-lncurses
+<prompt>$ </prompt>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>
+     </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>
diff --git a/nixpkgs/doc/builders/packages/locales.xml b/nixpkgs/doc/builders/packages/locales.xml
new file mode 100644
index 000000000000..44fdef034e77
--- /dev/null
+++ b/nixpkgs/doc/builders/packages/locales.xml
@@ -0,0 +1,13 @@
+<section xmlns="http://docbook.org/ns/docbook"
+         xmlns:xlink="http://www.w3.org/1999/xlink"
+         xml:id="locales">
+ <title>Locales</title>
+
+ <para>
+  To allow simultaneous use of packages linked against different versions of <literal>glibc</literal> with different locale archive formats Nixpkgs patches <literal>glibc</literal> to rely on <literal>LOCALE_ARCHIVE</literal> environment variable.
+ </para>
+
+ <para>
+  On non-NixOS distributions this variable is obviously not set. This can cause regressions in language support or even crashes in some Nixpkgs-provided programs. The simplest way to mitigate this problem is exporting the <literal>LOCALE_ARCHIVE</literal> variable pointing to <literal>${glibcLocales}/lib/locale/locale-archive</literal>. The drawback (and the reason this is not the default) is the relatively large (a hundred MiB) size of the full set of locales. It is possible to build a custom set of locales by overriding parameters <literal>allLocales</literal> and <literal>locales</literal> of the package.
+ </para>
+</section>
diff --git a/nixpkgs/doc/builders/packages/nginx.xml b/nixpkgs/doc/builders/packages/nginx.xml
new file mode 100644
index 000000000000..65854ba02366
--- /dev/null
+++ b/nixpkgs/doc/builders/packages/nginx.xml
@@ -0,0 +1,25 @@
+<section xmlns="http://docbook.org/ns/docbook"
+         xmlns:xlink="http://www.w3.org/1999/xlink"
+         xml:id="sec-nginx">
+ <title>Nginx</title>
+
+ <para>
+  <link xlink:href="https://nginx.org/">Nginx</link> is a reverse proxy and lightweight webserver.
+ </para>
+
+ <section xml:id="sec-nginx-etag">
+  <title>ETags on static files served from the Nix store</title>
+
+  <para>
+   HTTP has a couple different mechanisms for caching to prevent clients from having to download the same content repeatedly if a resource has not changed since the last time it was requested. When nginx is used as a server for static files, it implements the caching mechanism based on the <link xlink:href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Last-Modified"><literal>Last-Modified</literal></link> response header automatically; unfortunately, it works by using filesystem timestamps to determine the value of the <literal>Last-Modified</literal> header. This doesn't give the desired behavior when the file is in the Nix store, because all file timestamps are set to 0 (for reasons related to build reproducibility).
+  </para>
+
+  <para>
+   Fortunately, HTTP supports an alternative (and more effective) caching mechanism: the <link xlink:href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag"><literal>ETag</literal></link> response header. The value of the <literal>ETag</literal> header specifies some identifier for the particular content that the server is sending (e.g. a hash). When a client makes a second request for the same resource, it sends that value back in an <literal>If-None-Match</literal> header. If the ETag value is unchanged, then the server does not need to resend the content.
+  </para>
+
+  <para>
+   As of NixOS 19.09, the nginx package in Nixpkgs is patched such that when nginx serves a file out of <filename>/nix/store</filename>, the hash in the store path is used as the <literal>ETag</literal> header in the HTTP response, thus providing proper caching functionality. This happens automatically; you do not need to do modify any configuration to get this behavior.
+  </para>
+ </section>
+</section>
diff --git a/nixpkgs/doc/builders/packages/opengl.xml b/nixpkgs/doc/builders/packages/opengl.xml
new file mode 100644
index 000000000000..5f4433a28844
--- /dev/null
+++ b/nixpkgs/doc/builders/packages/opengl.xml
@@ -0,0 +1,9 @@
+<section xmlns="http://docbook.org/ns/docbook"
+         xmlns:xlink="http://www.w3.org/1999/xlink"
+         xml:id="sec-opengl">
+ <title>OpenGL</title>
+
+ <para>
+  Packages that use OpenGL have NixOS desktop as their primary target. The current solution for loading the GPU-specific drivers is based on <literal>libglvnd</literal> and looks for the driver implementation in <literal>LD_LIBRARY_PATH</literal>. If you are using a non-NixOS GNU/Linux/X11 desktop with free software video drivers, consider launching OpenGL-dependent programs from Nixpkgs with Nixpkgs versions of <literal>libglvnd</literal> and <literal>mesa_drivers</literal> in <literal>LD_LIBRARY_PATH</literal>. For proprietary video drivers you might have luck with also adding the corresponding video driver package.
+ </para>
+</section>
diff --git a/nixpkgs/doc/builders/packages/shell-helpers.xml b/nixpkgs/doc/builders/packages/shell-helpers.xml
new file mode 100644
index 000000000000..cb70d527d67b
--- /dev/null
+++ b/nixpkgs/doc/builders/packages/shell-helpers.xml
@@ -0,0 +1,25 @@
+<section xmlns="http://docbook.org/ns/docbook"
+         xmlns:xlink="http://www.w3.org/1999/xlink"
+         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:
+  <itemizedlist>
+   <listitem>
+    <para>
+     <literal>autojump</literal>: <command>autojump-share</command>
+    </para>
+   </listitem>
+   <listitem>
+    <para>
+     <literal>fzf</literal>: <command>fzf-share</command>
+    </para>
+   </listitem>
+  </itemizedlist>
+  E.g. <literal>autojump</literal> can then used in the .bashrc like this:
+<screen>
+  source "$(autojump-share)/autojump.bash"
+</screen>
+ </para>
+</section>
diff --git a/nixpkgs/doc/builders/packages/steam.xml b/nixpkgs/doc/builders/packages/steam.xml
new file mode 100644
index 000000000000..8dfede59ac1b
--- /dev/null
+++ b/nixpkgs/doc/builders/packages/steam.xml
@@ -0,0 +1,131 @@
+<section xmlns="http://docbook.org/ns/docbook"
+         xmlns:xlink="http://www.w3.org/1999/xlink"
+         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 or other Steam supported controllers such as the DualShock 4 or Nintendo Switch Pro, you need to add
+<programlisting>hardware.steam-hardware.enable = true;</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
+<programlisting>pkgs.(steam.override {
+          nativeOnly = true;
+          newStdcpp = true;
+        }).run</programlisting>
+   to your configuration, rebuild, and run the game with
+<programlisting>steam-run ./foo</programlisting>
+  </para>
+ </section>
+</section>
diff --git a/nixpkgs/doc/builders/packages/unfree.xml b/nixpkgs/doc/builders/packages/unfree.xml
new file mode 100644
index 000000000000..3d4f199f8fb0
--- /dev/null
+++ b/nixpkgs/doc/builders/packages/unfree.xml
@@ -0,0 +1,13 @@
+<section xmlns="http://docbook.org/ns/docbook"
+         xmlns:xlink="http://www.w3.org/1999/xlink"
+         xml:id="unfree-software">
+ <title>Unfree software</title>
+
+ <para>
+  All users of Nixpkgs are free software users, and many users (and developers) of Nixpkgs want to limit and tightly control their exposure to unfree software. At the same time, many users need (or want) to run some specific pieces of proprietary software. Nixpkgs includes some expressions for unfree software packages. By default unfree software cannot be installed and doesn’t show up in searches. To allow installing unfree software in a single Nix invocation one can export <literal>NIXPKGS_ALLOW_UNFREE=1</literal>. For a persistent solution, users can set <literal>allowUnfree</literal> in the Nixpkgs configuration.
+ </para>
+
+ <para>
+  Fine-grained control is possible by defining <literal>allowUnfreePredicate</literal> function in config; it takes the <literal>mkDerivation</literal> parameter attrset and returns <literal>true</literal> for unfree packages that should be allowed.
+ </para>
+</section>
diff --git a/nixpkgs/doc/builders/packages/weechat.xml b/nixpkgs/doc/builders/packages/weechat.xml
new file mode 100644
index 000000000000..a110d3f491c7
--- /dev/null
+++ b/nixpkgs/doc/builders/packages/weechat.xml
@@ -0,0 +1,85 @@
+<section xmlns="http://docbook.org/ns/docbook"
+         xmlns:xlink="http://www.w3.org/1999/xlink"
+         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
+<programlisting>weechat.override {configure = {availablePlugins, ...}: {
+    plugins = with availablePlugins; [ python perl ];
+  }
+}</programlisting>
+  If the <literal>configure</literal> function returns an attrset without the <literal>plugins</literal> attribute, <literal>availablePlugins</literal> will be used automatically.
+ </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 and perl plugins allows the addition of extra libraries. For instance, the <literal>inotify.py</literal> script in weechat-scripts requires D-Bus or libnotify, and the <literal>fish.py</literal> script requires pycrypto. To use these scripts, use the plugin's <literal>withPackages</literal> attribute:
+<programlisting>weechat.override { configure = {availablePlugins, ...}: {
+    plugins = with availablePlugins; [
+            (python.withPackages (ps: with ps; [ pycrypto python-dbus ]))
+        ];
+    };
+}
+</programlisting>
+ </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>
+
+ <para>
+  WeeChat allows to set defaults on startup using the <literal>--run-command</literal>. The <literal>configure</literal> method can be used to pass commands to the program:
+<programlisting>weechat.override {
+  configure = { availablePlugins, ... }: {
+    init = ''
+      /set foo bar
+      /server add freenode chat.freenode.org
+    '';
+  };
+}</programlisting>
+  Further values can be added to the list of commands when running <literal>weechat --run-command "your-commands"</literal>.
+ </para>
+
+ <para>
+  Additionally it's possible to specify scripts to be loaded when starting <literal>weechat</literal>. These will be loaded before the commands from <literal>init</literal>:
+<programlisting>weechat.override {
+  configure = { availablePlugins, ... }: {
+    scripts = with pkgs.weechatScripts; [
+      weechat-xmpp weechat-matrix-bridge wee-slack
+    ];
+    init = ''
+      /set plugins.var.python.jabber.key "val"
+    '':
+  };
+}</programlisting>
+ </para>
+
+ <para>
+  In <literal>nixpkgs</literal> there's a subpackage which contains derivations for WeeChat scripts. Such derivations expect a <literal>passthru.scripts</literal> attribute which contains a list of all scripts inside the store path. Furthermore all scripts have to live in <literal>$out/share</literal>. An exemplary derivation looks like this:
+<programlisting>{ stdenv, fetchurl }:
+
+stdenv.mkDerivation {
+  name = "exemplary-weechat-script";
+  src = fetchurl {
+    url = "https://scripts.tld/your-scripts.tar.gz";
+    sha256 = "...";
+  };
+  passthru.scripts = [ "foo.py" "bar.lua" ];
+  installPhase = ''
+    mkdir $out/share
+    cp foo.py $out/share
+    cp bar.lua $out/share
+  '';
+}</programlisting>
+ </para>
+</section>
diff --git a/nixpkgs/doc/builders/packages/xorg.xml b/nixpkgs/doc/builders/packages/xorg.xml
new file mode 100644
index 000000000000..ebf4930cc097
--- /dev/null
+++ b/nixpkgs/doc/builders/packages/xorg.xml
@@ -0,0 +1,34 @@
+<section xmlns="http://docbook.org/ns/docbook"
+         xmlns:xlink="http://www.w3.org/1999/xlink"
+         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:
+<screen>
+<prompt>$ </prompt>cd pkgs/servers/x11/xorg
+<prompt>$ </prompt>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>
+
+ <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>
+<prompt>$ </prompt>export i="mirror://xorg/X11R7.4/src/everything/"
+<prompt>$ </prompt>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>
+
+ <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>
diff --git a/nixpkgs/doc/builders/special.xml b/nixpkgs/doc/builders/special.xml
new file mode 100644
index 000000000000..15fdba9a0419
--- /dev/null
+++ b/nixpkgs/doc/builders/special.xml
@@ -0,0 +1,10 @@
+<chapter xmlns="http://docbook.org/ns/docbook"
+         xmlns:xi="http://www.w3.org/2001/XInclude"
+         xml:id="chap-special">
+ <title>Special builders</title>
+ <para>
+  This chapter describes several special builders.
+ </para>
+ <xi:include href="special/fhs-environments.xml" />
+ <xi:include href="special/mkshell.xml" />
+</chapter>
diff --git a/nixpkgs/doc/functions/fhs-environments.xml b/nixpkgs/doc/builders/special/fhs-environments.xml
index e7b81e97a23f..e7b81e97a23f 100644
--- a/nixpkgs/doc/functions/fhs-environments.xml
+++ b/nixpkgs/doc/builders/special/fhs-environments.xml
diff --git a/nixpkgs/doc/functions/shell.xml b/nixpkgs/doc/builders/special/mkshell.xml
index cef65d06b882..cef65d06b882 100644
--- a/nixpkgs/doc/functions/shell.xml
+++ b/nixpkgs/doc/builders/special/mkshell.xml
diff --git a/nixpkgs/doc/functions/trivial-builders.xml b/nixpkgs/doc/builders/trivial-builders.xml
index ae9f3a1b255d..94948c57b91f 100644
--- a/nixpkgs/doc/functions/trivial-builders.xml
+++ b/nixpkgs/doc/builders/trivial-builders.xml
@@ -1,15 +1,13 @@
-<section xmlns="http://docbook.org/ns/docbook"
+<chapter xmlns="http://docbook.org/ns/docbook"
          xmlns:xlink="http://www.w3.org/1999/xlink"
          xmlns:xi="http://www.w3.org/2001/XInclude"
-         xml:id="sec-trivial-builders">
+         xml:id="chap-trivial-builders">
  <title>Trivial builders</title>
-
  <para>
   Nixpkgs provides a couple of functions that help with building derivations. The most important one, <function>stdenv.mkDerivation</function>, has already been documented above. The following functions wrap <function>stdenv.mkDerivation</function>, making it easier to use in certain cases.
  </para>
-
  <variablelist>
-  <varlistentry>
+  <varlistentry xml:id="trivial-builder-runCommand">
    <term>
     <literal>runCommand</literal>
    </term>
@@ -42,7 +40,7 @@
 </programlisting>
    </listitem>
   </varlistentry>
-  <varlistentry>
+  <varlistentry xml:id="trivial-builder-runCommandCC">
    <term>
     <literal>runCommandCC</literal>
    </term>
@@ -52,7 +50,20 @@
     </para>
    </listitem>
   </varlistentry>
-  <varlistentry>
+  <varlistentry xml:id="trivial-builder-runCommandLocal">
+   <term>
+    <literal>runCommandLocal</literal>
+   </term>
+   <listitem>
+    <para>
+     Variant of <literal>runCommand</literal> that forces the derivation to be built locally, it is not substituted. This is intended for very cheap commands (&lt;1s execution time). It saves on the network roundrip and can speed up a build.
+    </para>
+    <note><para>
+      This sets <link xlink:href="https://nixos.org/nix/manual/#adv-attr-allowSubstitutes"><literal>allowSubstitutes</literal> to <literal>false</literal></link>, so only use <literal>runCommandLocal</literal> if you are certain the user will always have a builder for the <literal>system</literal> of the derivation. This should be true for most trivial use cases (e.g. just copying some files to a different location or adding symlinks), because there the <literal>system</literal> is usually the same as <literal>builtins.currentSystem</literal>.
+    </para></note>
+   </listitem>
+  </varlistentry>
+  <varlistentry xml:id="trivial-builder-writeText">
    <term>
     <literal>writeTextFile</literal>, <literal>writeText</literal>, <literal>writeTextDir</literal>, <literal>writeScript</literal>, <literal>writeScriptBin</literal>
    </term>
@@ -65,7 +76,7 @@
     </para>
    </listitem>
   </varlistentry>
-  <varlistentry>
+  <varlistentry xml:id="trivial-builder-symlinkJoin">
    <term>
     <literal>symlinkJoin</literal>
    </term>
@@ -76,4 +87,4 @@
    </listitem>
   </varlistentry>
  </variablelist>
-</section>
+</chapter>
diff --git a/nixpkgs/doc/coding-conventions.xml b/nixpkgs/doc/contributing/coding-conventions.xml
index 799f1479467a..fcb6501f6159 100644
--- a/nixpkgs/doc/coding-conventions.xml
+++ b/nixpkgs/doc/contributing/coding-conventions.xml
@@ -622,6 +622,16 @@ args.stdenv.mkDerivation (args // {
        </varlistentry>
        <varlistentry>
         <term>
+         If it’s an <emphasis>icon theme</emphasis>:
+        </term>
+        <listitem>
+         <para>
+          <filename>data/icons</filename>
+         </para>
+        </listitem>
+       </varlistentry>
+       <varlistentry>
+        <term>
          If it’s related to <emphasis>SGML/XML processing</emphasis>:
         </term>
         <listitem>
@@ -652,6 +662,17 @@ args.stdenv.mkDerivation (args // {
          </variablelist>
         </listitem>
        </varlistentry>
+       <varlistentry>
+        <term>
+         If it’s a <emphasis>theme</emphasis> for a <emphasis>desktop environment</emphasis>,
+         a <emphasis>window manager</emphasis> or a <emphasis>display manager</emphasis>:
+        </term>
+        <listitem>
+         <para>
+          <filename>data/themes</filename>
+         </para>
+        </listitem>
+       </varlistentry>
       </variablelist>
      </listitem>
     </varlistentry>
diff --git a/nixpkgs/doc/contributing.xml b/nixpkgs/doc/contributing/contributing-to-documentation.xml
index b0266043775f..b0266043775f 100644
--- a/nixpkgs/doc/contributing.xml
+++ b/nixpkgs/doc/contributing/contributing-to-documentation.xml
diff --git a/nixpkgs/doc/quick-start.xml b/nixpkgs/doc/contributing/quick-start.xml
index 80514cba4904..80514cba4904 100644
--- a/nixpkgs/doc/quick-start.xml
+++ b/nixpkgs/doc/contributing/quick-start.xml
diff --git a/nixpkgs/doc/reviewing-contributions.xml b/nixpkgs/doc/contributing/reviewing-contributions.xml
index 5a14684f9b1e..fe79d8d992b1 100644
--- a/nixpkgs/doc/reviewing-contributions.xml
+++ b/nixpkgs/doc/contributing/reviewing-contributions.xml
@@ -2,7 +2,7 @@
         xmlns:xlink="http://www.w3.org/1999/xlink"
         xmlns:xi="http://www.w3.org/2001/XInclude"
         version="5.0"
-        xml:id="sec-reviewing-contributions">
+        xml:id="chap-reviewing-contributions">
  <title>Reviewing contributions</title>
  <warning>
   <para>
@@ -115,19 +115,12 @@
       <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>
-<prompt>$ </prompt>git remote add channels https://github.com/NixOS/nixpkgs-channels.git <co
-  xml:id='reviewing-rebase-1' />
-<prompt>$ </prompt>git fetch channels nixos-unstable <co xml:id='reviewing-rebase-2' />
+<prompt>$ </prompt>git fetch origin nixos-unstable <co xml:id='reviewing-rebase-2' />
 <prompt>$ </prompt>git fetch origin pull/PRNUMBER/head <co xml:id='reviewing-rebase-3' />
 <prompt>$ </prompt>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.
@@ -148,10 +141,10 @@
      </listitem>
      <listitem>
       <para>
-       The <link xlink:href="https://github.com/Mic92/nix-review">nix-review</link> tool can be used to review a pull request content in a single command. <varname>PRNUMBER</varname> should be replaced by the number at the end of the pull request title. You can also provide the full github pull request url.
+       The <link xlink:href="https://github.com/Mic92/nixpkgs-review">nixpkgs-review</link> tool can be used to review a pull request content in a single command. <varname>PRNUMBER</varname> should be replaced by the number at the end of the pull request title. You can also provide the full github pull request url.
       </para>
 <screen>
-<prompt>$ </prompt>nix-shell -p nix-review --run "nix-review pr PRNUMBER"
+<prompt>$ </prompt>nix-shell -p nixpkgs-review --run "nixpkgs-review pr PRNUMBER"
 </screen>
      </listitem>
     </itemizedlist>
diff --git a/nixpkgs/doc/submitting-changes.xml b/nixpkgs/doc/contributing/submitting-changes.xml
index 2c7defb81749..f283ae1e6851 100644
--- a/nixpkgs/doc/submitting-changes.xml
+++ b/nixpkgs/doc/contributing/submitting-changes.xml
@@ -228,6 +228,33 @@ Additional information.
    </listitem>
   </itemizedlist>
  </section>
+ <section xml:id="submitting-changes-submitting-security-fixes">
+  <title>Submitting security fixes</title>
+
+  <para>
+   Security fixes are submitted in the same way as other changes and thus the same guidelines apply.
+  </para>
+
+  <para>
+   If the security fix comes in the form of a patch and a CVE is available, then the name of the patch should be the CVE identifier, so e.g. <literal>CVE-2019-13636.patch</literal> in the case of a patch that is included in the Nixpkgs tree. If a patch is fetched the name needs to be set as well, e.g.:
+  </para>
+
+<programlisting>
+   (fetchpatch {
+     name = "CVE-2019-11068.patch";
+     url = "https://gitlab.gnome.org/GNOME/libxslt/commit/e03553605b45c88f0b4b2980adfbbb8f6fca2fd6.patch";
+     sha256 = "0pkpb4837km15zgg6h57bncp66d5lwrlvkr73h0lanywq7zrwhj8";
+   })
+  </programlisting>
+
+  <para>
+   If a security fix applies to both master and a stable release then, similar to regular changes, they are preferably delivered via master first and cherry-picked to the release branch.
+  </para>
+
+  <para>
+   Critical security fixes may by-pass the staging branches and be delivered directly to release branches such as <literal>master</literal> and <literal>release-*</literal>.
+  </para>
+ </section>
  <section xml:id="submitting-changes-pull-request-template">
   <title>Pull Request Template</title>
 
@@ -290,20 +317,25 @@ Additional information.
   </section>
 
   <section xml:id="submitting-changes-tested-compilation">
-   <title>Tested compilation of all pkgs that depend on this change using <command>nix-review</command></title>
+   <title>Tested compilation of all pkgs that depend on this change using <command>nixpkgs-review</command></title>
 
    <para>
-    If you are updating a package's version, you can use nix-review to make sure all packages that depend on the updated package still compile correctly. The <command>nix-review</command> utility can look for and build all dependencies either based on uncommited changes with the <literal>wip</literal> option or specifying a github pull request number.
+    If you are updating a package's version, you can use nixpkgs-review to make sure all packages that depend on the updated package still compile correctly. The <command>nixpkgs-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 changes from pull request number 12345:
-<screen>nix-shell -p nix-review --run "nix-review pr 12345"</screen>
+    <screen>nix run nixpkgs.nixpkgs-review -c nixpkgs-review pr 12345</screen>
    </para>
 
    <para>
     review uncommitted changes:
-<screen>nix-shell -p nix-review --run "nix-review wip"</screen>
+    <screen>nix run nixpkgs.nixpkgs-review -c nixpkgs-review wip</screen>
+   </para>
+
+   <para>
+    review changes from last commit:
+    <screen>nix run nixpkgs.nixpkgs-review -c nixpkgs-review rev HEAD</screen>
    </para>
   </section>
 
@@ -375,31 +407,32 @@ Additional information.
 
   <section xml:id="submitting-changes-master-branch">
    <title>Master branch</title>
-
-   <itemizedlist>
-    <listitem>
-     <para>
-      It should only see non-breaking commits that do not cause mass rebuilds.
-     </para>
-    </listitem>
-   </itemizedlist>
+   <para>
+    The <literal>master</literal> branch is the main development branch.
+    It should only see non-breaking commits that do not cause mass rebuilds.
+   </para>
   </section>
 
   <section xml:id="submitting-changes-staging-branch">
    <title>Staging branch</title>
+   <para>
+    The <literal>staging</literal> branch is a development branch where mass-rebuilds go.
+    It should only see non-breaking mass-rebuild commits.
+    That means it is not to be used for testing, and changes must have been well tested already.
+    If the branch is already in a broken state, please refrain from adding extra new breakages.
+   </para>
+  </section>
 
-   <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="https://web.archive.org/web/20160528180406/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>
-    </listitem>
-   </itemizedlist>
+  <section xml:id="submitting-changes-staging-next-branch">
+   <title>Staging-next branch</title>
+   <para>
+    The <literal>staging-next</literal> branch is for stabilizing mass-rebuilds submitted to the <literal>staging</literal> branch prior to merging them into <literal>master</literal>.
+    Mass-rebuilds should go via the <literal>staging</literal> branch.
+    It should only see non-breaking commits that are fixing issues blocking it from being merged into the <literal>master </literal> branch.
+   </para>
+   <para>
+    If the branch is already in a broken state, please refrain from adding extra new breakages. Stabilize it for a few days and then merge into master.
+   </para>
   </section>
 
   <section xml:id="submitting-changes-stable-release-branches">
@@ -408,7 +441,7 @@ Additional information.
    <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.
+      If you're cherry-picking a commit to a stable release branch (“backporting”), 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:
diff --git a/nixpkgs/doc/doc-support/parameters.xml b/nixpkgs/doc/doc-support/parameters.xml
index bc13e2b70dec..e4b33e66ee4d 100644
--- a/nixpkgs/doc/doc-support/parameters.xml
+++ b/nixpkgs/doc/doc-support/parameters.xml
@@ -8,7 +8,7 @@
  <xsl:param name="html.script" select="'./highlightjs/highlight.pack.js ./highlightjs/loader.js'" />
  <xsl:param name="xref.with.number.and.title" select="1" />
  <xsl:param name="use.id.as.filename" select="1" />
- <xsl:param name="toc.section.depth" select="3" />
+ <xsl:param name="toc.section.depth" select="0" />
  <xsl:param name="admon.style" select="''" />
  <xsl:param name="callout.graphics.extension" select="'.svg'" />
 </xsl:stylesheet>
diff --git a/nixpkgs/doc/functions.xml b/nixpkgs/doc/functions.xml
index 3e126e6b1397..5a9240ec800e 100644
--- a/nixpkgs/doc/functions.xml
+++ b/nixpkgs/doc/functions.xml
@@ -7,17 +7,8 @@
   The nixpkgs repository has several utility functions to manipulate Nix expressions.
  </para>
  <xi:include href="functions/library.xml" />
- <xi:include href="functions/overrides.xml" />
  <xi:include href="functions/generators.xml" />
  <xi:include href="functions/debug.xml" />
- <xi:include href="functions/fetchers.xml" />
- <xi:include href="functions/trivial-builders.xml" />
- <xi:include href="functions/fhs-environments.xml" />
- <xi:include href="functions/shell.xml" />
- <xi:include href="functions/dockertools.xml" />
- <xi:include href="functions/snaptools.xml" />
- <xi:include href="functions/appimagetools.xml" />
  <xi:include href="functions/prefer-remote-fetch.xml" />
  <xi:include href="functions/nix-gitignore.xml" />
- <xi:include href="functions/ocitools.xml" />
 </chapter>
diff --git a/nixpkgs/doc/languages-frameworks/android.section.md b/nixpkgs/doc/languages-frameworks/android.section.md
index f268c5525660..9a5df2523a25 100644
--- a/nixpkgs/doc/languages-frameworks/android.section.md
+++ b/nixpkgs/doc/languages-frameworks/android.section.md
@@ -95,7 +95,7 @@ $ nix-build
 
 The Android SDK gets deployed with all desired plugin versions.
 
-We can also deploy subsets of the Android SDK. For example, to only the the
+We can also deploy subsets of the Android SDK. For example, to only the
 `platform-tools` package, you can evaluate the following expression:
 
 ```nix
diff --git a/nixpkgs/doc/languages-frameworks/beam.xml b/nixpkgs/doc/languages-frameworks/beam.xml
index 65f28d0a2d3b..278535237c2c 100644
--- a/nixpkgs/doc/languages-frameworks/beam.xml
+++ b/nixpkgs/doc/languages-frameworks/beam.xml
@@ -26,7 +26,7 @@
    </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>.
+     <literal>packages</literal>: a set of package builders (Mix and rebar3), each compiled with a specific Erlang/OTP version, e.g. <literal>beam.packages.erlangR19</literal>.
     </para>
    </listitem>
   </itemizedlist>
@@ -36,15 +36,11 @@
   </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>.
+   To create a package builder built with a custom Erlang version, use the lambda, <literal>beam.packagesWith</literal>, which accepts an Erlang/OTP derivation and produces a package builder 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.
+   Many Erlang/OTP distributions available in <literal>beam.interpreters</literal> have versions with ODBC and/or Java enabled or without wx (no observer support). For example, there's <literal>beam.interpreters.erlangR22_odbc_javac</literal>, which corresponds to <literal>beam.interpreters.erlangR22</literal> and <literal>beam.interpreters.erlangR22_nox</literal>, which corresponds to <literal>beam.interpreters.erlangR22</literal>.
   </para>
  </section>
 
@@ -55,20 +51,7 @@
    <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>
+    We provide a version of Rebar3, under <literal>rebar3</literal>. We also provide a helper to fetch Rebar3 dependencies from a lockfile under <literal>fetchRebar3Deps</literal>.
    </para>
   </section>
 
@@ -85,32 +68,14 @@
   <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:
-  </para>
-
-<screen>
-<prompt>$ </prompt>nix-env -f &quot;&lt;nixpkgs&gt;&quot; -qaP -A beamPackages
-beamPackages.esqlite    esqlite-0.2.1
-beamPackages.goldrush   goldrush-0.1.7
-beamPackages.ibrowse    ibrowse-4.2.2
-beamPackages.jiffy      jiffy-0.14.5
-beamPackages.lager      lager-3.0.2
-beamPackages.meck       meck-0.8.3
-beamPackages.rebar3-pc  pc-1.1.0
-</screen>
-
-  <para>
-   To install any of those packages into your profile, refer to them by their attribute path (first column):
+   BEAM builders are not registered at the top level, simply because they are not relevant to the vast majority of Nix users. 
+   To install any of those builders into your profile, refer to them by their attribute path <literal>beamPackages.rebar3</literal>:
   </para>
 
-<screen>
-<prompt>$ </prompt>nix-env -f &quot;&lt;nixpkgs&gt;&quot; -iA beamPackages.ibrowse
-</screen>
-
-  <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.
-  </para>
- </section>
+  <screen>
+  <prompt>$ </prompt>nix-env -f &quot;&lt;nixpkgs&gt;&quot; -iA beamPackages.rebar3
+  </screen>
+</section>
 
  <section xml:id="packaging-beam-applications">
   <title>Packaging BEAM Applications</title>
@@ -122,35 +87,7 @@ beamPackages.rebar3-pc  pc-1.1.0
     <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 {
-  name = "hex2nix";
-  version = "0.0.1";
-
-  src = fetchFromGitHub {
-    owner = "ericbmerritt";
-    repo = "hex2nix";
-    rev = "${version}";
-    sha256 = "1w7xjidz1l5yjmhlplfx7kphmnpvqm67w99hd2m7kdixwdxq0zqg";
-  };
-
-  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.
+     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.
     </para>
 
     <para>
@@ -165,30 +102,6 @@ buildRebar3 rec {
      Erlang.mk functions similarly to Rebar3, except we use <literal>buildErlangMk</literal> instead of <literal>buildRebar3</literal>.
     </para>
 
-<programlisting>
-{ buildErlangMk, fetchHex, cowlib, ranch }:
-
-buildErlangMk {
-  name = "cowboy";
-  version = "1.0.4";
-
-  src = fetchHex {
-    pkg = "cowboy";
-    version = "1.0.4";
-    sha256 = "6a0edee96885fae3a8dd0ac1f333538a42e807db638a9453064ccfdaa6b9fdac";
-  };
-
-  beamDeps = [ cowlib ranch ];
-
-  meta = {
-    description = ''
-      Small, fast, modular HTTP server written in Erlang
-    '';
-    license = stdenv.lib.licenses.isc;
-    homepage = https://github.com/ninenines/cowboy;
-  };
-}
-</programlisting>
    </section>
 
    <section xml:id="mix-packages">
@@ -198,57 +111,9 @@ buildErlangMk {
      Mix functions similarly to Rebar3, except we use <literal>buildMix</literal> instead of <literal>buildRebar3</literal>.
     </para>
 
-<programlisting>
-{ buildMix, fetchHex, plug, absinthe }:
-
-buildMix {
-  name = "absinthe_plug";
-  version = "1.0.0";
-
-  src = fetchHex {
-    pkg = "absinthe_plug";
-    version = "1.0.0";
-    sha256 = "08459823fe1fd4f0325a8bf0c937a4520583a5a26d73b193040ab30a1dfc0b33";
-  };
-
-  beamDeps = [ plug absinthe ];
-
-  meta = {
-    description = ''
-      A plug for Absinthe, an experimental GraphQL toolkit
-    '';
-    license = stdenv.lib.licenses.bsd3;
-    homepage = https://github.com/CargoSense/absinthe_plug;
-  };
-}
-</programlisting>
-
     <para>
      Alternatively, we can use <literal>buildHex</literal> as a shortcut:
     </para>
-
-<programlisting>
-{ buildHex, buildMix, plug, absinthe }:
-
-buildHex {
-  name = "absinthe_plug";
-  version = "1.0.0";
-
-  sha256 = "08459823fe1fd4f0325a8bf0c937a4520583a5a26d73b193040ab30a1dfc0b33";
-
-  builder = buildMix;
-
-  beamDeps = [ plug absinthe ];
-
-  meta = {
-    description = ''
-      A plug for Absinthe, an experimental GraphQL toolkit
-    '';
-    license = stdenv.lib.licenses.bsd3;
-    homepage = https://github.com/CargoSense/absinthe_plug;
- };
-}
-</programlisting>
    </section>
   </section>
  </section>
@@ -256,66 +121,13 @@ buildHex {
  <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>
-
-<screen>
-<prompt>$ </prompt><userinput>nix-shell -A beamPackages.ibrowse.env --run "erl"</userinput>
-<computeroutput>Erlang/OTP 18 [erts-7.0] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]
-
-Eshell V7.0  (abort with ^G)</computeroutput>
-<prompt>1> </prompt><userinput>m(ibrowse).</userinput>
-<computeroutput>Module: ibrowse
-MD5: 3b3e0137d0cbb28070146978a3392945
-Compiled: January 10 2016, 23:34
-Object file: /nix/store/g1rlf65rdgjs4abbyj4grp37ry7ywivj-ibrowse-4.2.2/lib/erlang/lib/ibrowse-4.2.2/ebin/ibrowse.beam
-Compiler options:  [{outdir,"/tmp/nix-build-ibrowse-4.2.2.drv-0/hex-source-ibrowse-4.2.2/_build/default/lib/ibrowse/ebin"},
-debug_info,debug_info,nowarn_shadow_vars,
-warn_unused_import,warn_unused_vars,warnings_as_errors,
-{i,"/tmp/nix-build-ibrowse-4.2.2.drv-0/hex-source-ibrowse-4.2.2/_build/default/lib/ibrowse/include"}]
-Exports:
-add_config/1                  send_req_direct/7
-all_trace_off/0               set_dest/3
-code_change/3                 set_max_attempts/3
-get_config_value/1            set_max_pipeline_size/3
-get_config_value/2            set_max_sessions/3
-get_metrics/0                 show_dest_status/0
-get_metrics/2                 show_dest_status/1
-handle_call/3                 show_dest_status/2
-handle_cast/2                 spawn_link_worker_process/1
-handle_info/2                 spawn_link_worker_process/2
-init/1                        spawn_worker_process/1
-module_info/0                 spawn_worker_process/2
-module_info/1                 start/0
-rescan_config/0               start_link/0
-rescan_config/1               stop/0
-send_req/3                    stop_worker_process/1
-send_req/4                    stream_close/1
-send_req/5                    stream_next/1
-send_req/6                    terminate/2
-send_req_direct/4             trace_off/0
-send_req_direct/5             trace_off/2
-send_req_direct/6             trace_on/0
-trace_on/2
-ok</computeroutput>
-<prompt>2></prompt>
-</screen>
-
-   <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>
+  <para>
+    Usually, we need to create a <literal>shell.nix</literal> file and do our development inside of the environment specified therein. Just install your version of erlang and other interpreter, and then user your normal build tools.
+    As an example with elixir:
+  </para>
 
 <programlisting>
 { pkgs ? import &quot;&lt;nixpkgs&quot;&gt; {} }:
@@ -324,114 +136,24 @@ with pkgs;
 
 let
 
-  f = { buildRebar3, ibrowse, jsx, erlware_commons }:
-      buildRebar3 {
-        name = "hex2nix";
-        version = "0.1.0";
-        src = ./.;
-        beamDeps = [ ibrowse jsx erlware_commons ];
-      };
-  drv = beamPackages.callPackage f {};
+  elixir = beam.packages.erlangR22.elixir_1_9;
 
 in
+mkShell {
+  buildInputs = [ elixir ];
 
-  drv
+  ERL_INCLUDE_PATH="${erlang}/lib/erlang/usr/include";
+}
 </programlisting>
 
    <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.
-    </para>
-
-<programlisting>
-# =============================================================================
-# Variables
-# =============================================================================
-
-NIX_TEMPLATES := "$(CURDIR)/nix-templates"
-
-TARGET := "$(PREFIX)"
-
-PROJECT_NAME := thorndyke
-
-NIXPKGS=../nixpkgs
-NIX_PATH=nixpkgs=$(NIXPKGS)
-NIX_SHELL=nix-shell -I "$(NIX_PATH)" --pure
-# =============================================================================
-# Rules
-# =============================================================================
-.PHONY= all test clean repl shell build test analyze configure install \
-        test-nix-install publish plt analyze
-
-all: build
-
-guard-%:
-        @ if [ "${${*}}" == "" ]; then \
-                echo "Environment variable $* not set"; \
-                exit 1; \
-        fi
-
-clean:
-        rm -rf _build
-        rm -rf .cache
-
-repl:
-        $(NIX_SHELL) --run "iex -pa './_build/prod/lib/*/ebin'"
-
-shell:
-        $(NIX_SHELL)
-
-configure:
-        $(NIX_SHELL) --command 'eval "$$configurePhase"'
-
-build: configure
-        $(NIX_SHELL) --command 'eval "$$buildPhase"'
-
-install:
-        $(NIX_SHELL) --command 'eval "$$installPhase"'
-
-test:
-        $(NIX_SHELL) --command 'mix test --no-start --no-deps-check'
-
-plt:
-        $(NIX_SHELL) --run "mix dialyzer.plt --no-deps-check"
-
-analyze: build plt
-        $(NIX_SHELL) --run "mix dialyzer --no-compile"
-
-</programlisting>
-
-    <para>
      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.
+      linkend="creating-a-shell"/>) should just work.
     </para>
    </section>
   </section>
  </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>
-
-<screen>
-<prompt>$ </prompt>nix-build -A beamPackages
-</screen>
-
-  <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/nixpkgs/doc/languages-frameworks/emscripten.section.md b/nixpkgs/doc/languages-frameworks/emscripten.section.md
index 24c49ec1409c..80e1094809ad 100644
--- a/nixpkgs/doc/languages-frameworks/emscripten.section.md
+++ b/nixpkgs/doc/languages-frameworks/emscripten.section.md
@@ -1,4 +1,4 @@
-# User's Guide to Emscripten in Nixpkgs
+# Emscripten
 
 [Emscripten](https://github.com/kripken/emscripten): An LLVM-to-JavaScript Compiler
 
diff --git a/nixpkgs/doc/languages-frameworks/gnome.xml b/nixpkgs/doc/languages-frameworks/gnome.xml
index 9e0f21a6c74f..bb68d026ae23 100644
--- a/nixpkgs/doc/languages-frameworks/gnome.xml
+++ b/nixpkgs/doc/languages-frameworks/gnome.xml
@@ -32,7 +32,11 @@
    <title>Icons</title>
 
    <para>
-    When an application uses icons, an icon theme should be available in <envar>XDG_DATA_DIRS</envar>. The package for the default, icon-less <link xlink:href="https://www.freedesktop.org/wiki/Software/icon-theme/">hicolor-icon-theme</link> contains <link linkend="ssec-gnome-hooks-hicolor-icon-theme">a setup hook</link> that will pick up icon themes from <literal>buildInputs</literal> and pass it to our wrapper. Unfortunately, relying on that would mean every user has to download the theme included in the package expression no matter their preference. For that reason, we leave the installation of icon theme on the user. If you use one of the desktop environments, you probably already have an icon theme installed.
+    When an application uses icons, an icon theme should be available in <envar>XDG_DATA_DIRS</envar> during runtime. The package for the default, icon-less <link xlink:href="https://www.freedesktop.org/wiki/Software/icon-theme/">hicolor-icon-theme</link> (should be propagated by every icon theme) contains <link linkend="ssec-gnome-hooks-hicolor-icon-theme">a setup hook</link> that will pick up icon themes from <literal>buildInputs</literal> and pass it to our wrapper. Unfortunately, relying on that would mean every user has to download the theme included in the package expression no matter their preference. For that reason, we leave the installation of icon theme on the user. If you use one of the desktop environments, you probably already have an icon theme installed.
+   </para>
+
+   <para>
+    To avoid costly file system access when locating icons, GTK, <link xlink:href="https://woboq.com/blog/qicon-reads-gtk-icon-cache-in-qt57.html">as well as Qt</link>, can rely on <filename>icon-theme.cache</filename> files from the themes’ top-level directories. These files are generated using <command>gtk-update-icon-cache</command>, which is expected to be run whenever an icon is added or removed to an icon theme (typically an application icon into <literal>hicolor</literal> theme) and some programs do indeed run this after icon installation. However, since packages are installed into their own prefix by Nix, this would lead to conflicts. For that reason, <package>gtk3</package> provides a <link xlink:href="#ssec-gnome-hooks-gtk-drop-icon-theme-cache">setup hook</link> that will clean the file from installation. Since most applications only ship their own icon that will be loaded on start-up, it should not affect them too much. On the other hand, icon themes are much larger and more widely used so we need to cache them. Because we recommend installing icon themes globally, we will generate the cache files from all packages in a profile using a NixOS module. You can enable the cache generation using <option>gtk.iconCache.enable</option> option if your desktop environment does not already do that.
    </para>
   </section>
 
@@ -70,7 +74,7 @@
 preFixup = ''
   for f in $(find $out/bin/ $out/libexec/ -type f -executable); do
     wrapProgram "$f" \
-      --prefix GIO_EXTRA_MODULES : "${getLib gnome3.dconf}/lib/gio/modules" \
+      --prefix GIO_EXTRA_MODULES : "${getLib dconf}/lib/gio/modules" \
       --prefix XDG_DATA_DIRS : "$out/share" \
       --prefix XDG_DATA_DIRS : "$out/share/gsettings-schemas/${name}" \
       --prefix XDG_DATA_DIRS : "${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}" \
@@ -91,9 +95,14 @@ preFixup = ''
       <package>glib</package> setup hook will populate <envar>GSETTINGS_SCHEMAS_PATH</envar> and then <package>wrapGAppsHook</package> will prepend it to <envar>XDG_DATA_DIRS</envar>.
      </para>
     </listitem>
+    <listitem xml:id="ssec-gnome-hooks-gtk-drop-icon-theme-cache">
+     <para>
+      One of <package>gtk3</package>’s setup hooks will remove <filename>icon-theme.cache</filename> files from package’s icon theme directories to avoid conflicts. Icon theme packages should prevent this with <code>dontDropIconThemeCache = true;</code>.
+     </para>
+    </listitem>
     <listitem xml:id="ssec-gnome-hooks-dconf">
      <para>
-      <package>gnome3.dconf.lib</package> is a dependency of <package>wrapGAppsHook</package>, which then also adds it to the <envar>GIO_EXTRA_MODULES</envar> variable.
+      <package>dconf.lib</package> is a dependency of <package>wrapGAppsHook</package>, which then also adds it to the <envar>GIO_EXTRA_MODULES</envar> variable.
      </para>
     </listitem>
     <listitem xml:id="ssec-gnome-hooks-hicolor-icon-theme">
@@ -190,9 +199,9 @@ python3.pkgs.buildPythonApplication {
   dontWrapGApps = true;
 
   # Arguments to be passed to `makeWrapper`, only used by buildPython*
-  makeWrapperArgs = [
-    "\${gappsWrapperArgs[@]}"
-  ];
+  preFixup = ''
+    makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
+  '';
 }
 </programlisting>
       And for a QT app like:
@@ -210,9 +219,9 @@ mkDerivation {
   dontWrapGApps = true;
 
   # Arguments to be passed to `makeWrapper`, only used by qt5’s mkDerivation
-  qtWrapperArgs [
-    "\${gappsWrapperArgs[@]}"
-  ];
+  preFixup = ''
+    qtWrapperArgs+=("''${gappsWrapperArgs[@]}")
+  '';
 }
 </programlisting>
      </para>
@@ -258,6 +267,16 @@ mkDerivation {
      </para>
     </listitem>
    </varlistentry>
+   <varlistentry xml:id="ssec-gnome-common-issues-weird-location">
+    <term>
+     I need to wrap a binary outside <filename>bin</filename> and <filename>libexec</filename> directories.
+    </term>
+    <listitem>
+     <para>
+      You can manually trigger the wrapping with <function>wrapGApp</function> in <literal>preFixup</literal> phase. It takes a path to a program as a first argument; the remaining arguments are passed directly to <function xlink:href="#fun-wrapProgram">wrapProgram</function> function.
+     </para>
+    </listitem>
+   </varlistentry>
   </variablelist>
  </section>
 </section>
diff --git a/nixpkgs/doc/languages-frameworks/go.xml b/nixpkgs/doc/languages-frameworks/go.xml
index 288a90298631..e8cf27d05652 100644
--- a/nixpkgs/doc/languages-frameworks/go.xml
+++ b/nixpkgs/doc/languages-frameworks/go.xml
@@ -26,7 +26,7 @@
    <title>buildGoModule</title>
 <programlisting>
 pet = buildGoModule rec {
-  name = "pet-${version}";
+  pname = "pet";
   version = "0.3.4";
 
   src = fetchFromGitHub {
@@ -66,6 +66,15 @@ pet = buildGoModule rec {
     </callout>
    </calloutlist>
   </para>
+
+  <para>
+    <varname>modSha256</varname> can also take <varname>null</varname> as an input.
+
+    When `null` is used as a value, the derivation won't be a
+    fixed-output derivation but disable the build sandbox instead. This can be useful outside
+    of nixpkgs where re-generating the modSha256 on each mod.sum changes is cumbersome,
+    but will fail to build by Hydra, as builds with a disabled sandbox are discouraged.
+  </para>
  </section>
 
  <section xml:id="ssec-go-legacy">
@@ -79,7 +88,7 @@ pet = buildGoModule rec {
    <title>buildGoPackage</title>
 <programlisting>
 deis = buildGoPackage rec {
-  name = "deis-${version}";
+  pname = "deis";
   version = "1.13.0";
 
   goPackagePath = "github.com/deis/deis"; <co xml:id='ex-buildGoPackage-1' />
@@ -94,7 +103,7 @@ deis = buildGoPackage rec {
 
   goDeps = ./deps.nix; <co xml:id='ex-buildGoPackage-3' />
 
-  buildFlags = "--tags release"; <co xml:id='ex-buildGoPackage-4' />
+  buildFlags = [ "--tags" "release" ]; <co xml:id='ex-buildGoPackage-4' />
 }
 </programlisting>
   </example>
diff --git a/nixpkgs/doc/languages-frameworks/haskell.section.md b/nixpkgs/doc/languages-frameworks/haskell.section.md
index 48d22831cd9b..b485ec583ec3 100644
--- a/nixpkgs/doc/languages-frameworks/haskell.section.md
+++ b/nixpkgs/doc/languages-frameworks/haskell.section.md
@@ -3,7 +3,7 @@ title: User's Guide for Haskell in Nixpkgs
 author: Peter Simons
 date: 2015-06-01
 ---
-# User's Guide to the Haskell Infrastructure
+# Haskell
 
 
 ## How to install Haskell packages
@@ -25,14 +25,14 @@ avoided that by keeping all Haskell-related packages in a separate attribute
 set called `haskellPackages`, which the following command will list:
 ```
 $ nix-env -f "<nixpkgs>" -qaP -A haskellPackages
-haskellPackages.a50         a50-0.5
-haskellPackages.abacate     haskell-abacate-0.0.0.0
-haskellPackages.abcBridge   haskell-abcBridge-0.12
-haskellPackages.afv         afv-0.1.1
-haskellPackages.alex        alex-3.1.4
-haskellPackages.Allure      Allure-0.4.101.1
-haskellPackages.alms        alms-0.6.7
-[... some 8000 entries omitted  ...]
+haskellPackages.a50                                             a50-0.5
+haskellPackages.AAI                                             AAI-0.2.0.1
+haskellPackages.abacate                                         abacate-0.0.0.0
+haskellPackages.abc-puzzle                                      abc-puzzle-0.2.1
+haskellPackages.abcBridge                                       abcBridge-0.15
+haskellPackages.abcnotation                                     abcnotation-1.9.0
+haskellPackages.abeson                                          abeson-0.1.0.1
+[... some 14000 entries omitted  ...]
 ```
 
 To install any of those packages into your profile, refer to them by their
@@ -84,36 +84,37 @@ nix-env -qaP -A nixos.haskellPackages
 nix-env -iA nixos.haskellPackages.cabal-install
 ```
 
-Our current default compiler is GHC 7.10.x and the `haskellPackages` set
-contains packages built with that particular version. Nixpkgs contains the
-latest major release of every GHC since 6.10.4, however, and there is a whole
-family of package sets available that defines Hackage packages built with each
-of those compilers, too:
+Our current default compiler is GHC 8.6.x and the `haskellPackages` set
+contains packages built with that particular version. Nixpkgs contains the last
+three major releases of GHC and there is a whole family of package sets
+available that defines Hackage packages built with each of those compilers,
+too:
 ```shell
-nix-env -f "<nixpkgs>" -qaP -A haskell.packages.ghc6123
-nix-env -f "<nixpkgs>" -qaP -A haskell.packages.ghc763
+nix-env -f "<nixpkgs>" -qaP -A haskell.packages.ghc844
+nix-env -f "<nixpkgs>" -qaP -A haskell.packages.ghc882
 ```
 
 The name `haskellPackages` is really just a synonym for
-`haskell.packages.ghc7102`, because we prefer that package set internally and
+`haskell.packages.ghc865`, because we prefer that package set internally and
 recommend it to our users as their default choice, but ultimately you are free
 to compile your Haskell packages with any GHC version you please. The following
 command displays the complete list of available compilers:
 ```
 $ nix-env -f "<nixpkgs>" -qaP -A haskell.compiler
-haskell.compiler.ghc6104        ghc-6.10.4
-haskell.compiler.ghc6123        ghc-6.12.3
-haskell.compiler.ghc704         ghc-7.0.4
-haskell.compiler.ghc722         ghc-7.2.2
-haskell.compiler.ghc742         ghc-7.4.2
-haskell.compiler.ghc763         ghc-7.6.3
-haskell.compiler.ghc784         ghc-7.8.4
-haskell.compiler.ghc7102        ghc-7.10.2
-haskell.compiler.ghcHEAD        ghc-7.11.20150402
-haskell.compiler.ghcNokinds     ghc-nokinds-7.11.20150704
-haskell.compiler.ghcjs          ghcjs-0.1.0
-haskell.compiler.jhc            jhc-0.8.2
-haskell.compiler.uhc            uhc-1.1.9.0
+haskell.compiler.ghc8101                 ghc-8.10.0.20191210
+haskell.compiler.integer-simple.ghc8101  ghc-8.10.0.20191210
+haskell.compiler.ghcHEAD                 ghc-8.10.20191119
+haskell.compiler.integer-simple.ghcHEAD  ghc-8.10.20191119
+haskell.compiler.ghc822Binary            ghc-8.2.2-binary
+haskell.compiler.ghc844                  ghc-8.4.4
+haskell.compiler.ghc863Binary            ghc-8.6.3-binary
+haskell.compiler.ghc865                  ghc-8.6.5
+haskell.compiler.integer-simple.ghc865   ghc-8.6.5
+haskell.compiler.ghc881                  ghc-8.8.1
+haskell.compiler.integer-simple.ghc881   ghc-8.8.1
+haskell.compiler.ghc882                  ghc-8.8.1.20191211
+haskell.compiler.integer-simple.ghc882   ghc-8.8.1.20191211
+haskell.compiler.ghcjs                   ghcjs-8.6.0.1
 ```
 
 We have no package sets for `jhc` or `uhc` yet, unfortunately, but for every
@@ -398,7 +399,9 @@ nix:
 For more on how to write a `shell.nix` file see the below section. You'll need
 to express a derivation. Note that Nixpkgs ships with a convenience wrapper
 function around `mkDerivation` called `haskell.lib.buildStackProject` to help you
-create this derivation in exactly the way Stack expects. All of the same inputs
+create this derivation in exactly the way Stack expects. However for this to work
+you need to disable the sandbox, which you can do by using `--option sandbox relaxed`
+or `--option sandbox false` to the Nix command. All of the same inputs
 as `mkDerivation` can be provided. For example, to build a Stack project that
 including packages that link against a version of the R library compiled with
 special options turned on:
diff --git a/nixpkgs/doc/languages-frameworks/idris.section.md b/nixpkgs/doc/languages-frameworks/idris.section.md
index e88015f08e3f..8d7962d7fb9b 100644
--- a/nixpkgs/doc/languages-frameworks/idris.section.md
+++ b/nixpkgs/doc/languages-frameworks/idris.section.md
@@ -1,4 +1,4 @@
-# Idris packages
+# Idris
 
 ## Installing Idris
 
diff --git a/nixpkgs/doc/languages-frameworks/index.xml b/nixpkgs/doc/languages-frameworks/index.xml
index cd0b48adb14a..9364c764bbf9 100644
--- a/nixpkgs/doc/languages-frameworks/index.xml
+++ b/nixpkgs/doc/languages-frameworks/index.xml
@@ -1,7 +1,7 @@
 <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>
+ <title>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>
@@ -9,6 +9,8 @@
  <xi:include href="beam.xml" />
  <xi:include href="bower.xml" />
  <xi:include href="coq.xml" />
+ <xi:include href="crystal.section.xml" />
+ <xi:include href="emscripten.section.xml" />
  <xi:include href="gnome.xml" />
  <xi:include href="go.xml" />
  <xi:include href="haskell.section.xml" />
@@ -27,6 +29,4 @@
  <xi:include href="texlive.xml" />
  <xi:include href="titanium.section.xml" />
  <xi:include href="vim.section.xml" />
- <xi:include href="emscripten.section.xml" />
- <xi:include href="crystal.section.xml" />
 </chapter>
diff --git a/nixpkgs/doc/languages-frameworks/ios.section.md b/nixpkgs/doc/languages-frameworks/ios.section.md
index 6684b809ffe6..5a81795c004a 100644
--- a/nixpkgs/doc/languages-frameworks/ios.section.md
+++ b/nixpkgs/doc/languages-frameworks/ios.section.md
@@ -1,7 +1,7 @@
 ---
 title: iOS
 author: Sander van der Burg
-date: 2018-11-18
+date: 2019-11-10
 ---
 # iOS
 
@@ -217,3 +217,13 @@ xcode.simulateApp {
 
 By providing the result of an `xcode.buildApp {}` function and configuring the
 app bundle id, the app gets deployed automatically and started.
+
+Troubleshooting
+---------------
+In some rare cases, it may happen that after a failure, changes are not picked
+up. Most likely, this is caused by a derived data cache that Xcode maintains.
+To wipe it you can run:
+
+```bash
+$ rm -rf ~/Library/Developer/Xcode/DerivedData
+```
diff --git a/nixpkgs/doc/languages-frameworks/node.section.md b/nixpkgs/doc/languages-frameworks/node.section.md
index c6dce04c7b8b..4dc95fc1dd98 100644
--- a/nixpkgs/doc/languages-frameworks/node.section.md
+++ b/nixpkgs/doc/languages-frameworks/node.section.md
@@ -1,5 +1,5 @@
-Node.js packages
-================
+Node.js
+=======
 The `pkgs/development/node-packages` folder contains a generated collection of
 [NPM packages](https://npmjs.com/) that can be installed with the Nix package
 manager.
diff --git a/nixpkgs/doc/languages-frameworks/python.section.md b/nixpkgs/doc/languages-frameworks/python.section.md
index 88dc42ebc6c2..41a5dae8b9b0 100644
--- a/nixpkgs/doc/languages-frameworks/python.section.md
+++ b/nixpkgs/doc/languages-frameworks/python.section.md
@@ -144,6 +144,24 @@ What's happening here?
 2. Then we create a Python 3.5 environment with the `withPackages` function.
 3. The `withPackages` function expects us to provide a function as an argument that takes the set of all python packages and returns a list of packages to include in the environment. Here, we select the packages `numpy` and `toolz` from the package set.
 
+To combine this with `mkShell` you can:
+
+```nix
+with import <nixpkgs> {};
+
+let
+  pythonEnv = python35.withPackages (ps: [
+    ps.numpy
+    ps.toolz
+  ]);
+in mkShell {
+  buildInputs = [
+    pythonEnv
+    hello
+  ];
+}
+```
+
 ##### Execute command with `--run`
 A convenient option with `nix-shell` is the `--run`
 option, with which you can execute a command in the `nix-shell`. We can
@@ -593,7 +611,7 @@ as the interpreter unless overridden otherwise.
 All parameters from `stdenv.mkDerivation` function are still supported. The following are specific to `buildPythonPackage`:
 
 * `catchConflicts ? true`: If `true`, abort package build if a package name appears more than once in dependency tree. Default is `true`.
-* `disabled` ? false: If `true`, package is not build for the particular Python interpreter version.
+* `disabled` ? false: If `true`, package is not built for the particular Python interpreter version.
 * `dontWrapPythonPrograms ? false`: Skip wrapping of python programs.
 * `permitUserSite ? false`: Skip setting the `PYTHONNOUSERSITE` environment variable in wrapped programs.
 * `installFlags ? []`: A list of strings. Arguments to be passed to `pip install`. To pass options to `python setup.py install`, use `--install-option`. E.g., `installFlags=["--install-option='--cpp_implementation'"]`.
@@ -803,6 +821,9 @@ should be used with `ignoreCollisions = true`.
 The following are setup hooks specifically for Python packages. Most of these are
 used in `buildPythonPackage`.
 
+- `eggUnpackhook` to move an egg to the correct folder so it can be installed with the `eggInstallHook`
+- `eggBuildHook` to skip building for eggs.
+- `eggInstallHook` to install eggs.
 - `flitBuildHook` to build a wheel using `flit`.
 - `pipBuildHook` to build a wheel using `pip` and PEP 517. Note a build system (e.g. `setuptools` or `flit`) should still be added as `nativeBuildInput`.
 - `pipInstallHook` to install wheels.
@@ -850,9 +871,8 @@ Note: There is a boolean value `lib.inNixShell` set to `true` if nix-shell is in
 Packages inside nixpkgs are written by hand. However many tools exist in
 community to help save time. No tool is preferred at the moment.
 
-- [python2nix](https://github.com/proger/python2nix) by Vladimir Kirillov
-- [pypi2nix](https://github.com/garbas/pypi2nix) by Rok Garbas
-- [pypi2nix](https://github.com/offlinehacker/pypi2nix) by Jaka Hudoklin
+- [pypi2nix](https://github.com/nix-community/pypi2nix): Generate Nix expressions for your Python project. Note that [sharing derivations from pypi2nix with nixpkgs is possible but not encouraged](https://github.com/nix-community/pypi2nix/issues/222#issuecomment-443497376).
+- [python2nix](https://github.com/proger/python2nix) by Vladimir Kirillov.
 
 ### Deterministic builds
 
@@ -1017,7 +1037,10 @@ Create this `default.nix` file, together with a `requirements.txt` and simply ex
 
 ```nix
 with import <nixpkgs> {};
-with python27Packages;
+
+let
+  pythonPackages = python27Packages;
+in
 
 stdenv.mkDerivation {
   name = "impurePythonEnv";
@@ -1027,9 +1050,8 @@ stdenv.mkDerivation {
   buildInputs = [
     # these packages are required for virtualenv and pip to work:
     #
-    python27Full
-    python27Packages.virtualenv
-    python27Packages.pip
+    pythonPackages.virtualenv
+    pythonPackages.pip
     # the following packages are related to the dependencies of your python
     # project.
     # In this particular example the python modules listed in the
@@ -1042,14 +1064,13 @@ stdenv.mkDerivation {
     libxml2
     libxslt
     libzip
-    stdenv
     zlib
   ];
 
   shellHook = ''
     # set SOURCE_DATE_EPOCH so that we can use python wheels
     SOURCE_DATE_EPOCH=$(date +%s)
-    virtualenv --no-setuptools venv
+    virtualenv --python=${pythonPackages.python.interpreter} --no-setuptools venv
     export PATH=$PWD/venv/bin:$PATH
     pip install -r requirements.txt
   '';
diff --git a/nixpkgs/doc/languages-frameworks/r.section.md b/nixpkgs/doc/languages-frameworks/r.section.md
index c8f02bd14780..d4e1617779ce 100644
--- a/nixpkgs/doc/languages-frameworks/r.section.md
+++ b/nixpkgs/doc/languages-frameworks/r.section.md
@@ -1,5 +1,5 @@
-R packages
-==========
+R
+=
 
 ## Installation
 
diff --git a/nixpkgs/doc/languages-frameworks/rust.section.md b/nixpkgs/doc/languages-frameworks/rust.section.md
index 2d9338f2e89b..709a0d504cf7 100644
--- a/nixpkgs/doc/languages-frameworks/rust.section.md
+++ b/nixpkgs/doc/languages-frameworks/rust.section.md
@@ -4,7 +4,7 @@ author: Matthias Beyer
 date: 2017-03-05
 ---
 
-# User's Guide to the Rust Infrastructure
+# Rust
 
 To install the rust compiler and cargo put
 
@@ -43,6 +43,7 @@ rustPlatform.buildRustPackage rec {
   };
 
   cargoSha256 = "0q68qyl2h6i0qsz82z840myxlnjay8p1w5z7hfyr8fqp7wgwa9cx";
+  verifyCargoDeps = true;
 
   meta = with stdenv.lib; {
     description = "A fast line-oriented regex search tool, similar to ag and ack";
@@ -64,6 +65,20 @@ When the `Cargo.lock`, provided by upstream, is not in sync with the
 added in `cargoPatches` will also be prepended to the patches in `patches` at
 build-time.
 
+When `verifyCargoDeps` is set to `true`, the build will also verify that the
+`cargoSha256` is not out of date by comparing the `Cargo.lock` file in both the `cargoDeps` and `src`. Note that this option changes the value of `cargoSha256` since it also copies the `Cargo.lock` in it. To avoid breaking backward-compatibility this option is not enabled by default but hopefully will be in the future.
+
+### Building a crate for a different target
+
+To build your crate with a different cargo `--target` simply specify the `target` attribute:
+
+```nix
+pkgs.rustPlatform.buildRustPackage {
+  (...)
+  target = "x86_64-fortanix-unknown-sgx";
+}
+```
+
 ## Compiling Rust crates using Nix instead of Cargo
 
 ### Simple operation
@@ -188,7 +203,7 @@ argument and returns a set that contains all attribute that should be
 overwritten.
 
 For more complicated cases, such as when parts of the crate's
-derivation depend on the the crate's version, the `attrs` argument of
+derivation depend on the crate's version, the `attrs` argument of
 the override above can be read, as in the following example, which
 patches the derivation:
 
diff --git a/nixpkgs/doc/languages-frameworks/texlive.xml b/nixpkgs/doc/languages-frameworks/texlive.xml
index 7876cc213b66..8fa8f963b2f6 100644
--- a/nixpkgs/doc/languages-frameworks/texlive.xml
+++ b/nixpkgs/doc/languages-frameworks/texlive.xml
@@ -59,6 +59,97 @@ nix-repl> texlive.collection-<TAB>
   </itemizedlist>
  </section>
 
+ <section xml:id="sec-language-texlive-custom-packages">
+  <title>Custom packages</title>
+  <para>
+    You may find that you need to use an external TeX package. A derivation for such package has to provide contents of the "texmf" directory in its output and provide the <varname>tlType</varname> attribute. Here is a (very verbose) example:
+<programlisting><![CDATA[
+with import <nixpkgs> {};
+
+let
+  foiltex_run = stdenvNoCC.mkDerivation {
+    pname = "latex-foiltex";
+    version = "2.1.4b";
+    passthru.tlType = "run";
+
+    srcs = [
+      (fetchurl {
+        url = "http://mirrors.ctan.org/macros/latex/contrib/foiltex/foiltex.dtx";
+        sha256 = "07frz0krpz7kkcwlayrwrj2a2pixmv0icbngyw92srp9fp23cqpz";
+      })
+      (fetchurl {
+        url = "http://mirrors.ctan.org/macros/latex/contrib/foiltex/foiltex.ins";
+        sha256 = "09wkyidxk3n3zvqxfs61wlypmbhi1pxmjdi1kns9n2ky8ykbff99";
+      })
+    ];
+
+    unpackPhase = ''
+      runHook preUnpack
+
+      for _src in $srcs; do
+        cp "$_src" $(stripHash "$_src")
+      done
+
+      runHook postUnpack
+    '';
+
+    nativeBuildInputs = [ texlive.combined.scheme-small ];
+
+    dontConfigure = true;
+
+    buildPhase = ''
+      runHook preBuild
+
+      # Generate the style files
+      latex foiltex.ins
+
+      runHook postBuild
+    '';
+
+    installPhase = ''
+      runHook preInstall
+
+      path="$out/tex/latex/foiltex"
+      mkdir -p "$path"
+      cp *.{cls,def,clo} "$path/"
+
+      runHook postInstall
+    '';
+
+    meta = with lib; {
+      description = "A LaTeX2e class for overhead transparencies";
+      license = licenses.unfreeRedistributable;
+      maintainers = with maintainers; [ veprbl ];
+      platforms = platforms.all;
+    };
+  };
+  foiltex = { pkgs = [ foiltex_run ]; };
+
+  latex_with_foiltex = texlive.combine {
+    inherit (texlive) scheme-small;
+    inherit foiltex;
+  };
+in
+  runCommand "test.pdf" {
+    nativeBuildInputs = [ latex_with_foiltex ];
+  } ''
+cat >test.tex <<EOF
+\documentclass{foils}
+
+\title{Presentation title}
+\date{}
+
+\begin{document}
+\maketitle
+\end{document}
+EOF
+  pdflatex test.tex
+  cp test.pdf $out
+''
+]]></programlisting>
+  </para>
+ </section>
+
  <section xml:id="sec-language-texlive-known-problems">
   <title>Known problems</title>
 
diff --git a/nixpkgs/doc/languages-frameworks/vim.section.md b/nixpkgs/doc/languages-frameworks/vim.section.md
index 537e7b93e523..05a23d26cf2f 100644
--- a/nixpkgs/doc/languages-frameworks/vim.section.md
+++ b/nixpkgs/doc/languages-frameworks/vim.section.md
@@ -3,7 +3,7 @@ title: User's Guide for Vim in Nixpkgs
 author: Marc Weber
 date: 2016-06-25
 ---
-# User's Guide to Vim Plugins/Addons/Bundles/Scripts in Nixpkgs
+# Vim
 
 Both Neovim and Vim can be configured to include your favorite plugins
 and additional libraries.
diff --git a/nixpkgs/doc/manual.xml b/nixpkgs/doc/manual.xml
index ab845e1a1086..1f69872d2a72 100644
--- a/nixpkgs/doc/manual.xml
+++ b/nixpkgs/doc/manual.xml
@@ -5,21 +5,37 @@
   <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="package-specific-user-notes.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" />
+ <xi:include href="preface.chapter.xml" />
+ <part>
+  <title>Using Nixpkgs</title>
+  <xi:include href="using/configuration.xml" />
+  <xi:include href="using/overlays.xml" />
+  <xi:include href="using/overrides.xml" />
+  <xi:include href="functions.xml" />
+ </part>
+ <part>
+  <title>Standard environment</title>
+  <xi:include href="stdenv/stdenv.xml" />
+  <xi:include href="stdenv/meta.xml" />
+  <xi:include href="stdenv/multiple-output.xml" />
+  <xi:include href="stdenv/cross-compilation.xml" />
+  <xi:include href="stdenv/platform-notes.xml" />
+ </part>
+ <part>
+  <title>Builders</title>
+  <xi:include href="builders/fetchers.xml" />
+  <xi:include href="builders/trivial-builders.xml" />
+  <xi:include href="builders/special.xml" />
+  <xi:include href="builders/images.xml" />
+  <xi:include href="languages-frameworks/index.xml" />
+  <xi:include href="builders/packages/index.xml" />
+ </part>
+ <part>
+  <title>Contributing to Nixpkgs</title>
+  <xi:include href="contributing/quick-start.xml" />
+  <xi:include href="contributing/coding-conventions.xml" />
+  <xi:include href="contributing/submitting-changes.xml" />
+  <xi:include href="contributing/reviewing-contributions.xml" />
+  <xi:include href="contributing/contributing-to-documentation.xml" />
+ </part>
 </book>
diff --git a/nixpkgs/doc/package-notes.xml b/nixpkgs/doc/package-notes.xml
deleted file mode 100644
index 770b277cd909..000000000000
--- a/nixpkgs/doc/package-notes.xml
+++ /dev/null
@@ -1,422 +0,0 @@
-<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>
-<!--============================================================-->
- <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 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>
-   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>
-<prompt>$ </prompt>nix-env -i ncurses
-<prompt>$ </prompt>export NIX_CFLAGS_LINK=-lncurses
-<prompt>$ </prompt>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>
-      </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>
-<!--============================================================-->
- <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:
-<screen>
-<prompt>$ </prompt>cd pkgs/servers/x11/xorg
-<prompt>$ </prompt>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>
-
-  <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>
-<prompt>$ </prompt>export i="mirror://xorg/X11R7.4/src/everything/"
-<prompt>$ </prompt>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>
-
-  <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 xml:id="sec-package-notes-gnome">
-  <title>Gnome</title>
-  <para>* Expression is auto-generated</para>
-  <para>* How to update</para>
-</section>
--->
-<!--============================================================-->
-<!--
-<section xml:id="sec-package-notes-gcc">
-  <title>GCC</title>
-  <para>…</para>
-</section>
--->
-<!--============================================================-->
- <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>.
-  </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:
-<screen>
-<prompt>$ </prompt>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.
-  </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
-<screen>
-packageOverrides = pkgs: {
-  myEclipse = with pkgs.eclipses; eclipseWithPlugins {
-    eclipse = eclipse-platform;
-    jvmArgs = [ "-Xmx2048m" ];
-    plugins = [ plugins.color-theme ];
-  };
-}
-</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
-<screen>
-<prompt>$ </prompt>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.
-  </para>
-
-  <para>
-   Expanding the previous example with two plugins using the above functions we have
-<screen>
-packageOverrides = pkgs: {
-  myEclipse = with pkgs.eclipses; eclipseWithPlugins {
-    eclipse = eclipse-platform;
-    jvmArgs = [ "-Xmx2048m" ];
-    plugins = [
-      plugins.color-theme
-      (plugins.buildEclipsePlugin {
-        name = "myplugin1-1.0";
-        srcFeature = fetchurl {
-          url = "http://…/features/myplugin1.jar";
-          sha256 = "123…";
-        };
-        srcPlugin = fetchurl {
-          url = "http://…/plugins/myplugin1.jar";
-          sha256 = "123…";
-        };
-      });
-      (plugins.buildEclipseUpdateSite {
-        name = "myplugin2-1.0";
-        src = fetchurl {
-          stripRoot = false;
-          url = "http://…/myplugin2.zip";
-          sha256 = "123…";
-        };
-      });
-    ];
-  };
-}
-</screen>
-  </para>
- </section>
- <section xml:id="sec-elm">
-  <title>Elm</title>
-
-  <para>
-   To start a development environment do <command>nix-shell -p elmPackages.elm elmPackages.elm-format</command>
-  </para>
-
-  <para>
-   To update Elm compiler, see <filename>nixpkgs/pkgs/development/compilers/elm/README.md</filename>.
-  </para>
-
-  <para>
-   To package Elm applications, <link xlink:href="https://github.com/hercules-ci/elm2nix#elm2nix">read about elm2nix</link>.
-  </para>
- </section>
- <section xml:id="sec-kakoune">
-  <title>Kakoune</title>
-
-  <para>
-   Kakoune can be built to autoload plugins:
-<programlisting>(kakoune.override {
-  configure = {
-    plugins = with pkgs.kakounePlugins; [ parinfer-rust ];
-  };
-})</programlisting>
-  </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:
-   <itemizedlist>
-    <listitem>
-     <para>
-      <literal>autojump</literal>: <command>autojump-share</command>
-     </para>
-    </listitem>
-    <listitem>
-     <para>
-      <literal>fzf</literal>: <command>fzf-share</command>
-     </para>
-    </listitem>
-   </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-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
-<programlisting>weechat.override {configure = {availablePlugins, ...}: {
-    plugins = with availablePlugins; [ python perl ];
-  }
-}</programlisting>
-   If the <literal>configure</literal> function returns an attrset without the <literal>plugins</literal> attribute, <literal>availablePlugins</literal> will be used automatically.
-  </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 and perl plugins allows the addition of extra libraries. For instance, the <literal>inotify.py</literal> script in weechat-scripts requires D-Bus or libnotify, and the <literal>fish.py</literal> script requires pycrypto. To use these scripts, use the plugin's <literal>withPackages</literal> attribute:
-<programlisting>weechat.override { configure = {availablePlugins, ...}: {
-    plugins = with availablePlugins; [
-            (python.withPackages (ps: with ps; [ pycrypto python-dbus ]))
-        ];
-    };
-}
-</programlisting>
-  </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>
-
-  <para>
-   WeeChat allows to set defaults on startup using the <literal>--run-command</literal>. The <literal>configure</literal> method can be used to pass commands to the program:
-<programlisting>weechat.override {
-  configure = { availablePlugins, ... }: {
-    init = ''
-      /set foo bar
-      /server add freenode chat.freenode.org
-    '';
-  };
-}</programlisting>
-   Further values can be added to the list of commands when running <literal>weechat --run-command "your-commands"</literal>.
-  </para>
-
-  <para>
-   Additionally it's possible to specify scripts to be loaded when starting <literal>weechat</literal>. These will be loaded before the commands from <literal>init</literal>:
-<programlisting>weechat.override {
-  configure = { availablePlugins, ... }: {
-    scripts = with pkgs.weechatScripts; [
-      weechat-xmpp weechat-matrix-bridge wee-slack
-    ];
-    init = ''
-      /set plugins.var.python.jabber.key "val"
-    '':
-  };
-}</programlisting>
-  </para>
-
-  <para>
-   In <literal>nixpkgs</literal> there's a subpackage which contains derivations for WeeChat scripts. Such derivations expect a <literal>passthru.scripts</literal> attribute which contains a list of all scripts inside the store path. Furthermore all scripts have to live in <literal>$out/share</literal>. An exemplary derivation looks like this:
-<programlisting>{ stdenv, fetchurl }:
-
-stdenv.mkDerivation {
-  name = "exemplary-weechat-script";
-  src = fetchurl {
-    url = "https://scripts.tld/your-scripts.tar.gz";
-    sha256 = "...";
-  };
-  passthru.scripts = [ "foo.py" "bar.lua" ];
-  installPhase = ''
-    mkdir $out/share
-    cp foo.py $out/share
-    cp bar.lua $out/share
-  '';
-}</programlisting>
-  </para>
- </section>
- <section xml:id="sec-ibus-typing-booster">
-  <title>ibus-engines.typing-booster</title>
-
-  <para>
-   This package is an ibus-based completion method to speed up typing.
-  </para>
-
-  <section xml:id="sec-ibus-typing-booster-activate">
-   <title>Activating the engine</title>
-
-   <para>
-    IBus needs to be configured accordingly to activate <literal>typing-booster</literal>. The configuration depends on the desktop manager in use. For detailed instructions, please refer to the <link xlink:href="https://mike-fabian.github.io/ibus-typing-booster/documentation.html">upstream docs</link>.
-   </para>
-
-   <para>
-    On NixOS you need to explicitly enable <literal>ibus</literal> with given engines before customizing your desktop to use <literal>typing-booster</literal>. This can be achieved using the <literal>ibus</literal> module:
-<programlisting>{ pkgs, ... }: {
-  i18n.inputMethod = {
-    enabled = "ibus";
-    ibus.engines = with pkgs.ibus-engines; [ typing-booster ];
-  };
-}</programlisting>
-   </para>
-  </section>
-
-  <section xml:id="sec-ibus-typing-booster-customize-hunspell">
-   <title>Using custom hunspell dictionaries</title>
-
-   <para>
-    The IBus engine is based on <literal>hunspell</literal> to support completion in many languages. By default the dictionaries <literal>de-de</literal>, <literal>en-us</literal>, <literal>fr-moderne</literal> <literal>es-es</literal>, <literal>it-it</literal>, <literal>sv-se</literal> and <literal>sv-fi</literal> are in use. To add another dictionary, the package can be overridden like this:
-<programlisting>ibus-engines.typing-booster.override {
-  langs = [ "de-at" "en-gb" ];
-}</programlisting>
-   </para>
-
-   <para>
-    <emphasis>Note: each language passed to <literal>langs</literal> must be an attribute name in <literal>pkgs.hunspellDicts</literal>.</emphasis>
-   </para>
-  </section>
-
-  <section xml:id="sec-ibus-typing-booster-emoji-picker">
-   <title>Built-in emoji picker</title>
-
-   <para>
-    The <literal>ibus-engines.typing-booster</literal> package contains a program named <literal>emoji-picker</literal>. To display all emojis correctly, a special font such as <literal>noto-fonts-emoji</literal> is needed:
-   </para>
-
-   <para>
-    On NixOS it can be installed using the following expression:
-<programlisting>{ pkgs, ... }: {
-  fonts.fonts = with pkgs; [ noto-fonts-emoji ];
-}</programlisting>
-   </para>
-  </section>
- </section>
- <section xml:id="sec-nginx">
-  <title>Nginx</title>
-
-  <para>
-   <link xlink:href="https://nginx.org/">Nginx</link> is a reverse proxy and lightweight webserver.
-  </para>
-
-  <section xml:id="sec-nginx-etag">
-   <title>ETags on static files served from the Nix store</title>
-
-   <para>
-    HTTP has a couple different mechanisms for caching to prevent clients from having to download the same content repeatedly if a resource has not changed since the last time it was requested. When nginx is used as a server for static files, it implements the caching mechanism based on the <link xlink:href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Last-Modified"><literal>Last-Modified</literal></link> response header automatically; unfortunately, it works by using filesystem timestamps to determine the value of the <literal>Last-Modified</literal> header. This doesn't give the desired behavior when the file is in the Nix store, because all file timestamps are set to 0 (for reasons related to build reproducibility).
-   </para>
-
-   <para>
-    Fortunately, HTTP supports an alternative (and more effective) caching mechanism: the <link xlink:href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag"><literal>ETag</literal></link> response header. The value of the <literal>ETag</literal> header specifies some identifier for the particular content that the server is sending (e.g. a hash). When a client makes a second request for the same resource, it sends that value back in an <literal>If-None-Match</literal> header. If the ETag value is unchanged, then the server does not need to resend the content.
-   </para>
-
-   <para>
-    As of NixOS 19.09, the nginx package in Nixpkgs is patched such that when nginx serves a file out of <filename>/nix/store</filename>, the hash in the store path is used as the <literal>ETag</literal> header in the HTTP response, thus providing proper caching functionality. This happens automatically; you do not need to do modify any configuration to get this behavior.
-   </para>
-  </section>
- </section>
-</chapter>
diff --git a/nixpkgs/doc/package-specific-user-notes.xml b/nixpkgs/doc/package-specific-user-notes.xml
deleted file mode 100644
index a3ee42dc7fa0..000000000000
--- a/nixpkgs/doc/package-specific-user-notes.xml
+++ /dev/null
@@ -1,357 +0,0 @@
-<chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="package-specific-user-notes">
- <title>Package-specific usage notes</title>
- <para>
-  These chapters includes some notes that apply to specific packages and should answer some of the frequently asked questions related to Nixpkgs use. Some useful information related to package use can be found in <link linkend="chap-package-notes">package-specific development notes</link>.
- </para>
- <section xml:id="opengl">
-  <title>OpenGL</title>
-
-  <para>
-   Packages that use OpenGL have NixOS desktop as their primary target. The current solution for loading the GPU-specific drivers is based on <literal>libglvnd</literal> and looks for the driver implementation in <literal>LD_LIBRARY_PATH</literal>. If you are using a non-NixOS GNU/Linux/X11 desktop with free software video drivers, consider launching OpenGL-dependent programs from Nixpkgs with Nixpkgs versions of <literal>libglvnd</literal> and <literal>mesa_drivers</literal> in <literal>LD_LIBRARY_PATH</literal>. For proprietary video drivers you might have luck with also adding the corresponding video driver package.
-  </para>
- </section>
- <section xml:id="locales">
-  <title>Locales</title>
-
-  <para>
-   To allow simultaneous use of packages linked against different versions of <literal>glibc</literal> with different locale archive formats Nixpkgs patches <literal>glibc</literal> to rely on <literal>LOCALE_ARCHIVE</literal> environment variable.
-  </para>
-
-  <para>
-   On non-NixOS distributions this variable is obviously not set. This can cause regressions in language support or even crashes in some Nixpkgs-provided programs. The simplest way to mitigate this problem is exporting the <literal>LOCALE_ARCHIVE</literal> variable pointing to <literal>${glibcLocales}/lib/locale/locale-archive</literal>. The drawback (and the reason this is not the default) is the relatively large (a hundred MiB) size of the full set of locales. It is possible to build a custom set of locales by overriding parameters <literal>allLocales</literal> and <literal>locales</literal> of the package.
-  </para>
- </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>
-{
-  packageOverrides = pkgs: with pkgs; {
-    myEmacs = emacsWithPackages (epkgs: (with epkgs.melpaStablePackages; [
-      company
-      counsel
-      flycheck
-      ivy
-      magit
-      projectile
-      use-package
-    ]));
-  }
-}
-</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>
-
-<screen>
-{
-  packageOverrides = pkgs: with pkgs; rec {
-    myEmacsConfig = writeText "default.el" ''
-;; initialize package
-
-(require 'package)
-(package-initialize 'noactivate)
-(eval-when-compile
-  (require 'use-package))
-
-;; load some packages
-
-(use-package company
-  :bind ("&lt;C-tab&gt;" . company-complete)
-  :diminish company-mode
-  :commands (company-mode global-company-mode)
-  :defer 1
-  :config
-  (global-company-mode))
-
-(use-package counsel
-  :commands (counsel-descbinds)
-  :bind (([remap execute-extended-command] . counsel-M-x)
-         ("C-x C-f" . counsel-find-file)
-         ("C-c g" . counsel-git)
-         ("C-c j" . counsel-git-grep)
-         ("C-c k" . counsel-ag)
-         ("C-x l" . counsel-locate)
-         ("M-y" . counsel-yank-pop)))
-
-(use-package flycheck
-  :defer 2
-  :config (global-flycheck-mode))
-
-(use-package ivy
-  :defer 1
-  :bind (("C-c C-r" . ivy-resume)
-         ("C-x C-b" . ivy-switch-buffer)
-         :map ivy-minibuffer-map
-         ("C-j" . ivy-call))
-  :diminish ivy-mode
-  :commands ivy-mode
-  :config
-  (ivy-mode 1))
-
-(use-package magit
-  :defer
-  :if (executable-find "git")
-  :bind (("C-x g" . magit-status)
-         ("C-x G" . magit-dispatch-popup))
-  :init
-  (setq magit-completing-read-function 'ivy-completing-read))
-
-(use-package projectile
-  :commands projectile-mode
-  :bind-keymap ("C-c p" . projectile-command-map)
-  :defer 5
-  :config
-  (projectile-global-mode))
-    '';
-    myEmacs = emacsWithPackages (epkgs: (with epkgs.melpaStablePackages; [
-      (runCommand "default.el" {} ''
-mkdir -p $out/share/emacs/site-lisp
-cp ${myEmacsConfig} $out/share/emacs/site-lisp/default.el
-'')
-      company
-      counsel
-      flycheck
-      ivy
-      magit
-      projectile
-      use-package
-    ]));
-  };
-}
-</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>
-
-<screen>
-overrides = self: super: rec {
-  haskell-mode = self.melpaPackages.haskell-mode;
-  ...
-};
-((emacsPackagesGen emacs).overrideScope' overrides).emacsWithPackages (p: with p; [
-  # here both these package will use haskell-mode of our own choice
-  ghc-mod
-  dante
-])
-</screen>
-  </section>
- </section>
- <section xml:id="dlib">
-  <title>DLib</title>
-
-  <para>
-   <link xlink:href="http://dlib.net/">DLib</link> is a modern, C++-based toolkit which provides several machine learning algorithms.
-  </para>
-
-  <section xml:id="compiling-without-avx-support">
-   <title>Compiling without AVX support</title>
-
-   <para>
-    Especially older CPUs don't support <link xlink:href="https://en.wikipedia.org/wiki/Advanced_Vector_Extensions">AVX</link> (<abbrev>Advanced Vector Extensions</abbrev>) instructions that are used by DLib to optimize their algorithms.
-   </para>
-
-   <para>
-    On the affected hardware errors like <literal>Illegal instruction</literal> will occur. In those cases AVX support needs to be disabled:
-<programlisting>self: super: {
-  dlib = super.dlib.override { avxSupport = false; };
-}</programlisting>
-   </para>
-  </section>
- </section>
- <section xml:id="unfree-software">
-  <title>Unfree software</title>
-
-  <para>
-   All users of Nixpkgs are free software users, and many users (and developers) of Nixpkgs want to limit and tightly control their exposure to unfree software. At the same time, many users need (or want) to run some specific pieces of proprietary software. Nixpkgs includes some expressions for unfree software packages. By default unfree software cannot be installed and doesn’t show up in searches. To allow installing unfree software in a single Nix invocation one can export <literal>NIXPKGS_ALLOW_UNFREE=1</literal>. For a persistent solution, users can set <literal>allowUnfree</literal> in the Nixpkgs configuration.
-  </para>
-
-  <para>
-   Fine-grained control is possible by defining <literal>allowUnfreePredicate</literal> function in config; it takes the <literal>mkDerivation</literal> parameter attrset and returns <literal>true</literal> for unfree packages that should be allowed.
-  </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 or other Steam supported controllers such as the DualShock 4 or Nintendo Switch Pro, you need to add
-<programlisting>hardware.steam-hardware.enable = true;</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
-<programlisting>pkgs.(steam.override {
-          nativeOnly = true;
-          newStdcpp = true;
-        }).run</programlisting>
-    to your configuration, rebuild, and run the game with
-<programlisting>steam-run ./foo</programlisting>
-   </para>
-  </section>
- </section>
- <section xml:id="sec-citrix">
-  <title>Citrix Receiver &amp; Citrix Workspace App</title>
-
-  <para>
-   <note>
-    <para>
-     Please note that the <literal>citrix_receiver</literal> package has been deprecated since its development was <link xlink:href="https://docs.citrix.com/en-us/citrix-workspace-app.html">discontinued by upstream</link> and has been replaced by <link xlink:href="https://www.citrix.com/products/workspace-app/">the citrix workspace app</link>.
-    </para>
-   </note>
-   <link xlink:href="https://www.citrix.com/products/receiver/">Citrix Receiver</link> and <link xlink:href="https://www.citrix.com/products/workspace-app/">Citrix Workspace App</link> are a remote desktop viewers which provide access to <link xlink:href="https://www.citrix.com/products/xenapp-xendesktop/">XenDesktop</link> installations.
-  </para>
-
-  <section xml:id="sec-citrix-base">
-   <title>Basic usage</title>
-
-   <para>
-    The tarball archive needs to be downloaded manually as the license agreements of the vendor for <link xlink:href="https://www.citrix.com/downloads/citrix-receiver/">Citrix Receiver</link> or <link xlink:href="https://www.citrix.de/downloads/workspace-app/linux/workspace-app-for-linux-latest.html">Citrix Workspace</link> need to be accepted first. Then run <command>nix-prefetch-url file://$PWD/linuxx64-$version.tar.gz</command>. With the archive available in the store the package can be built and installed with Nix.
-   </para>
-
-   <warning>
-    <title>Caution with <command>nix-shell</command> installs</title>
-    <para>
-     It's recommended to install <literal>Citrix Receiver</literal> and/or <literal>Citrix Workspace</literal> using <literal>nix-env -i</literal> or globally to ensure that the <literal>.desktop</literal> files are installed properly into <literal>$XDG_CONFIG_DIRS</literal>. Otherwise it won't be possible to open <literal>.ica</literal> files automatically from the browser to start a Citrix connection.
-    </para>
-   </warning>
-  </section>
-
-  <section xml:id="sec-citrix-custom-certs">
-   <title>Custom certificates</title>
-
-   <para>
-    The <literal>Citrix Workspace App</literal> in <literal>nixpkgs</literal> trust several certificates <link xlink:href="https://curl.haxx.se/docs/caextract.html">from the Mozilla database</link> by default. However several companies using Citrix might require their own corporate certificate. On distros with imperative packaging these certs can be stored easily in <link xlink:href="https://developer-docs.citrix.com/projects/receiver-for-linux-command-reference/en/13.7/"><literal>$ICAROOT</literal></link>, however this directory is a store path in <literal>nixpkgs</literal>. In order to work around this issue the package provides a simple mechanism to add custom certificates without rebuilding the entire package using <literal>symlinkJoin</literal>:
-<programlisting>
-<![CDATA[with import <nixpkgs> { config.allowUnfree = true; };
-let extraCerts = [ ./custom-cert-1.pem ./custom-cert-2.pem /* ... */ ]; in
-citrix_workspace.override {
-  inherit extraCerts;
-}]]>
-</programlisting>
-   </para>
-  </section>
- </section>
-</chapter>
diff --git a/nixpkgs/doc/introduction.chapter.md b/nixpkgs/doc/preface.chapter.md
index 6abdc2714e2c..88ca5e2e3cec 100644
--- a/nixpkgs/doc/introduction.chapter.md
+++ b/nixpkgs/doc/preface.chapter.md
@@ -1,44 +1,45 @@
 ---
-title: Introduction
+title: Preface
 author: Frederik Rietdijk
 date: 2015-11-25
 ---
 
-# Introduction
+# Preface
 
 The Nix Packages collection (Nixpkgs) is a set of thousands of packages for the
-[Nix package manager](http://nixos.org/nix/), released under a
+[Nix package manager](https://nixos.org/nix/), released under a
 [permissive MIT/X11 license](https://github.com/NixOS/nixpkgs/blob/master/COPYING).
 Packages are available for several platforms, and can be used with the Nix
-package manager on most GNU/Linux distributions as well as NixOS.
+package manager on most GNU/Linux distributions as well as [NixOS](https://nixos.org/nixos).
 
 This manual primarily describes how to write packages for the Nix Packages collection
 (Nixpkgs). Thus it’s mainly for packagers and developers who want to add packages to
 Nixpkgs. If you like to learn more about the Nix package manager and the Nix
-expression language, then you are kindly referred to the [Nix manual](http://nixos.org/nix/manual/).
+expression language, then you are kindly referred to the [Nix manual](https://nixos.org/nix/manual/).
+The NixOS distribution is documented in the [NixOS manual](https://nixos.org/nixos/manual/).
 
 ## Overview of Nixpkgs
 
 Nix expressions describe how to build packages from source and are collected in
 the [nixpkgs repository](https://github.com/NixOS/nixpkgs). Also included in the
 collection are Nix expressions for
-[NixOS modules](http://nixos.org/nixos/manual/index.html#sec-writing-modules).
+[NixOS modules](https://nixos.org/nixos/manual/index.html#sec-writing-modules).
 With these expressions the Nix package manager can build binary packages.
 
 Packages, including the Nix packages collection, are distributed through
-[channels](http://nixos.org/nix/manual/#sec-channels). The collection is
+[channels](https://nixos.org/nix/manual/#sec-channels). The collection is
 distributed for users of Nix on non-NixOS distributions through the channel
 `nixpkgs`. Users of NixOS generally use one of the `nixos-*` channels, e.g.
-`nixos-16.03`, which includes all packages and modules for the stable NixOS
-16.03. Stable NixOS releases are generally only given
+`nixos-19.09`, which includes all packages and modules for the stable NixOS
+19.09. Stable NixOS releases are generally only given
 security updates. More up to date packages and modules are available via the
 `nixos-unstable` channel.
 
 Both `nixos-unstable` and `nixpkgs` follow the `master` branch of the Nixpkgs
 repository, although both do lag the `master` branch by generally
-[a couple of days](http://howoldis.herokuapp.com/). Updates to a channel are
+[a couple of days](https://howoldis.herokuapp.com/). Updates to a channel are
 distributed as soon as all tests for that channel pass, e.g.
-[this table](http://hydra.nixos.org/job/nixpkgs/trunk/unstable#tabs-constituents)
+[this table](https://hydra.nixos.org/job/nixpkgs/trunk/unstable#tabs-constituents)
 shows the status of tests for the `nixpkgs` channel.
 
 The tests are conducted by a cluster called [Hydra](http://nixos.org/hydra/),
@@ -47,5 +48,5 @@ which also builds binary packages from the Nix expressions in Nixpkgs for
 The binaries are made available via a [binary cache](https://cache.nixos.org).
 
 The current Nix expressions of the channels are available in the
-[`nixpkgs-channels`](https://github.com/NixOS/nixpkgs-channels) repository,
-which has branches corresponding to the available channels.
+[`nixpkgs`](https://github.com/NixOS/nixpkgs) repository in branches
+that correspond to the channel names (e.g. `nixos-19.09-small`).
diff --git a/nixpkgs/doc/cross-compilation.xml b/nixpkgs/doc/stdenv/cross-compilation.xml
index 93fe9095ce2f..bea56a0c2fc1 100644
--- a/nixpkgs/doc/cross-compilation.xml
+++ b/nixpkgs/doc/stdenv/cross-compilation.xml
@@ -244,7 +244,7 @@
      </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`.
+       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 <command>ar</command>.
       </para>
      </answer>
     </qandaentry>
@@ -348,12 +348,12 @@ nix-build '&lt;nixpkgs&gt;' --arg crossSystem '{ config = "&lt;arch&gt;-&lt;os&g
       </para>
      </listitem>
     </orderedlist>
-    In each stage, <varname>pkgsBuildHost</varname> refers the the previous stage, <varname>pkgsBuildBuild</varname> refers to the one before that, and <varname>pkgsHostTarget</varname> refers to the current one, and <varname>pkgsTargetTarget</varname> refers to the next one. When there is no previous or next stage, they instead refer to the current stage. Note how all the invariants regarding the mapping between dependency and depending packages' build host and target platforms are preserved. <varname>pkgsBuildTarget</varname> and <varname>pkgsHostHost</varname> are more complex in that the stage fitting the requirements isn't always a fixed chain of "prevs" and "nexts" away (modulo the "saturating" self-references at the ends). We just special case each instead. All the primary edges are implemented is in <filename>pkgs/stdenv/booter.nix</filename>, and secondarily aliases in <filename>pkgs/top-level/stage.nix</filename>.
+    In each stage, <varname>pkgsBuildHost</varname> refers to the previous stage, <varname>pkgsBuildBuild</varname> refers to the one before that, and <varname>pkgsHostTarget</varname> refers to the current one, and <varname>pkgsTargetTarget</varname> refers to the next one. When there is no previous or next stage, they instead refer to the current stage. Note how all the invariants regarding the mapping between dependency and depending packages' build host and target platforms are preserved. <varname>pkgsBuildTarget</varname> and <varname>pkgsHostHost</varname> are more complex in that the stage fitting the requirements isn't always a fixed chain of "prevs" and "nexts" away (modulo the "saturating" self-references at the ends). We just special case each instead. All the primary edges are implemented is in <filename>pkgs/stdenv/booter.nix</filename>, and secondarily aliases in <filename>pkgs/top-level/stage.nix</filename>.
    </para>
 
    <note>
     <para>
-     Note the native stages are bootstrapped in legacy ways that predate the current cross implementation. This is why the the bootstrapping stages leading up to the final stages are ignored inthe previous paragraph.
+     Note the native stages are bootstrapped in legacy ways that predate the current cross implementation. This is why the bootstrapping stages leading up to the final stages are ignored inthe previous paragraph.
     </para>
    </note>
 
diff --git a/nixpkgs/doc/meta.xml b/nixpkgs/doc/stdenv/meta.xml
index 9371196818ad..9371196818ad 100644
--- a/nixpkgs/doc/meta.xml
+++ b/nixpkgs/doc/stdenv/meta.xml
diff --git a/nixpkgs/doc/multiple-output.xml b/nixpkgs/doc/stdenv/multiple-output.xml
index 83275bb2fbd1..83275bb2fbd1 100644
--- a/nixpkgs/doc/multiple-output.xml
+++ b/nixpkgs/doc/stdenv/multiple-output.xml
diff --git a/nixpkgs/doc/platform-notes.xml b/nixpkgs/doc/stdenv/platform-notes.xml
index d8d7692fc9a7..5a266fdc0eea 100644
--- a/nixpkgs/doc/platform-notes.xml
+++ b/nixpkgs/doc/stdenv/platform-notes.xml
@@ -1,6 +1,6 @@
 <chapter xmlns="http://docbook.org/ns/docbook"
          xmlns:xlink="http://www.w3.org/1999/xlink"
-         xml:id="chap-platform-nodes">
+         xml:id="chap-platform-notes">
  <title>Platform Notes</title>
  <section xml:id="sec-darwin">
   <title>Darwin (macOS)</title>
diff --git a/nixpkgs/doc/stdenv.xml b/nixpkgs/doc/stdenv/stdenv.xml
index 5495ce29ce31..1e97bf6157bb 100644
--- a/nixpkgs/doc/stdenv.xml
+++ b/nixpkgs/doc/stdenv/stdenv.xml
@@ -1123,6 +1123,16 @@ preBuild = ''
 
    <variablelist>
     <title>Variables controlling the install phase</title>
+     <varlistentry>
+     <term>
+       <varname>dontInstall</varname>
+     </term>
+     <listitem>
+      <para>
+       Set to true to skip the install phase.
+      </para>
+     </listitem>
+    </varlistentry>
     <varlistentry>
      <term>
       <varname>makeFlags</varname> / <varname>makeFlagsArray</varname> / <varname>makefile</varname>
@@ -1692,7 +1702,7 @@ someVar=$(stripHash $name)
     </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>.
+      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.
@@ -1717,7 +1727,7 @@ someVar=$(stripHash $name)
   </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 libraries and headers. This is done by defining a bash function, and appending its name to one of <envar>envBuildBuildHooks</envar>`, <envar>envBuildHostHooks</envar>`, <envar>envBuildTargetHooks</envar>`, <envar>envHostHostHooks</envar>`, <envar>envHostTargetHooks</envar>`, or <envar>envTargetTargetHooks</envar>`. These 6 bash variables correspond to the 6 sorts of dependencies by platform (there's 12 total but we ignore the propagated/non-propagated axis).
+   The most typical use of the setup hook is actually to add other hooks which are then run (i.e. after all the setup hooks) on each dependency. For example, the C compiler wrapper's setup hook feeds itself flags for each dependency that contains relevant libraries and headers. This is done by defining a bash function, and appending its name to one of <envar>envBuildBuildHooks</envar>, <envar>envBuildHostHooks</envar>, <envar>envBuildTargetHooks</envar>, <envar>envHostHostHooks</envar>, <envar>envHostTargetHooks</envar>, or <envar>envTargetTargetHooks</envar>. These 6 bash variables correspond to the 6 sorts of dependencies by platform (there's 12 total but we ignore the propagated/non-propagated axis).
   </para>
 
   <para>
@@ -1869,7 +1879,7 @@ addEnvHooks "$hostOffset" myBashFunction
   </para>
 
   <para>
-   Here are some more packages that provide a setup hook. Since the list of hooks is extensible, this is not an exhaustive list the mechanism is only to be used as a last resort, it might cover most uses.
+   Here are some more packages that provide a setup hook. Since the list of hooks is extensible, this is not an exhaustive list. The mechanism is only to be used as a last resort, so it might cover most uses.
    <variablelist>
     <varlistentry>
      <term>
diff --git a/nixpkgs/doc/configuration.xml b/nixpkgs/doc/using/configuration.xml
index cb660452d828..f4d6e9110064 100644
--- a/nixpkgs/doc/configuration.xml
+++ b/nixpkgs/doc/using/configuration.xml
@@ -45,7 +45,7 @@
   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:
+  A user's nixpkgs configuration is stored in a user-specific configuration file located at <filename>~/.config/nixpkgs/config.nix</filename>. For example:
 <programlisting>
 {
   allowUnfree = true;
@@ -141,11 +141,10 @@
      For a more useful example, try the following. This configuration only allows unfree packages named flash player and visual studio code:
 <programlisting>
 {
-  allowUnfreePredicate = (pkg: builtins.elem
-    (builtins.parseDrvName pkg.name).name [
-      "flashplayer"
-      "vscode"
-    ]);
+  allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
+    "flashplayer"
+    "vscode"
+  ];
 }
 </programlisting>
     </para>
@@ -217,7 +216,7 @@
      The following configuration example only allows insecure packages with very short names:
 <programlisting>
 {
-  allowInsecurePredicate = (pkg: (builtins.stringLength (builtins.parseDrvName pkg.name).name) &lt;= 5);
+  allowInsecurePredicate = pkg: builtins.stringLength (lib.getName pkg) &lt;= 5;
 }
 </programlisting>
     </para>
diff --git a/nixpkgs/doc/overlays.xml b/nixpkgs/doc/using/overlays.xml
index 26a888368abf..26a888368abf 100644
--- a/nixpkgs/doc/overlays.xml
+++ b/nixpkgs/doc/using/overlays.xml
diff --git a/nixpkgs/doc/functions/overrides.xml b/nixpkgs/doc/using/overrides.xml
index 4ba4283c6094..c9d36ddb2d7b 100644
--- a/nixpkgs/doc/functions/overrides.xml
+++ b/nixpkgs/doc/using/overrides.xml
@@ -1,17 +1,14 @@
-<section xmlns="http://docbook.org/ns/docbook"
+<chapter xmlns="http://docbook.org/ns/docbook"
          xmlns:xlink="http://www.w3.org/1999/xlink"
          xmlns:xi="http://www.w3.org/2001/XInclude"
-         xml:id="sec-overrides">
+         xml:id="chap-overrides">
  <title>Overriding</title>
-
  <para>
   Sometimes one wants to override parts of <literal>nixpkgs</literal>, e.g. derivation attributes, the results of derivations.
  </para>
-
  <para>
   These functions are used to make changes to packages, returning only single packages. <link xlink:href="#chap-overlays">Overlays</link>, on the other hand, can be used to combine the overridden packages across the entire package set of Nixpkgs.
  </para>
-
  <section xml:id="sec-pkg-override">
   <title>&lt;pkg&gt;.override</title>
 
@@ -45,7 +42,6 @@ mypkg = pkgs.callPackage ./mypkg.nix {
    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>
 
@@ -76,7 +72,6 @@ helloWithDebug = pkgs.hello.overrideAttrs (oldAttrs: rec {
    </para>
   </note>
  </section>
-
  <section xml:id="sec-pkg-overrideDerivation">
   <title>&lt;pkg&gt;.overrideDerivation</title>
 
@@ -124,7 +119,6 @@ mySed = pkgs.gnused.overrideDerivation (oldAttrs: {
    </para>
   </note>
  </section>
-
  <section xml:id="sec-lib-makeOverridable">
   <title>lib.makeOverridable</title>
 
@@ -148,4 +142,4 @@ c = lib.makeOverridable f { a = 1; b = 2; };
    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>
+</chapter>