summary refs log tree commit diff
path: root/nixos/doc/manual
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/doc/manual')
-rw-r--r--nixos/doc/manual/configuration/firewall.xml19
-rw-r--r--nixos/doc/manual/configuration/ipv4-config.xml2
-rw-r--r--nixos/doc/manual/configuration/ipv6-config.xml2
-rw-r--r--nixos/doc/manual/configuration/user-mgmt.xml10
-rw-r--r--nixos/doc/manual/configuration/x-windows.xml9
-rw-r--r--nixos/doc/manual/configuration/xfce.xml13
-rw-r--r--nixos/doc/manual/default.nix126
-rw-r--r--nixos/doc/manual/development/option-declarations.xml9
-rw-r--r--nixos/doc/manual/development/option-types.xml10
-rw-r--r--nixos/doc/manual/development/testing-installer.xml6
-rw-r--r--nixos/doc/manual/development/writing-nixos-tests.xml41
-rw-r--r--nixos/doc/manual/installation/changing-config.xml18
-rw-r--r--nixos/doc/manual/installation/installing-from-other-distro.xml309
-rw-r--r--nixos/doc/manual/installation/installing-uefi.xml48
-rw-r--r--nixos/doc/manual/installation/installing-usb.xml22
-rw-r--r--nixos/doc/manual/installation/installing-virtualbox-guest.xml10
-rw-r--r--nixos/doc/manual/installation/installing.xml147
-rw-r--r--nixos/doc/manual/installation/obtaining.xml9
-rw-r--r--nixos/doc/manual/man-nixos-build-vms.xml6
-rw-r--r--nixos/doc/manual/man-nixos-enter.xml119
-rw-r--r--nixos/doc/manual/man-nixos-install.xml6
-rw-r--r--nixos/doc/manual/man-pages.xml3
-rw-r--r--nixos/doc/manual/options-to-docbook.xsl9
-rw-r--r--nixos/doc/manual/release-notes/release-notes.xml1
-rw-r--r--nixos/doc/manual/release-notes/rl-1404.xml2
-rw-r--r--nixos/doc/manual/release-notes/rl-1803.xml464
-rw-r--r--nixos/doc/manual/release-notes/rl-1809.xml85
-rw-r--r--nixos/doc/manual/style.css267
28 files changed, 1352 insertions, 420 deletions
diff --git a/nixos/doc/manual/configuration/firewall.xml b/nixos/doc/manual/configuration/firewall.xml
index 87406c28c2f..75cccef95b3 100644
--- a/nixos/doc/manual/configuration/firewall.xml
+++ b/nixos/doc/manual/configuration/firewall.xml
@@ -23,10 +23,23 @@ networking.firewall.allowedTCPPorts = [ 80 443 ];
 </programlisting>
 
 Note that TCP port 22 (ssh) is opened automatically if the SSH daemon
-is enabled (<option>services.openssh.enable = true</option>).  UDP
+is enabled (<option>services.openssh.enable = true</option>). UDP
 ports can be opened through
-<option>networking.firewall.allowedUDPPorts</option>.  Also of
-interest is
+<option>networking.firewall.allowedUDPPorts</option>.</para>
+
+<para>To open ranges of TCP ports:
+
+<programlisting>
+networking.firewall.allowedTCPPortRanges = [
+  { from = 4000; to = 4007; }
+  { from = 8000; to = 8010; }
+];
+</programlisting>
+
+Similarly, UDP port ranges can be opened through
+<option>networking.firewall.allowedUDPPortRanges</option>.</para>
+
+<para>Also of interest is
 
 <programlisting>
 networking.firewall.allowPing = true;
diff --git a/nixos/doc/manual/configuration/ipv4-config.xml b/nixos/doc/manual/configuration/ipv4-config.xml
index 053501b1736..68238b547d6 100644
--- a/nixos/doc/manual/configuration/ipv4-config.xml
+++ b/nixos/doc/manual/configuration/ipv4-config.xml
@@ -12,7 +12,7 @@ interfaces.  However, you can configure an interface manually as
 follows:
 
 <programlisting>
-networking.interfaces.eth0.ip4 = [ { address = "192.168.1.2"; prefixLength = 24; } ];
+networking.interfaces.eth0.ipv4.addresses = [ { address = "192.168.1.2"; prefixLength = 24; } ];
 </programlisting>
 
 Typically you’ll also want to set a default gateway and set of name
diff --git a/nixos/doc/manual/configuration/ipv6-config.xml b/nixos/doc/manual/configuration/ipv6-config.xml
index 6d9e0a164e9..74a21e18ec3 100644
--- a/nixos/doc/manual/configuration/ipv6-config.xml
+++ b/nixos/doc/manual/configuration/ipv6-config.xml
@@ -26,7 +26,7 @@ boot.kernel.sysctl."net.ipv6.conf.eth0.disable_ipv6" = true;
 DHCPv6. You can configure an interface manually:
 
 <programlisting>
-networking.interfaces.eth0.ip6 = [ { address = "fe00:aa:bb:cc::2"; prefixLength = 64; } ];
+networking.interfaces.eth0.ipv6.addresses = [ { address = "fe00:aa:bb:cc::2"; prefixLength = 64; } ];
 </programlisting>
 </para>
 
diff --git a/nixos/doc/manual/configuration/user-mgmt.xml b/nixos/doc/manual/configuration/user-mgmt.xml
index 2bd9cca5622..c6656edff6c 100644
--- a/nixos/doc/manual/configuration/user-mgmt.xml
+++ b/nixos/doc/manual/configuration/user-mgmt.xml
@@ -12,7 +12,7 @@ management.  In the declarative style, users are specified in
 states that a user account named <literal>alice</literal> shall exist:
 
 <programlisting>
-users.extraUsers.alice =
+users.users.alice =
   { isNormalUser = true;
     home = "/home/alice";
     description = "Alice Foobar";
@@ -34,7 +34,7 @@ to set a password, which is retained across invocations of
 
 <para>If you set users.mutableUsers to false, then the contents of /etc/passwd
 and /etc/group will be congruent to your NixOS configuration. For instance,
-if you remove a user from users.extraUsers and run nixos-rebuild, the user
+if you remove a user from users.users and run nixos-rebuild, the user
 account will cease to exist. Also, imperative commands for managing users
 and groups, such as useradd, are no longer available. Passwords may still be
 assigned by setting the user's <literal>hashedPassword</literal> option. A
@@ -54,7 +54,7 @@ to the user specification.</para>
 group named <literal>students</literal> shall exist:
 
 <programlisting>
-users.extraGroups.students.gid = 1000;
+users.groups.students.gid = 1000;
 </programlisting>
 
 As with users, the group ID (gid) is optional and will be assigned
@@ -68,8 +68,8 @@ account named <literal>alice</literal>:
 <screen>
 # useradd -m alice</screen>
 
-To make all nix tools available to this new user use `su - USER` which 
-opens a login shell (==shell that loads the profile) for given user. 
+To make all nix tools available to this new user use `su - USER` which
+opens a login shell (==shell that loads the profile) for given user.
 This will create the ~/.nix-defexpr symlink. So run:
 
 <screen>
diff --git a/nixos/doc/manual/configuration/x-windows.xml b/nixos/doc/manual/configuration/x-windows.xml
index fc6082ce3af..9c2c59006f1 100644
--- a/nixos/doc/manual/configuration/x-windows.xml
+++ b/nixos/doc/manual/configuration/x-windows.xml
@@ -115,13 +115,14 @@ hardware.opengl.driSupport32Bit = true;
 <para>Support for Synaptics touchpads (found in many laptops such as
 the Dell Latitude series) can be enabled as follows:
 <programlisting>
-services.xserver.synaptics.enable = true;
+services.xserver.libinput.enable = true;
 </programlisting>
 The driver has many options (see <xref linkend="ch-options"/>).  For
-instance, the following enables two-finger scrolling:
+instance, the following disables tap-to-click behavior:
 <programlisting>
-services.xserver.synaptics.twoFingerScroll = true;
+services.xserver.libinput.tapping = false;
 </programlisting>
+Note: the use of <literal>services.xserver.synaptics</literal> is deprecated since NixOS 17.09.
 </para>
 
 </simplesect>
@@ -129,7 +130,7 @@ services.xserver.synaptics.twoFingerScroll = true;
 <simplesect><title>GTK/Qt themes</title>
 
 <para>GTK themes can be installed either to user profile or system-wide (via
-<literal>system.environmentPackages</literal>). To make Qt 5 applications look similar
+<literal>environment.systemPackages</literal>). To make Qt 5 applications look similar
 to GTK2 ones, you can install <literal>qt5.qtbase.gtk</literal> package into your
 system environment. It should work for all Qt 5 library versions.
 </para>
diff --git a/nixos/doc/manual/configuration/xfce.xml b/nixos/doc/manual/configuration/xfce.xml
index 21c7a85e19c..18804d2c08b 100644
--- a/nixos/doc/manual/configuration/xfce.xml
+++ b/nixos/doc/manual/configuration/xfce.xml
@@ -35,18 +35,7 @@ services.compton = {
         To install them manually (system wide), put them into your
         <literal>environment.systemPackages</literal>.
     </para>
-
-    <para>
-        NixOS’s default <emphasis>display manager</emphasis> is SLiM.
-        (DM is the program that provides a graphical login prompt
-         and manages the X server.)
-        You can, for example, select KDE’s
-        <command>sddm</command> instead:
-        <programlisting>
-services.xserver.displayManager.sddm.enable = true;
-        </programlisting>
-    </para>
-
+         
     <simplesect>
         <title>Thunar Volume Support</title>
 
diff --git a/nixos/doc/manual/default.nix b/nixos/doc/manual/default.nix
index 9413d71a34c..ac22712baf8 100644
--- a/nixos/doc/manual/default.nix
+++ b/nixos/doc/manual/default.nix
@@ -6,22 +6,52 @@ let
   lib = pkgs.lib;
 
   # Remove invisible and internal options.
-  optionsList = lib.filter (opt: opt.visible && !opt.internal) (lib.optionAttrSetToDocList options);
+  optionsListVisible = lib.filter (opt: opt.visible && !opt.internal) (lib.optionAttrSetToDocList options);
 
   # Replace functions by the string <function>
   substFunction = x:
     if builtins.isAttrs x then lib.mapAttrs (name: substFunction) x
     else if builtins.isList x then map substFunction x
-    else if builtins.isFunction x then "<function>"
+    else if lib.isFunction x then "<function>"
     else x;
 
-  # Clean up declaration sites to not refer to the NixOS source tree.
-  optionsList' = lib.flip map optionsList (opt: opt // {
+  # Generate DocBook documentation for a list of packages. This is
+  # what `relatedPackages` option of `mkOption` from
+  # ../../../lib/options.nix influences.
+  #
+  # Each element of `relatedPackages` can be either
+  # - a string:  that will be interpreted as an attribute name from `pkgs`,
+  # - a list:    that will be interpreted as an attribute path from `pkgs`,
+  # - an attrset: that can specify `name`, `path`, `package`, `comment`
+  #   (either of `name`, `path` is required, the rest are optional).
+  genRelatedPackages = packages:
+    let
+      unpack = p: if lib.isString p then { name = p; }
+                  else if lib.isList p then { path = p; }
+                  else p;
+      describe = args:
+        let
+          name = args.name or (lib.concatStringsSep "." args.path);
+          path = args.path or [ args.name ];
+          package = args.package or (lib.attrByPath path (throw "Invalid package attribute path `${toString path}'") pkgs);
+        in "<listitem>"
+        + "<para><literal>pkgs.${name} (${package.meta.name})</literal>"
+        + lib.optionalString (!package.meta.available) " <emphasis>[UNAVAILABLE]</emphasis>"
+        + ": ${package.meta.description or "???"}.</para>"
+        + lib.optionalString (args ? comment) "\n<para>${args.comment}</para>"
+        # Lots of `longDescription's break DocBook, so we just wrap them into <programlisting>
+        + lib.optionalString (package.meta ? longDescription) "\n<programlisting>${package.meta.longDescription}</programlisting>"
+        + "</listitem>";
+    in "<itemizedlist>${lib.concatStringsSep "\n" (map (p: describe (unpack p)) packages)}</itemizedlist>";
+
+  optionsListDesc = lib.flip map optionsListVisible (opt: opt // {
+    # Clean up declaration sites to not refer to the NixOS source tree.
     declarations = map stripAnyPrefixes opt.declarations;
   }
   // lib.optionalAttrs (opt ? example) { example = substFunction opt.example; }
   // lib.optionalAttrs (opt ? default) { default = substFunction opt.default; }
-  // lib.optionalAttrs (opt ? type) { type = substFunction opt.type; });
+  // lib.optionalAttrs (opt ? type) { type = substFunction opt.type; }
+  // lib.optionalAttrs (opt ? relatedPackages) { relatedPackages = genRelatedPackages opt.relatedPackages; });
 
   # We need to strip references to /nix/store/* from options,
   # including any `extraSources` if some modules came from elsewhere,
@@ -32,8 +62,21 @@ let
   prefixesToStrip = map (p: "${toString p}/") ([ ../../.. ] ++ extraSources);
   stripAnyPrefixes = lib.flip (lib.fold lib.removePrefix) prefixesToStrip;
 
+  # Custom "less" that pushes up all the things ending in ".enable*"
+  # and ".package*"
+  optionLess = a: b:
+    let
+      ise = lib.hasPrefix "enable";
+      isp = lib.hasPrefix "package";
+      cmp = lib.splitByAndCompare ise lib.compare
+                                 (lib.splitByAndCompare isp lib.compare lib.compare);
+    in lib.compareLists cmp a.loc b.loc < 0;
+
+  # Customly sort option list for the man page.
+  optionsList = lib.sort optionLess optionsListDesc;
+
   # Convert the list of options into an XML file.
-  optionsXML = builtins.toFile "options.xml" (builtins.toXML optionsList');
+  optionsXML = builtins.toFile "options.xml" (builtins.toXML optionsList);
 
   optionsDocBook = runCommand "options-db.xml" {} ''
     optionsXML=${optionsXML}
@@ -44,7 +87,7 @@ let
       echo "for hints about the offending path)."
       exit 1
     fi
-    ${libxslt.bin}/bin/xsltproc \
+    ${buildPackages.libxslt.bin}/bin/xsltproc \
       --stringparam revision '${revision}' \
       -o $out ${./options-to-docbook.xsl} $optionsXML
   '';
@@ -81,11 +124,12 @@ let
   manualXsltprocOptions = toString [
     "--param section.autolabel 1"
     "--param section.label.includes.component.label 1"
-    "--stringparam html.stylesheet style.css"
+    "--stringparam html.stylesheet 'style.css overrides.css highlightjs/mono-blue.css'"
+    "--stringparam html.script './highlightjs/highlight.pack.js ./highlightjs/loader.js'"
     "--param xref.with.number.and.title 1"
     "--param toc.section.depth 3"
     "--stringparam admon.style ''"
-    "--stringparam callout.graphics.extension .gif"
+    "--stringparam callout.graphics.extension .svg"
     "--stringparam current.docid manual"
     "--param chunk.section.depth 0"
     "--param chunk.first.sections 1"
@@ -96,7 +140,7 @@ let
 
   manual-combined = runCommand "nixos-manual-combined"
     { inherit sources;
-      buildInputs = [ libxml2 libxslt ];
+      nativeBuildInputs = [ buildPackages.libxml2.bin buildPackages.libxslt.bin ];
       meta.description = "The NixOS manual as plain docbook XML";
     }
     ''
@@ -106,13 +150,43 @@ let
       xmllint --xinclude --noxincludenode \
          --output ./man-pages-combined.xml ./man-pages.xml
 
-      xmllint --debug --noout --nonet \
-        --relaxng ${docbook5}/xml/rng/docbook/docbook.rng \
-        manual-combined.xml
-      xmllint --debug --noout --nonet \
-        --relaxng ${docbook5}/xml/rng/docbook/docbook.rng \
-        man-pages-combined.xml
-
+      # outputs the context of an xmllint error output
+      # LEN lines around the failing line are printed
+      function context {
+        # length of context
+        local LEN=6
+        # lines to print before error line
+        local BEFORE=4
+
+        # xmllint output lines are:
+        # file.xml:1234: there was an error on line 1234
+        while IFS=':' read -r file line rest; do
+          echo
+          if [[ -n "$rest" ]]; then
+            echo "$file:$line:$rest"
+            local FROM=$(($line>$BEFORE ? $line - $BEFORE : 1))
+            # number lines & filter context
+            nl --body-numbering=a "$file" | sed -n "$FROM,+$LEN p"
+          else
+            if [[ -n "$line" ]]; then
+              echo "$file:$line"
+            else
+              echo "$file"
+            fi
+          fi
+        done
+      }
+
+      function lintrng {
+        xmllint --debug --noout --nonet \
+          --relaxng ${docbook5}/xml/rng/docbook/docbook.rng \
+          "$1" \
+          2>&1 | context 1>&2
+          # ^ redirect assumes xmllint doesn’t print to stdout
+      }
+
+      lintrng manual-combined.xml
+      lintrng man-pages-combined.xml
 
       mkdir $out
       cp manual-combined.xml $out/
@@ -121,7 +195,7 @@ let
 
   olinkDB = runCommand "manual-olinkdb"
     { inherit sources;
-      buildInputs = [ libxml2 libxslt ];
+      nativeBuildInputs = [ buildPackages.libxml2.bin buildPackages.libxslt.bin ];
     }
     ''
       xsltproc \
@@ -161,7 +235,7 @@ in rec {
       mkdir -p $dst
 
       cp ${builtins.toFile "options.json" (builtins.unsafeDiscardStringContext (builtins.toJSON
-        (builtins.listToAttrs (map (o: { name = o.name; value = removeAttrs o ["name" "visible" "internal"]; }) optionsList'))))
+        (builtins.listToAttrs (map (o: { name = o.name; value = removeAttrs o ["name" "visible" "internal"]; }) optionsList))))
       } $dst/options.json
 
       mkdir -p $out/nix-support
@@ -171,7 +245,7 @@ in rec {
   # Generate the NixOS manual.
   manual = runCommand "nixos-manual"
     { inherit sources;
-      buildInputs = [ libxml2 libxslt ];
+      nativeBuildInputs = [ buildPackages.libxml2.bin buildPackages.libxslt.bin ];
       meta.description = "The NixOS manual in HTML format";
       allowedReferences = ["out"];
     }
@@ -187,9 +261,11 @@ in rec {
         ${manual-combined}/manual-combined.xml
 
       mkdir -p $dst/images/callouts
-      cp ${docbook5_xsl}/xml/xsl/docbook/images/callouts/*.gif $dst/images/callouts/
+      cp ${docbook5_xsl}/xml/xsl/docbook/images/callouts/*.svg $dst/images/callouts/
 
-      cp ${./style.css} $dst/style.css
+      cp ${../../../doc/style.css} $dst/style.css
+      cp ${../../../doc/overrides.css} $dst/overrides.css
+      cp -r ${pkgs.documentation-highlighter} $dst/highlightjs
 
       mkdir -p $out/nix-support
       echo "nix-build out $out" >> $out/nix-support/hydra-build-products
@@ -199,7 +275,7 @@ in rec {
 
   manualEpub = runCommand "nixos-manual-epub"
     { inherit sources;
-      buildInputs = [ libxml2 libxslt zip ];
+      buildInputs = [ libxml2.bin libxslt.bin zip ];
     }
     ''
       # Generate the epub manual.
@@ -213,7 +289,7 @@ in rec {
         ${manual-combined}/manual-combined.xml
 
       mkdir -p $dst/epub/OEBPS/images/callouts
-      cp -r ${docbook5_xsl}/xml/xsl/docbook/images/callouts/*.gif $dst/epub/OEBPS/images/callouts # */
+      cp -r ${docbook5_xsl}/xml/xsl/docbook/images/callouts/*.svg $dst/epub/OEBPS/images/callouts # */
       echo "application/epub+zip" > mimetype
       manual="$dst/nixos-manual.epub"
       zip -0Xq "$manual" mimetype
@@ -229,7 +305,7 @@ in rec {
   # Generate the NixOS manpages.
   manpages = runCommand "nixos-manpages"
     { inherit sources;
-      buildInputs = [ libxml2 libxslt ];
+      nativeBuildInputs = [ buildPackages.libxml2.bin buildPackages.libxslt.bin ];
       allowedReferences = ["out"];
     }
     ''
diff --git a/nixos/doc/manual/development/option-declarations.xml b/nixos/doc/manual/development/option-declarations.xml
index be793152f9e..ed718c89eb7 100644
--- a/nixos/doc/manual/development/option-declarations.xml
+++ b/nixos/doc/manual/development/option-declarations.xml
@@ -22,6 +22,15 @@ options = {
 };
 </programlisting>
 
+The attribute names within the <replaceable>name</replaceable>
+attribute path must be camel cased in general but should, as an
+exception, match the
+<link
+xlink:href="https://nixos.org/nixpkgs/manual/#sec-package-naming">
+package attribute name</link> when referencing a Nixpkgs package. For
+example, the option <varname>services.nix-serve.bindAddress</varname>
+references the <varname>nix-serve</varname> Nixpkgs package.
+
 </para>
 
 <para>The function <varname>mkOption</varname> accepts the following arguments.
diff --git a/nixos/doc/manual/development/option-types.xml b/nixos/doc/manual/development/option-types.xml
index 83dcf0232d9..13fa8d1e114 100644
--- a/nixos/doc/manual/development/option-types.xml
+++ b/nixos/doc/manual/development/option-types.xml
@@ -110,6 +110,12 @@
     <listitem><para>A string. Multiple definitions are concatenated with a 
         collon <literal>":"</literal>.</para></listitem>
   </varlistentry>
+  <varlistentry>
+    <term><varname>types.strMatching</varname></term>
+    <listitem><para>A string matching a specific regular expression. Multiple
+    definitions cannot be merged.  The regular expression is processed using
+    <literal>builtins.match</literal>.</para></listitem>
+  </varlistentry>
 </variablelist>
 
  </section>
@@ -276,8 +282,8 @@ options.mod = mkOption {
     option set (<xref linkend='ex-submodule-listof-definition' />).</para>
     
 
-<example xml:id='ex-submodule-listof-declaration'><title>Declaration of a list 
-    nof submodules</title>
+<example xml:id='ex-submodule-listof-declaration'><title>Declaration of a list
+    of submodules</title>
 <screen>
 options.mod = mkOption {
   description = "submodule example";
diff --git a/nixos/doc/manual/development/testing-installer.xml b/nixos/doc/manual/development/testing-installer.xml
index 20c8d51815a..16bc8125d9f 100644
--- a/nixos/doc/manual/development/testing-installer.xml
+++ b/nixos/doc/manual/development/testing-installer.xml
@@ -11,15 +11,17 @@ tedious, so here is a quick way to see if the installer works
 properly:
 
 <screen>
-$ nix-build -A config.system.build.nixos-install
 # mount -t tmpfs none /mnt
+# nixos-generate-config --root /mnt
+$ nix-build '&lt;nixpkgs/nixos>' -A config.system.build.nixos-install
 # ./result/bin/nixos-install</screen>
 
 To start a login shell in the new NixOS installation in
 <filename>/mnt</filename>:
 
 <screen>
-# ./result/bin/nixos-install --chroot
+$ nix-build '&lt;nixpkgs/nixos>' -A config.system.build.nixos-enter
+# ./result/bin/nixos-enter
 </screen>
 
 </para>
diff --git a/nixos/doc/manual/development/writing-nixos-tests.xml b/nixos/doc/manual/development/writing-nixos-tests.xml
index b9da712b86f..a8f6aa00858 100644
--- a/nixos/doc/manual/development/writing-nixos-tests.xml
+++ b/nixos/doc/manual/development/writing-nixos-tests.xml
@@ -262,8 +262,47 @@ startAll;
     <literal>waitForWindow(qr/Terminal/)</literal>.</para></listitem>
   </varlistentry>
 
+  <varlistentry>
+    <term><methodname>copyFileFromHost</methodname></term>
+    <listitem><para>Copies a file from host to machine, e.g.,
+    <literal>copyFileFromHost("myfile", "/etc/my/important/file")</literal>.</para>
+    <para>The first argument is the file on the host. The file needs to be
+    accessible while building the nix derivation. The second argument is
+    the location of the file on the machine.</para>
+    </listitem>
+  </varlistentry>
+
+  <varlistentry>
+    <term><methodname>systemctl</methodname></term>
+    <listitem>
+      <para>Runs <literal>systemctl</literal> commands with optional support for
+      <literal>systemctl --user</literal></para>
+    <para>
+      <programlisting>
+        $machine->systemctl("list-jobs --no-pager"); // runs `systemctl list-jobs --no-pager`
+        $machine->systemctl("list-jobs --no-pager", "any-user"); // spawns a shell for `any-user` and runs `systemctl --user list-jobs --no-pager`
+      </programlisting>
+    </para>
+    </listitem>
+  </varlistentry>
+
 </variablelist>
 
 </para>
 
-</section>
\ No newline at end of file
+<para>
+  To test user units declared by <literal>systemd.user.services</literal> the optional <literal>$user</literal>
+  argument can be used:
+
+  <programlisting>
+    $machine->start;
+    $machine->waitForX;
+    $machine->waitForUnit("xautolock.service", "x-session-user");
+  </programlisting>
+
+  This applies to <literal>systemctl</literal>, <literal>getUnitInfo</literal>,
+  <literal>waitForUnit</literal>, <literal>startJob</literal>
+  and <literal>stopJob</literal>.
+</para>
+
+</section>
diff --git a/nixos/doc/manual/installation/changing-config.xml b/nixos/doc/manual/installation/changing-config.xml
index 75df307a1b7..4db9020b960 100644
--- a/nixos/doc/manual/installation/changing-config.xml
+++ b/nixos/doc/manual/installation/changing-config.xml
@@ -70,9 +70,21 @@ $ ./result/bin/run-*-vm
 </screen>
 
 The VM does not have any data from your host system, so your existing
-user accounts and home directories will not be available.  You can
-forward ports on the host to the guest.  For instance, the following
-will forward host port 2222 to guest port 22 (SSH):
+user accounts and home directories will not be available unless you
+have set <literal>mutableUsers = false</literal>.  Another way is to
+temporarily add the following to your configuration:
+
+<screen>
+users.extraUsers.your-user.initialPassword = "test"  
+</screen>
+
+<emphasis>Important:</emphasis> delete the $hostname.qcow2 file if you
+have started the virtual machine at least once without the right
+users, otherwise the changes will not get picked up.
+
+You can forward ports on the host to the guest.  For
+instance, the following will forward host port 2222 to guest port 22
+(SSH):
 
 <screen>
 $ QEMU_NET_OPTS="hostfwd=tcp::2222-:22" ./result/bin/run-*-vm
diff --git a/nixos/doc/manual/installation/installing-from-other-distro.xml b/nixos/doc/manual/installation/installing-from-other-distro.xml
new file mode 100644
index 00000000000..ecd020a067a
--- /dev/null
+++ b/nixos/doc/manual/installation/installing-from-other-distro.xml
@@ -0,0 +1,309 @@
+<!-- vim: set expandtab ts=2 softtabstop=2 shiftwidth=2 smarttab textwidth=80 wrapmargin=2 -->
+<section
+    xmlns="http://docbook.org/ns/docbook"
+    xmlns:xlink="http://www.w3.org/1999/xlink"
+    xmlns:xi="http://www.w3.org/2001/XInclude"
+    version="5.0"
+    xml:id="sec-installing-from-other-distro">
+
+    <title>Installing from another Linux distribution</title>
+
+    <para>
+        Because Nix (the package manager) &amp; Nixpkgs (the Nix packages
+        collection) can both be installed on any (most?) Linux distributions,
+        they can be used to install NixOS in various creative ways. You can,
+        for instance:
+    </para>
+
+    <orderedlist>
+        <listitem><para>Install NixOS on another partition, from your existing
+                Linux distribution (without the use of a USB or optical
+                device!)</para></listitem>
+
+        <listitem><para>Install NixOS on the same partition (in place!), from
+                your existing non-NixOS Linux distribution using
+                <literal>NIXOS_LUSTRATE</literal>.</para></listitem>
+
+        <listitem><para>Install NixOS on your hard drive from the Live CD of
+                any Linux distribution.</para></listitem>
+    </orderedlist>
+
+    <para>The first steps to all these are the same:</para>
+
+    <orderedlist>
+        <listitem>
+            <para>Install the Nix package manager:</para>
+
+            <para>Short version:</para>
+
+            <screen>
+$ bash &lt;(curl https://nixos.org/nix/install)
+$ . $HOME/.nix-profile/etc/profile.d/nix.sh # …or open a fresh shell</screen>
+
+            <para>More details in the <link
+                    xlink:href="https://nixos.org/nix/manual/#chap-quick-start">
+                    Nix manual</link></para>
+        </listitem>
+
+        <listitem>
+            <para>Switch to the NixOS channel:</para>
+
+            <para>If you've just installed Nix on a non-NixOS distribution, you
+                will be on the <literal>nixpkgs</literal> channel by
+                default.</para>
+
+            <screen>
+$ nix-channel --list
+nixpkgs https://nixos.org/channels/nixpkgs-unstable</screen>
+
+            <para>As that channel gets released without running the NixOS
+                tests, it will be safer to use the <literal>nixos-*</literal>
+                channels instead:</para>
+
+            <screen>
+$ nix-channel --add https://nixos.org/channels/nixos-<replaceable>version</replaceable> nixpkgs</screen>
+
+            <para>You may want to throw in a <literal>nix-channel
+                    --update</literal> for good measure.</para>
+        </listitem>
+
+        <listitem>
+            <para>Install the NixOS installation tools:</para>
+
+            <para>You'll need <literal>nixos-generate-config</literal> and
+                <literal>nixos-install</literal> and we'll throw in some man
+                pages and <literal>nixos-enter</literal> just in case you want
+                to chroot into your NixOS partition. They are installed by
+                default on NixOS, but you don't have NixOS yet..</para>
+
+            <screen>$ nix-env -iE "_: with import &lt;nixpkgs/nixos&gt; { configuration = {}; }; with config.system.build; [ nixos-generate-config nixos-install nixos-enter manual.manpages ]"</screen>
+        </listitem>
+
+        <listitem>
+            <note><para>The following 5 steps are only for installing NixOS to
+                    another partition. For installing NixOS in place using
+                    <literal>NIXOS_LUSTRATE</literal>, skip ahead.</para></note>
+
+            <para>Prepare your target partition:</para>
+
+            <para>At this point it is time to prepare your target partition.
+                Please refer to the partitioning, file-system creation, and
+                mounting steps of <xref linkend="sec-installation" /></para>
+
+            <para>If you're about to install NixOS in place using
+                <literal>NIXOS_LUSTRATE</literal> there is nothing to do for
+                this step.</para>
+        </listitem>
+
+        <listitem>
+            <para>Generate your NixOS configuration:</para>
+
+            <screen>$ sudo `which nixos-generate-config` --root /mnt</screen>
+
+            <para>You'll probably want to edit the configuration files. Refer
+                to the <literal>nixos-generate-config</literal> step in <xref
+                    linkend="sec-installation" /> for more information.</para>
+
+            <para>Consider setting up the NixOS bootloader to give you the
+                ability to boot on your existing Linux partition. For instance,
+                if you're using GRUB and your existing distribution is running
+                Ubuntu, you may want to add something like this to your
+                <literal>configuration.nix</literal>:</para>
+
+            <programlisting>
+boot.loader.grub.extraEntries = ''
+  menuentry "Ubuntu" {
+    search --set=ubuntu --fs-uuid 3cc3e652-0c1f-4800-8451-033754f68e6e
+    configfile "($ubuntu)/boot/grub/grub.cfg"
+  }
+'';</programlisting>
+
+            <para>(You can find the appropriate UUID for your partition in
+                <literal>/dev/disk/by-uuid</literal>)</para>
+        </listitem>
+
+        <listitem>
+            <para>Create the <literal>nixbld</literal> group and user on your
+                original distribution:</para>
+
+            <screen>
+$ sudo groupadd -g 30000 nixbld
+$ sudo useradd -u 30000 -g nixbld -G nixbld nixbld</screen>
+        </listitem>
+
+        <listitem>
+            <para>Download/build/install NixOS:</para>
+
+            <warning><para>Once you complete this step, you might no longer be
+                    able to boot on existing systems without the help of a
+                    rescue USB drive or similar.</para></warning>
+
+            <screen>$ sudo PATH="$PATH" NIX_PATH="$NIX_PATH" `which nixos-install` --root /mnt</screen>
+
+            <para>Again, please refer to the <literal>nixos-install</literal>
+                step in <xref linkend="sec-installation" /> for more
+                information.</para>
+
+            <para>That should be it for installation to another partition!</para>
+        </listitem>
+
+        <listitem>
+            <para>Optionally, you may want to clean up your non-NixOS distribution:</para>
+
+            <screen>
+$ sudo userdel nixbld
+$ sudo groupdel nixbld</screen>
+
+            <para>If you do not wish to keep the Nix package mananager
+                installed either, run something like <literal>sudo rm -rv
+                    ~/.nix-* /nix</literal> and remove the line that the Nix
+                installer added to your <literal>~/.profile</literal>.</para>
+        </listitem>
+
+        <listitem>
+            <note><para>The following steps are only for installing NixOS in
+                    place using
+                    <literal>NIXOS_LUSTRATE</literal>:</para></note>
+
+            <para>Generate your NixOS configuration:</para>
+
+            <screen>$ sudo `which nixos-generate-config` --root /</screen>
+
+            <para>Note that this will place the generated configuration files
+                in <literal>/etc/nixos</literal>. You'll probably want to edit
+                the configuration files. Refer to the
+                <literal>nixos-generate-config</literal> step in <xref
+                    linkend="sec-installation" /> for more information.</para>
+
+            <para>You'll likely want to set a root password for your first boot
+                using the configuration files because you won't have a chance
+                to enter a password until after you reboot. You can initalize
+                the root password to an empty one with this line: (and of course
+                don't forget to set one once you've rebooted or to lock the
+                account with <literal>sudo passwd -l root</literal> if you use
+                <literal>sudo</literal>)</para>
+
+            <programlisting>users.extraUsers.root.initialHashedPassword = "";</programlisting>
+        </listitem>
+
+        <listitem>
+            <para>Build the NixOS closure and install it in the
+                <literal>system</literal> profile:</para>
+
+            <screen>$ nix-env -p /nix/var/nix/profiles/system -f '&lt;nixpkgs/nixos&gt;' -I nixos-config=/etc/nixos/configuration.nix -iA system</screen>
+        </listitem>
+
+        <listitem>
+            <para>Change ownership of the <literal>/nix</literal> tree to root
+                (since your Nix install was probably single user):</para>
+
+            <screen>$ sudo chown -R 0.0 /nix</screen>
+        </listitem>
+
+        <listitem>
+            <para>Set up the <literal>/etc/NIXOS</literal> and
+                <literal>/etc/NIXOS_LUSTRATE</literal> files:</para>
+
+            <para><literal>/etc/NIXOS</literal> officializes that this is now a
+                NixOS partition (the bootup scripts require its presence).</para>
+
+            <para><literal>/etc/NIXOS_LUSTRATE</literal> tells the NixOS bootup
+                scripts to move <emphasis>everything</emphasis> that's in the
+                root partition to <literal>/old-root</literal>. This will move
+                your existing distribution out of the way in the very early
+                stages of the NixOS bootup. There are exceptions (we do need to
+                keep NixOS there after all), so the NixOS lustrate process will
+                not touch:</para>
+
+            <itemizedlist>
+                <listitem><para>The <literal>/nix</literal>
+                        directory</para></listitem>
+
+                <listitem><para>The <literal>/boot</literal>
+                        directory</para></listitem>
+
+                <listitem><para>Any file or directory listed in
+                        <literal>/etc/NIXOS_LUSTRATE</literal> (one per
+                        line)</para></listitem>
+            </itemizedlist>
+
+            <note><para>Support for <literal>NIXOS_LUSTRATE</literal> was added
+                    in NixOS 16.09. The act of "lustrating" refers to the
+                    wiping of the existing distribution. Creating
+                    <literal>/etc/NIXOS_LUSTRATE</literal> can also be used on
+                    NixOS to remove all mutable files from your root partition
+                    (anything that's not in <literal>/nix</literal> or
+                    <literal>/boot</literal> gets "lustrated" on the next
+                    boot.</para>
+                <para>lustrate /ˈlʌstreɪt/ verb.</para>
+                <para>purify by expiatory sacrifice, ceremonial washing, or
+                    some other ritual action.</para></note>
+
+            <para>Let's create the files:</para>
+
+            <screen>
+$ sudo touch /etc/NIXOS
+$ sudo touch /etc/NIXOS_LUSTRATE</screen>
+
+            <para>Let's also make sure the NixOS configuration files are kept
+                once we reboot on NixOS:</para>
+
+            <screen>
+$ echo etc/nixos | sudo tee -a /etc/NIXOS_LUSTRATE</screen>
+        </listitem>
+
+        <listitem>
+            <para>Finally, move the <literal>/boot</literal> directory of your
+                current distribution out of the way (the lustrate process will
+                take care of the rest once you reboot, but this one must be
+                moved out now because NixOS needs to install its own boot
+                files:</para>
+
+            <warning><para>Once you complete this step, your current
+                    distribution will no longer be bootable! If you didn't get
+                    all the NixOS configuration right, especially those
+                    settings pertaining to boot loading and root partition,
+                    NixOS may not be bootable either. Have a USB rescue device
+                    ready in case this happens. </para></warning>
+
+            <screen>
+$ sudo mv -v /boot /boot.bak &amp;&amp;
+    sudo /nix/var/nix/profiles/system/bin/switch-to-configuration boot</screen>
+
+            <para>Cross your fingers, reboot, hopefully you should get a NixOS
+                prompt!</para>
+        </listitem>
+        <listitem>
+            <para>If for some reason you want to revert to the old
+                distribution, you'll need to boot on a USB rescue disk and do
+                something along these lines:</para>
+
+            <screen>
+# mkdir root
+# mount /dev/sdaX root
+# mkdir root/nixos-root
+# mv -v root/* root/nixos-root/
+# mv -v root/nixos-root/old-root/* root/
+# mv -v root/boot.bak root/boot  # We had renamed this by hand earlier
+# umount root
+# reboot</screen>
+
+            <para>This may work as is or you might also need to reinstall the
+                boot loader</para>
+
+            <para>And of course, if you're happy with NixOS and no longer need
+                the old distribution:</para>
+
+            <screen>sudo rm -rf /old-root</screen>
+        </listitem>
+
+        <listitem>
+            <para>It's also worth noting that this whole process can be
+                automated. This is especially useful for Cloud VMs, where
+                provider do not provide NixOS. For instance, <link
+                    xlink:href="https://github.com/elitak/nixos-infect">nixos-infect</link>
+                uses the lustrate process to convert Digital Ocean droplets to
+                NixOS from other distributions automatically.</para>
+        </listitem>
+    </orderedlist>
+</section>
diff --git a/nixos/doc/manual/installation/installing-uefi.xml b/nixos/doc/manual/installation/installing-uefi.xml
deleted file mode 100644
index 0d3eaa8bb1f..00000000000
--- a/nixos/doc/manual/installation/installing-uefi.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-<section xmlns="http://docbook.org/ns/docbook"
-         xmlns:xlink="http://www.w3.org/1999/xlink"
-         xmlns:xi="http://www.w3.org/2001/XInclude"
-         version="5.0"
-         xml:id="sec-uefi-installation">
-
-<title>UEFI Installation</title>
-
-<para>NixOS can also be installed on UEFI systems.  The procedure
-is by and large the same as a BIOS installation, with the following
-changes:
-
-<itemizedlist>
-  <listitem>
-    <para>You should boot the live CD in UEFI mode (consult your
-    specific hardware's documentation for instructions). You may find
-    the <link
-    xlink:href="http://www.rodsbooks.com/refind">rEFInd
-    boot manager</link> useful.</para>
-  </listitem>
-  <listitem>
-    <para>Instead of <command>fdisk</command>, you should use
-    <command>gdisk</command> to partition your disks. You will need to
-    have a separate partition for <filename>/boot</filename> with
-    partition code EF00, and it should be formatted as a
-    <literal>vfat</literal> filesystem.</para>
-  </listitem>
-  <listitem>
-    <para>Instead of <option>boot.loader.grub.device</option>,
-    you must set <option>boot.loader.systemd-boot.enable</option> to
-    <literal>true</literal>. <command>nixos-generate-config</command>
-    should do this automatically for new configurations when booted in
-    UEFI mode.</para>
-  </listitem>
-  <listitem>
-    <para>After having mounted your installation partition to
-    <code>/mnt</code>, you must mount the <code>boot</code> partition
-    to <code>/mnt/boot</code>.</para>
-  </listitem>
-  <listitem>
-    <para>You may want to look at the options starting with
-    <option>boot.loader.efi</option> and <option>boot.loader.systemd-boot</option>
-    as well.</para>
-  </listitem>
-</itemizedlist>
-</para>
-
-</section>
diff --git a/nixos/doc/manual/installation/installing-usb.xml b/nixos/doc/manual/installation/installing-usb.xml
index 31d51816e39..d68cd616263 100644
--- a/nixos/doc/manual/installation/installing-usb.xml
+++ b/nixos/doc/manual/installation/installing-usb.xml
@@ -11,10 +11,24 @@ a USB stick. You can use the <command>dd</command> utility to write the image:
 <command>dd if=<replaceable>path-to-image</replaceable>
 of=<replaceable>/dev/sdb</replaceable></command>. Be careful about specifying the
 correct drive; you can use the <command>lsblk</command> command to get a list of
-block devices. If you're on macOS you can run <command>diskutil list</command>
-to see the list of devices; the device you'll use for the USB must be ejected
-before writing the image.</para>
+block devices.</para>
 
+<para>On macOS:
+<programlisting>
+$ diskutil list
+[..]
+/dev/diskN (external, physical):
+   #:                       TYPE NAME                    SIZE       IDENTIFIER
+[..]
+$ diskutil unmountDisk diskN
+Unmount of all volumes on diskN was successful
+$ sudo dd bs=1m if=nix.iso of=/dev/rdiskN
+</programlisting>
+Using the 'raw' <command>rdiskN</command> device instead of <command>diskN</command>
+completes in minutes instead of hours. After <command>dd</command> completes, a GUI
+dialog "The disk you inserted was not readable by this computer" will pop up, which
+can be ignored.</para>
+         
 <para>The <command>dd</command> utility will write the image verbatim to the drive,
 making it the recommended option for both UEFI and non-UEFI installations. For
 non-UEFI installations, you can alternatively use
@@ -37,7 +51,7 @@ ISO, copy its contents verbatim to your drive, then either:
   <listitem>
     <para>If you want to load the contents of the ISO to ram after bootin
     (So you can remove the stick after bootup) you can append the parameter
-    <literal>copytoram</literal>to the <literal>options</literal> field.</para>
+    <literal>copytoram</literal> to the <literal>options</literal> field.</para>
   </listitem>
 </itemizedlist>
 </para>
diff --git a/nixos/doc/manual/installation/installing-virtualbox-guest.xml b/nixos/doc/manual/installation/installing-virtualbox-guest.xml
index ee9680ced39..7fcd22a112c 100644
--- a/nixos/doc/manual/installation/installing-virtualbox-guest.xml
+++ b/nixos/doc/manual/installation/installing-virtualbox-guest.xml
@@ -4,18 +4,18 @@
          version="5.0"
          xml:id="sec-instaling-virtualbox-guest">
 
-<title>Installing in a Virtualbox guest</title>
+<title>Installing in a VirtualBox guest</title>
 <para>
-  Installing NixOS into a Virtualbox guest is convenient for users who want to
+  Installing NixOS into a VirtualBox guest is convenient for users who want to
   try NixOS without installing it on bare metal. If you want to use a pre-made
-  Virtualbox appliance, it is available at <link
+  VirtualBox appliance, it is available at <link
   xlink:href="https://nixos.org/nixos/download.html">the downloads page</link>.
-  If you want to set up a Virtualbox guest manually, follow these instructions:
+  If you want to set up a VirtualBox guest manually, follow these instructions:
 </para>
 
 <orderedlist>
 
-  <listitem><para>Add a New Machine in Virtualbox with OS Type "Linux / Other
+  <listitem><para>Add a New Machine in VirtualBox with OS Type "Linux / Other
   Linux"</para></listitem>
 
   <listitem><para>Base Memory Size: 768 MB or higher.</para></listitem>
diff --git a/nixos/doc/manual/installation/installing.xml b/nixos/doc/manual/installation/installing.xml
index b0674307a56..1f09704bce5 100644
--- a/nixos/doc/manual/installation/installing.xml
+++ b/nixos/doc/manual/installation/installing.xml
@@ -6,9 +6,18 @@
 
 <title>Installing NixOS</title>
 
+<para>NixOS can be installed on BIOS or UEFI systems.  The procedure
+for a UEFI installation is by and large the same as a BIOS installation. The differences are mentioned in the steps that follow.</para>
+
 <orderedlist>
 
-  <listitem><para>Boot from the CD.</para></listitem>
+  <listitem><para>Boot from the CD.</para>
+    <variablelist>
+      <varlistentry><term>UEFI systems</term>
+      <listitem><para>You should boot the live CD in UEFI mode
+  (consult your specific hardware's documentation for instructions).
+  You may find the <link xlink:href="http://www.rodsbooks.com/refind">rEFInd boot
+  manager</link> useful.</para></listitem></varlistentry></variablelist></listitem>
 
   <listitem><para>The CD contains a basic NixOS installation.  (It
   also contains Memtest86+, useful if you want to test new hardware).
@@ -36,7 +45,10 @@
   using <command>ifconfig</command>.</para>
   <para>To manually configure the network on the graphical installer,
   first disable network-manager with
-  <command>systemctl stop network-manager</command>.</para></listitem>
+  <command>systemctl stop network-manager</command>.</para>
+  <para>To manually configure the wifi on the minimal installer, run
+  <command>wpa_supplicant -B -i interface -c &lt;(wpa_passphrase 'SSID' 'key')</command>.</para></listitem>
+
 
   <listitem><para>If you would like to continue the installation from a different
   machine you need to activate the SSH daemon via <literal>systemctl start sshd</literal>.
@@ -50,7 +62,31 @@
   <itemizedlist>
 
     <listitem><para>For partitioning:
-    <command>fdisk</command>.</para></listitem>
+    <command>fdisk</command>.
+<screen>
+# fdisk /dev/sda # <lineannotation>(or whatever device you want to install on)</lineannotation>
+-- for UEFI systems only
+> n      # <lineannotation>(create a new partition for /boot)</lineannotation>
+> 3      # <lineannotation>(make it a partition number 3)</lineannotation>
+>        # <lineannotation>(press enter to accept the default)</lineannotation>
+> +512M  # <lineannotation>(the size of the UEFI boot partition)</lineannotation>
+> t      # <lineannotation>(change the partition type ...)</lineannotation>
+> 3      # <lineannotation>(... of the boot partition ...)</lineannotation>
+> 1      # <lineannotation>(... to 'UEFI System')</lineannotation>
+-- for BIOS or UEFI systems
+> n      # <lineannotation>(create a new partition for /swap)</lineannotation>
+> 2      # <lineannotation>(make it a partition number 2)</lineannotation>
+>        # <lineannotation>(press enter to accept the default)</lineannotation>
+> +8G    # <lineannotation>(the size of the swap partition, set to whatever you like)</lineannotation>
+> n      # <lineannotation>(create a new partition for /)</lineannotation>
+> 1      # <lineannotation>(make it a partition number 1)</lineannotation>
+>        # <lineannotation>(press enter to accept the default)</lineannotation>
+>        # <lineannotation>(press enter to accept the default and use the rest of the remaining space)</lineannotation>
+> a      # <lineannotation>(make the partition bootable)</lineannotation>
+> x      # <lineannotation>(enter expert mode)</lineannotation>
+> f      # <lineannotation>(fix up the partition ordering)</lineannotation>
+> r      # <lineannotation>(exit expert mode)</lineannotation>
+> w      # <lineannotation>(write the partition table to disk and exit)</lineannotation></screen></para></listitem>
 
     <listitem><para>For initialising Ext4 partitions:
     <command>mkfs.ext4</command>.  It is recommended that you assign a
@@ -67,18 +103,30 @@
     <listitem><para>For creating swap partitions:
     <command>mkswap</command>.  Again it’s recommended to assign a
     label to the swap partition: <option>-L
-    <replaceable>label</replaceable></option>.</para></listitem>
-
-    <listitem><para>For creating LVM volumes, the LVM commands, e.g.,
+    <replaceable>label</replaceable></option>. For example:
 
 <screen>
-# pvcreate /dev/sda1 /dev/sdb1
-# vgcreate MyVolGroup /dev/sda1 /dev/sdb1
-# lvcreate --size 2G --name bigdisk MyVolGroup
-# lvcreate --size 1G --name smalldisk MyVolGroup</screen>
+# mkswap -L swap /dev/sda2</screen>
 
     </para></listitem>
 
+    <listitem>
+    <variablelist>
+      <varlistentry><term>UEFI systems</term>
+      <listitem><para>For creating boot partitions:
+    <command>mkfs.fat</command>.  Again it’s recommended to assign a
+    label to the boot partition: <option>-n
+    <replaceable>label</replaceable></option>. For example:
+
+<screen>
+# mkfs.fat -F 32 -n boot /dev/sda3</screen>
+
+    </para></listitem></varlistentry></variablelist></listitem>
+
+    <listitem><para>For creating LVM volumes, the LVM commands, e.g.,
+    <command>pvcreate</command>, <command>vgcreate</command>, and
+    <command>lvcreate</command>.</para></listitem>
+
     <listitem><para>For creating software RAID devices, use
     <command>mdadm</command>.</para></listitem>
 
@@ -95,11 +143,28 @@
 
   </para></listitem>
 
+  <listitem>
+    <variablelist>
+      <varlistentry><term>UEFI systems</term>
+      <listitem><para>Mount the boot file system on <filename>/mnt/boot</filename>, e.g.
+
+<screen>
+# mkdir -p /mnt/boot
+# mount /dev/disk/by-label/boot /mnt/boot
+</screen>
+
+  </para></listitem></varlistentry></variablelist></listitem>
+
   <listitem><para>If your machine has a limited amount of memory, you
   may want to activate swap devices now (<command>swapon
   <replaceable>device</replaceable></command>).  The installer (or
   rather, the build actions that it may spawn) may need quite a bit of
-  RAM, depending on your configuration.</para></listitem>
+  RAM, depending on your configuration.
+
+<screen>
+# swapon /dev/sda2</screen>
+
+  </para></listitem>
 
   <listitem>
 
@@ -135,10 +200,25 @@
     install Emacs by running <literal>nix-env -i
     emacs</literal>.</para>
 
-    <para>You <emphasis>must</emphasis> set the option
+    <variablelist>
+
+      <varlistentry><term>BIOS systems</term>
+      <listitem><para>You <emphasis>must</emphasis> set the option
     <option>boot.loader.grub.device</option> to specify on which disk
     the GRUB boot loader is to be installed.  Without it, NixOS cannot
-    boot.</para>
+      boot.</para></listitem></varlistentry>
+
+      <varlistentry><term>UEFI systems</term>
+      <listitem><para>You <emphasis>must</emphasis> set the option
+      <option>boot.loader.systemd-boot.enable</option> to <literal>true</literal>.
+      <command>nixos-generate-config</command> should do this automatically for new
+      configurations when booted in
+      UEFI mode.</para>
+      <para>You may want to look at the options starting with
+      <option>boot.loader.efi</option> and <option>boot.loader.systemd-boot</option>
+      as well.</para></listitem></varlistentry>
+
+    </variablelist>
 
     <para>If there are other operating systems running on the machine before
     installing NixOS, the
@@ -190,11 +270,20 @@ Enter new UNIX password: ***
 Retype new UNIX password: ***
 </screen>
 
+    <note>
+      <para>
+        To prevent the password prompt, set <code>users.mutableUsers = false;</code> in
+        <filename>configuration.nix</filename>, which allows unattended installation
+        necessary in automation.
+      </para>
+    </note>
+
     </para>
 
   </listitem>
 
-  <listitem><para>If everything went well:
+  <listitem>
+    <para>If everything went well:
 
 <screen>
 # reboot</screen>
@@ -247,10 +336,35 @@ drive (here <filename>/dev/sda</filename>).  <xref linkend="ex-config"
 <example xml:id='ex-install-sequence'><title>Commands for Installing NixOS on <filename>/dev/sda</filename></title>
 <screen>
 # fdisk /dev/sda # <lineannotation>(or whatever device you want to install on)</lineannotation>
+-- for UEFI systems only
+> n      # <lineannotation>(create a new partition for /boot)</lineannotation>
+> 3      # <lineannotation>(make it a partition number 3)</lineannotation>
+>        # <lineannotation>(press enter to accept the default)</lineannotation>
+> +512M  # <lineannotation>(the size of the UEFI boot partition)</lineannotation>
+> t      # <lineannotation>(change the partition type ...)</lineannotation>
+> 3      # <lineannotation>(... of the boot partition ...)</lineannotation>
+> 1      # <lineannotation>(... to 'UEFI System')</lineannotation>
+-- for BIOS or UEFI systems
+> n      # <lineannotation>(create a new partition for /swap)</lineannotation>
+> 2      # <lineannotation>(make it a partition number 2)</lineannotation>
+>        # <lineannotation>(press enter to accept the default)</lineannotation>
+> +8G    # <lineannotation>(the size of the swap partition)</lineannotation>
+> n      # <lineannotation>(create a new partition for /)</lineannotation>
+> 1      # <lineannotation>(make it a partition number 1)</lineannotation>
+>        # <lineannotation>(press enter to accept the default)</lineannotation>
+>        # <lineannotation>(press enter to accept the default and use the rest of the remaining space)</lineannotation>
+> a      # <lineannotation>(make the partition bootable)</lineannotation>
+> x      # <lineannotation>(enter expert mode)</lineannotation>
+> f      # <lineannotation>(fix up the partition ordering)</lineannotation>
+> r      # <lineannotation>(exit expert mode)</lineannotation>
+> w      # <lineannotation>(write the partition table to disk and exit)</lineannotation>
 # mkfs.ext4 -L nixos /dev/sda1
 # mkswap -L swap /dev/sda2
 # swapon /dev/sda2
+# mkfs.fat -F 32 -n boot /dev/sda3        # <lineannotation>(for UEFI systems only)</lineannotation>
 # mount /dev/disk/by-label/nixos /mnt
+# mkdir -p /mnt/boot                      # <lineannotation>(for UEFI systems only)</lineannotation>
+# mount /dev/disk/by-label/boot /mnt/boot # <lineannotation>(for UEFI systems only)</lineannotation>
 # nixos-generate-config --root /mnt
 # nano /mnt/etc/nixos/configuration.nix
 # nixos-install
@@ -267,7 +381,8 @@ drive (here <filename>/dev/sda</filename>).  <xref linkend="ex-config"
       ./hardware-configuration.nix
     ];
 
-  boot.loader.grub.device = "/dev/sda";
+  boot.loader.grub.device = "/dev/sda";   # <lineannotation>(for BIOS systems only)</lineannotation>
+  boot.loader.systemd-boot.enable = true; # <lineannotation>(for UEFI systems only)</lineannotation>
 
   # Note: setting fileSystems is generally not
   # necessary, since nixos-generate-config figures them out
@@ -279,9 +394,9 @@ drive (here <filename>/dev/sda</filename>).  <xref linkend="ex-config"
 }</screen>
 </example>
 
-<xi:include href="installing-uefi.xml" />
 <xi:include href="installing-usb.xml" />
 <xi:include href="installing-pxe.xml" />
 <xi:include href="installing-virtualbox-guest.xml" />
+<xi:include href="installing-from-other-distro.xml" />
 
 </chapter>
diff --git a/nixos/doc/manual/installation/obtaining.xml b/nixos/doc/manual/installation/obtaining.xml
index 20a4838be88..9b2b474c60c 100644
--- a/nixos/doc/manual/installation/obtaining.xml
+++ b/nixos/doc/manual/installation/obtaining.xml
@@ -12,11 +12,10 @@ download page</link>.  There are a number of installation options.  If
 you happen to have an optical drive and a spare CD, burning the
 image to CD and booting from that is probably the easiest option.
 Most people will need to prepare a USB stick to boot from.
-Unetbootin is recommended and the process is described in brief below.
-Note that systems which use UEFI require some additional manual steps.
-If you run into difficulty a number of alternative methods are presented
-in the <link
-xlink:href="https://nixos.org/wiki/Installing_NixOS_from_a_USB_stick">NixOS
+<xref linkend="sec-booting-from-usb"/> describes the preferred method
+to prepare a USB stick.
+A number of alternative methods are presented in the <link
+xlink:href="https://nixos.wiki/wiki/NixOS_Installation_Guide#Making_the_installation_media">NixOS
 Wiki</link>.</para>
 
 <para>As an alternative to installing NixOS yourself, you can get a
diff --git a/nixos/doc/manual/man-nixos-build-vms.xml b/nixos/doc/manual/man-nixos-build-vms.xml
index 878ebee0527..f4b59a7c6d4 100644
--- a/nixos/doc/manual/man-nixos-build-vms.xml
+++ b/nixos/doc/manual/man-nixos-build-vms.xml
@@ -40,7 +40,7 @@ points to the generated virtual network.
   test1 = {pkgs, config, ...}:
     {
       services.openssh.enable = true;
-      nixpkgs.system = "i686-linux";
+      nixpkgs.localSystem.system = "i686-linux";
       deployment.targetHost = "test1.example.net";
 
       # Other NixOS options
@@ -51,7 +51,7 @@ points to the generated virtual network.
       services.openssh.enable = true;
       services.httpd.enable = true;
       environment.systemPackages = [ pkgs.lynx ];
-      nixpkgs.system = "x86_64-linux";
+      nixpkgs.localSystem.system = "x86_64-linux";
       deployment.targetHost = "test2.example.net";
 
       # Other NixOS options
@@ -66,7 +66,7 @@ In each NixOS configuration, two attributes have a special meaning.
 The <varname>deployment.targetHost</varname> specifies the address
 (domain name or IP address)
 of the system which is used by <command>ssh</command> to perform
-remote deployment operations. The <varname>nixpkgs.system</varname>
+remote deployment operations. The <varname>nixpkgs.localSystem.system</varname>
 attribute can be used to specify an architecture for the target machine,
 such as <varname>i686-linux</varname> which builds a 32-bit NixOS
 configuration. Omitting this property will build the configuration
diff --git a/nixos/doc/manual/man-nixos-enter.xml b/nixos/doc/manual/man-nixos-enter.xml
new file mode 100644
index 00000000000..a2fbe07961d
--- /dev/null
+++ b/nixos/doc/manual/man-nixos-enter.xml
@@ -0,0 +1,119 @@
+<refentry xmlns="http://docbook.org/ns/docbook"
+          xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:xi="http://www.w3.org/2001/XInclude">
+
+<refmeta>
+  <refentrytitle><command>nixos-enter</command></refentrytitle>
+  <manvolnum>8</manvolnum>
+  <refmiscinfo class="source">NixOS</refmiscinfo>
+  <!-- <refmiscinfo class="version"><xi:include href="version.txt" parse="text"/></refmiscinfo> -->
+</refmeta>
+
+<refnamediv>
+  <refname><command>nixos-enter</command></refname>
+  <refpurpose>run a command in a NixOS chroot environment</refpurpose>
+</refnamediv>
+
+<refsynopsisdiv>
+  <cmdsynopsis>
+    <command>nixos-enter</command>
+    <arg>
+      <arg choice='plain'><option>--root</option></arg>
+      <replaceable>root</replaceable>
+    </arg>
+    <arg>
+      <arg choice='plain'><option>--system</option></arg>
+      <replaceable>system</replaceable>
+    </arg>
+    <arg>
+      <arg choice='plain'><option>-c</option></arg>
+      <replaceable>shell-command</replaceable>
+    </arg>
+    <arg>
+      <arg choice='plain'><option>--help</option></arg>
+    </arg>
+    <arg>
+      <arg choice='plain'><option>--</option></arg>
+      <replaceable>arguments</replaceable>
+    </arg>
+  </cmdsynopsis>
+</refsynopsisdiv>
+
+
+<refsection><title>Description</title>
+
+<para>This command runs a command in a NixOS chroot environment, that
+is, in a filesystem hierarchy previously prepared using
+<command>nixos-install</command>.</para>
+
+</refsection>
+
+<refsection><title>Options</title>
+
+<para>This command accepts the following options:</para>
+
+<variablelist>
+
+  <varlistentry>
+    <term><option>--root</option></term>
+    <listitem>
+      <para>The path to the NixOS system you want to enter. It defaults to <filename>/mnt</filename>.</para>
+    </listitem>
+  </varlistentry>
+
+  <varlistentry>
+    <term><option>--system</option></term>
+    <listitem>
+      <para>The NixOS system configuration to use. It defaults to
+      <filename>/nix/var/nix/profiles/system</filename>. You can enter
+      a previous NixOS configuration by specifying a path such as
+      <filename>/nix/var/nix/profiles/system-106-link</filename>.</para>
+    </listitem>
+  </varlistentry>
+
+  <varlistentry>
+    <term><option>--command</option></term>
+    <term><option>-c</option></term>
+    <listitem>
+      <para>The bash command to execute.</para>
+    </listitem>
+  </varlistentry>
+
+  <varlistentry>
+    <term><option>--</option></term>
+
+    <listitem><para>Interpret the remaining arguments as the program
+    name and arguments to be invoked. The program is not executed in a
+    shell.</para></listitem>
+
+  </varlistentry>
+
+</variablelist>
+
+</refsection>
+
+
+<refsection><title>Examples</title>
+
+<para>Start an interactive shell in the NixOS installation in
+<filename>/mnt</filename>:</para>
+
+<screen>
+# nixos-enter /mnt
+</screen>
+
+<para>Run a shell command:</para>
+
+<screen>
+# nixos-enter -c 'ls -l /; cat /proc/mounts'
+</screen>
+
+<para>Run a non-shell command:</para>
+
+<screen>
+# nixos-enter -- cat /proc/mounts
+</screen>
+
+</refsection>
+
+</refentry>
diff --git a/nixos/doc/manual/man-nixos-install.xml b/nixos/doc/manual/man-nixos-install.xml
index 15c603256ca..c9887146989 100644
--- a/nixos/doc/manual/man-nixos-install.xml
+++ b/nixos/doc/manual/man-nixos-install.xml
@@ -26,8 +26,8 @@
       <replaceable>root</replaceable>
     </arg>
     <arg>
-      <arg choice='plain'><option>--closure</option></arg>
-      <replaceable>closure</replaceable>
+      <arg choice='plain'><option>--system</option></arg>
+      <replaceable>path</replaceable>
     </arg>
     <arg>
       <arg choice='plain'><option>--no-channel-copy</option></arg>
@@ -118,7 +118,7 @@ it.</para>
   </varlistentry>
 
   <varlistentry>
-    <term><option>--closure</option></term>
+    <term><option>--system</option></term>
     <listitem>
       <para>If this option is provided, <command>nixos-install</command> will install the specified closure
       rather than attempt to build one from <filename>/mnt/etc/nixos/configuration.nix</filename>.</para>
diff --git a/nixos/doc/manual/man-pages.xml b/nixos/doc/manual/man-pages.xml
index e945e0e6263..80a8458fbfe 100644
--- a/nixos/doc/manual/man-pages.xml
+++ b/nixos/doc/manual/man-pages.xml
@@ -15,7 +15,7 @@
     </author>
 
     <copyright>
-      <year>2007-2015</year>
+      <year>2007-2018</year>
       <holder>Eelco Dolstra</holder>
     </copyright>
 
@@ -25,6 +25,7 @@
   <xi:include href="man-nixos-build-vms.xml" />
   <xi:include href="man-nixos-generate-config.xml" />
   <xi:include href="man-nixos-install.xml" />
+  <xi:include href="man-nixos-enter.xml" />
   <xi:include href="man-nixos-option.xml" />
   <xi:include href="man-nixos-rebuild.xml" />
   <xi:include href="man-nixos-version.xml" />
diff --git a/nixos/doc/manual/options-to-docbook.xsl b/nixos/doc/manual/options-to-docbook.xsl
index 5387546b598..7b45b233ab2 100644
--- a/nixos/doc/manual/options-to-docbook.xsl
+++ b/nixos/doc/manual/options-to-docbook.xsl
@@ -70,6 +70,15 @@
                 </para>
               </xsl:if>
 
+              <xsl:if test="attr[@name = 'relatedPackages']">
+                <para>
+                  <emphasis>Related packages:</emphasis>
+                  <xsl:text> </xsl:text>
+                  <xsl:value-of disable-output-escaping="yes"
+                                select="attr[@name = 'relatedPackages']/string/@value" />
+                </para>
+              </xsl:if>
+
               <xsl:if test="count(attr[@name = 'declarations']/list/*) != 0">
                 <para>
                   <emphasis>Declared by:</emphasis>
diff --git a/nixos/doc/manual/release-notes/release-notes.xml b/nixos/doc/manual/release-notes/release-notes.xml
index 5ed56bde665..b7f9fab44f3 100644
--- a/nixos/doc/manual/release-notes/release-notes.xml
+++ b/nixos/doc/manual/release-notes/release-notes.xml
@@ -9,6 +9,7 @@
 <para>This section lists the release notes for each stable version of NixOS
 and current unstable revision.</para>
 
+<xi:include href="rl-1809.xml" />
 <xi:include href="rl-1803.xml" />
 <xi:include href="rl-1709.xml" />
 <xi:include href="rl-1703.xml" />
diff --git a/nixos/doc/manual/release-notes/rl-1404.xml b/nixos/doc/manual/release-notes/rl-1404.xml
index 36f67ed88b0..137caf14cba 100644
--- a/nixos/doc/manual/release-notes/rl-1404.xml
+++ b/nixos/doc/manual/release-notes/rl-1404.xml
@@ -13,7 +13,7 @@ the following highlights:
 <itemizedlist>
 
   <listitem><para>Installation on UEFI systems is now supported.  See
-  <xref linkend="sec-uefi-installation"/> for
+  <xref linkend="sec-installation"/> for
   details.</para></listitem>
 
   <listitem><para>Systemd has been updated to version 212, which has
diff --git a/nixos/doc/manual/release-notes/rl-1803.xml b/nixos/doc/manual/release-notes/rl-1803.xml
index c1fe692ceec..9221c2951ed 100644
--- a/nixos/doc/manual/release-notes/rl-1803.xml
+++ b/nixos/doc/manual/release-notes/rl-1803.xml
@@ -4,7 +4,7 @@
          version="5.0"
          xml:id="sec-release-18.03">
 
-<title>Release 18.03 (“Impala”, 2018/03/??)</title>
+<title>Release 18.03 (“Impala”, 2018/04/04)</title>
 
 <section xmlns="http://docbook.org/ns/docbook"
          xmlns:xlink="http://www.w3.org/1999/xlink"
@@ -18,10 +18,63 @@
 has the following highlights: </para>
 
 <itemizedlist>
+
+  <listitem>
+    <para>
+      End of support is planned for end of October 2018, handing over to 18.09.
+    </para>
+  </listitem>
+
+  <listitem>
+    <para>
+      Platform support: x86_64-linux and x86_64-darwin since release time (the latter isn't NixOS, really).
+      Binaries for aarch64-linux are available, but no channel exists yet, as it's waiting for some test fixes, etc.
+    </para>
+  </listitem>
+
+  <listitem>
+    <para>
+      Nix now defaults to 2.0; see its
+      <link xlink:href="https://nixos.org/nix/manual/#ssec-relnotes-2.0">release notes</link>.
+    </para>
+  </listitem>
+
   <listitem>
     <para>
+      Core version changes: linux: 4.9 -> 4.14, glibc: 2.25 -> 2.26, gcc: 6 -> 7, systemd: 234 -> 237.
     </para>
   </listitem>
+
+  <listitem>
+    <para>
+      Desktop version changes: gnome: 3.24 -> 3.26, (KDE) plasma-desktop: 5.10 -> 5.12.
+    </para>
+  </listitem>
+
+  <listitem>
+    <para>
+      MariaDB 10.2, updated from 10.1, is now the default MySQL implementation. While upgrading a few changes
+      have been made to the infrastructure involved:
+      <itemizedlist>
+        <listitem>
+          <para>
+            <literal>libmysql</literal> has been deprecated, please use <literal>mysql.connector-c</literal>
+            instead, a compatibility passthru has been added to the MySQL packages.
+          </para>
+        </listitem>
+        <listitem>
+          <para>
+            The <literal>mysql57</literal> package has a new <literal>static</literal> output containing
+            the static libraries including <literal>libmysqld.a</literal>
+          </para>
+        </listitem>
+      </itemizedlist>
+    </para>
+  </listitem>
+
+  <listitem>
+    <para>PHP now defaults to PHP 7.2, updated from 7.1.</para>
+  </listitem>
 </itemizedlist>
 
 </section>
@@ -36,9 +89,66 @@ has the following highlights: </para>
 <para>The following new services were added since the last release:</para>
 
 <itemizedlist>
-  <listitem>
-    <para></para>
-  </listitem>
+  <listitem><para><literal>./config/krb5/default.nix</literal></para></listitem>
+  <listitem><para><literal>./hardware/digitalbitbox.nix</literal></para></listitem>
+  <listitem><para><literal>./misc/label.nix</literal></para></listitem>
+  <listitem><para><literal>./programs/ccache.nix</literal></para></listitem>
+  <listitem><para><literal>./programs/criu.nix</literal></para></listitem>
+  <listitem><para><literal>./programs/digitalbitbox/default.nix</literal></para></listitem>
+  <listitem><para><literal>./programs/less.nix</literal></para></listitem>
+  <listitem><para><literal>./programs/npm.nix</literal></para></listitem>
+  <listitem><para><literal>./programs/plotinus.nix</literal></para></listitem>
+  <listitem><para><literal>./programs/rootston.nix</literal></para></listitem>
+  <listitem><para><literal>./programs/systemtap.nix</literal></para></listitem>
+  <listitem><para><literal>./programs/sway.nix</literal></para></listitem>
+  <listitem><para><literal>./programs/udevil.nix</literal></para></listitem>
+  <listitem><para><literal>./programs/way-cooler.nix</literal></para></listitem>
+  <listitem><para><literal>./programs/yabar.nix</literal></para></listitem>
+  <listitem><para><literal>./programs/zsh/zsh-autoenv.nix</literal></para></listitem>
+  <listitem><para><literal>./services/backup/borgbackup.nix</literal></para></listitem>
+  <listitem><para><literal>./services/backup/crashplan-small-business.nix</literal></para></listitem>
+  <listitem><para><literal>./services/desktops/dleyna-renderer.nix</literal></para></listitem>
+  <listitem><para><literal>./services/desktops/dleyna-server.nix</literal></para></listitem>
+  <listitem><para><literal>./services/desktops/pipewire.nix</literal></para></listitem>
+  <listitem><para><literal>./services/desktops/gnome3/chrome-gnome-shell.nix</literal></para></listitem>
+  <listitem><para><literal>./services/desktops/gnome3/tracker-miners.nix</literal></para></listitem>
+  <listitem><para><literal>./services/hardware/fwupd.nix</literal></para></listitem>
+  <listitem><para><literal>./services/hardware/interception-tools.nix</literal></para></listitem>
+  <listitem><para><literal>./services/hardware/u2f.nix</literal></para></listitem>
+  <listitem><para><literal>./services/hardware/usbmuxd.nix</literal></para></listitem>
+  <listitem><para><literal>./services/mail/clamsmtp.nix</literal></para></listitem>
+  <listitem><para><literal>./services/mail/dkimproxy-out.nix</literal></para></listitem>
+  <listitem><para><literal>./services/mail/pfix-srsd.nix</literal></para></listitem>
+  <listitem><para><literal>./services/misc/gitea.nix</literal></para></listitem>
+  <listitem><para><literal>./services/misc/home-assistant.nix</literal></para></listitem>
+  <listitem><para><literal>./services/misc/ihaskell.nix</literal></para></listitem>
+  <listitem><para><literal>./services/misc/logkeys.nix</literal></para></listitem>
+  <listitem><para><literal>./services/misc/novacomd.nix</literal></para></listitem>
+  <listitem><para><literal>./services/misc/osrm.nix</literal></para></listitem>
+  <listitem><para><literal>./services/misc/plexpy.nix</literal></para></listitem>
+  <listitem><para><literal>./services/misc/pykms.nix</literal></para></listitem>
+  <listitem><para><literal>./services/misc/tzupdate.nix</literal></para></listitem>
+  <listitem><para><literal>./services/monitoring/fusion-inventory.nix</literal></para></listitem>
+  <listitem><para><literal>./services/monitoring/prometheus/exporters.nix</literal></para></listitem>
+  <listitem><para><literal>./services/network-filesystems/beegfs.nix</literal></para></listitem>
+  <listitem><para><literal>./services/network-filesystems/davfs2.nix</literal></para></listitem>
+  <listitem><para><literal>./services/network-filesystems/openafs/client.nix</literal></para></listitem>
+  <listitem><para><literal>./services/network-filesystems/openafs/server.nix</literal></para></listitem>
+  <listitem><para><literal>./services/network-filesystems/ceph.nix</literal></para></listitem>
+  <listitem><para><literal>./services/networking/aria2.nix</literal></para></listitem>
+  <listitem><para><literal>./services/networking/monero.nix</literal></para></listitem>
+  <listitem><para><literal>./services/networking/nghttpx/default.nix</literal></para></listitem>
+  <listitem><para><literal>./services/networking/nixops-dns.nix</literal></para></listitem>
+  <listitem><para><literal>./services/networking/rxe.nix</literal></para></listitem>
+  <listitem><para><literal>./services/networking/stunnel.nix</literal></para></listitem>
+  <listitem><para><literal>./services/web-apps/matomo.nix</literal></para></listitem>
+  <listitem><para><literal>./services/web-apps/restya-board.nix</literal></para></listitem>
+  <listitem><para><literal>./services/web-servers/mighttpd2.nix</literal></para></listitem>
+  <listitem><para><literal>./services/x11/fractalart.nix</literal></para></listitem>
+  <listitem><para><literal>./system/boot/binfmt.nix</literal></para></listitem>
+  <listitem><para><literal>./system/boot/grow-partition.nix</literal></para></listitem>
+  <listitem><para><literal>./tasks/filesystems/ecryptfs.nix</literal></para></listitem>
+  <listitem><para><literal>./virtualisation/hyperv-guest.nix</literal></para></listitem>
 </itemizedlist>
 
 </section>
@@ -56,6 +166,11 @@ following incompatible changes:</para>
 <itemizedlist>
   <listitem>
     <para>
+      <literal>sound.enable</literal> now defaults to false.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
       Dollar signs in options under <option>services.postfix</option> are
       passed verbatim to Postfix, which will interpret them as the beginning of
       a parameter expression. This was already true for string-valued options
@@ -72,6 +187,243 @@ following incompatible changes:</para>
       <option>services.pgmanage</option>.
     </para>
   </listitem>
+  <listitem>
+    <para>
+      Package attributes starting with a digit have been prefixed with an
+      underscore sign. This is to avoid quoting in the configuration and
+      other issues with command-line tools like <literal>nix-env</literal>.
+      The change affects the following packages:
+      <itemizedlist>
+        <listitem>
+          <para><literal>2048-in-terminal</literal> → <literal>_2048-in-terminal</literal></para>
+        </listitem>
+        <listitem>
+          <para><literal>90secondportraits</literal> → <literal>_90secondportraits</literal></para>
+        </listitem>
+        <listitem>
+          <para><literal>2bwm</literal> → <literal>_2bwm</literal></para>
+        </listitem>
+        <listitem>
+          <para><literal>389-ds-base</literal> → <literal>_389-ds-base</literal></para>
+        </listitem>
+      </itemizedlist>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+      <emphasis role="strong">
+        The OpenSSH service no longer enables support for DSA keys by default,
+        which could cause a system lock out. Update your keys or, unfavorably,
+        re-enable DSA support manually.
+      </emphasis>
+    </para>
+
+    <para>
+      DSA support was
+      <link xlink:href="https://www.openssh.com/legacy.html">deprecated in OpenSSH 7.0</link>,
+      due to it being too weak. To re-enable support, add
+      <literal>PubkeyAcceptedKeyTypes +ssh-dss</literal> to the end of your
+      <option>services.openssh.extraConfig</option>.
+    </para>
+
+    <para>
+      After updating the keys to be stronger, anyone still on a pre-17.03
+      version is safe to jump to 17.03, as vetted
+      <link xlink:href="https://search.nix.gsc.io/?q=stateVersion">here</link>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+      The <literal>openssh</literal> package
+      now includes Kerberos support by default;
+      the <literal>openssh_with_kerberos</literal> package
+      is now a deprecated alias.
+      If you do not want Kerberos support,
+      you can do <literal>openssh.override { withKerberos = false; }</literal>.
+      Note, this also applies to the <literal>openssh_hpn</literal> package.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+      <literal>cc-wrapper</literal> has been split in two; there is now also a <literal>bintools-wrapper</literal>.
+      The most commonly used files in <filename>nix-support</filename> are now split between the two wrappers.
+      Some commonly used ones, like <filename>nix-support/dynamic-linker</filename>, are duplicated for backwards compatability, even though they rightly belong only in <literal>bintools-wrapper</literal>.
+      Other more obscure ones are just moved.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+      The propagation logic has been changed.
+      The new logic, along with new types of dependencies that go with, is thoroughly documented in the "Specifying dependencies" section of the "Standard Environment" chapter of the nixpkgs manual.
+      <!-- That's <xref linkend="ssec-stdenv-attributes"> were we to merge the manuals. -->
+      The old logic isn't but is easy to describe: dependencies were propagated as the same type of dependency no matter what.
+      In practice, that means that many <function>propagatedNativeBuildInputs</function> should instead be  <function>propagatedBuildInputs</function>.
+      Thankfully, that was and is the least used type of dependency.
+      Also, it means that some <function>propagatedBuildInputs</function> should instead be <function>depsTargetTargetPropagated</function>.
+      Other types dependencies should be unaffected.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+      <literal>lib.addPassthru drv passthru</literal> is removed.  Use <literal>lib.extendDerivation true passthru drv</literal> instead.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+      The <literal>memcached</literal> service no longer accept dynamic socket
+      paths via <option>services.memcached.socket</option>. Unix sockets can be
+      still enabled by <option>services.memcached.enableUnixSocket</option> and
+      will be accessible at <literal>/run/memcached/memcached.sock</literal>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+      The <varname>hardware.amdHybridGraphics.disable</varname> option was removed for lack of a maintainer. If you still need this module, you may wish to include a copy of it from an older version of nixos in your imports.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+      The merging of config options for <varname>services.postfix.config</varname>
+      was buggy. Previously, if other options in the Postfix module like
+      <varname>services.postfix.useSrs</varname> were set and the user set config
+      options that were also set by such options, the resulting config wouldn't
+      include all options that were needed. They are now merged correctly. If
+      config options need to be overridden, <literal>lib.mkForce</literal> or
+      <literal>lib.mkOverride</literal> can be used.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+      The following changes apply if the <literal>stateVersion</literal> is changed to 18.03 or higher.
+      For <literal>stateVersion = "17.09"</literal> or lower the old behavior is preserved.
+    </para>
+    <itemizedlist>
+      <listitem>
+        <para>
+          <literal>matrix-synapse</literal> uses postgresql by default instead of sqlite.
+          Migration instructions can be found <link xlink:href="https://github.com/matrix-org/synapse/blob/master/docs/postgres.rst#porting-from-sqlite"> here </link>.
+        </para>
+      </listitem>
+    </itemizedlist>
+  </listitem>
+  <listitem>
+    <para>
+      The <literal>jid</literal> package has been removed, due to maintenance
+      overhead of a go package having non-versioned dependencies.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+      When using <option>services.xserver.libinput</option> (enabled by default in GNOME),
+      it now handles all input devices, not just touchpads. As a result, you might need to
+      re-evaluate any custom Xorg configuration. In particular,
+      <literal>Option "XkbRules" "base"</literal> may result in broken keyboard layout.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+      The <literal>attic</literal> package was removed. A maintained fork called
+      <link xlink:href="https://www.borgbackup.org/">Borg</link> should be used instead.
+      Migration instructions can be found
+      <link xlink:href="http://borgbackup.readthedocs.io/en/stable/usage/upgrade.html#attic-and-borg-0-xx-to-borg-1-x">here</link>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+      The Piwik analytics software was renamed to Matomo:
+      <itemizedlist>
+        <listitem>
+          <para>The package <literal>pkgs.piwik</literal> was renamed to <literal>pkgs.matomo</literal>.</para>
+        </listitem>
+        <listitem>
+          <para>The service <literal>services.piwik</literal> was renamed to <literal>services.matomo</literal>.</para>
+        </listitem>
+        <listitem>
+          <para>
+            The data directory <filename>/var/lib/piwik</filename> was renamed to <filename>/var/lib/matomo</filename>.
+            All files will be moved automatically on first startup, but you might need to adjust your backup scripts.
+          </para>
+        </listitem>
+        <listitem>
+          <para>
+            The default <option>serverName</option> for the nginx configuration changed from
+            <literal>piwik.${config.networking.hostName}</literal> to
+            <literal>matomo.${config.networking.hostName}.${config.networking.domain}</literal>
+            if <option>config.networking.domain</option> is set,
+            <literal>matomo.${config.networking.hostName}</literal> if it is not set.
+            If you change your <option>serverName</option>, remember you'll need to update the
+            <literal>trustedHosts[]</literal> array in <filename>/var/lib/matomo/config/config.ini.php</filename>
+            as well.
+          </para>
+        </listitem>
+        <listitem>
+          <para>
+            The <literal>piwik</literal> user was renamed to <literal>matomo</literal>.
+            The service will adjust ownership automatically for files in the data directory.
+            If you use unix socket authentication, remember to give the new <literal>matomo</literal> user
+            access to the database and to change the <literal>username</literal> to <literal>matomo</literal>
+            in the <literal>[database]</literal> section of <filename>/var/lib/matomo/config/config.ini.php</filename>.
+          </para>
+        </listitem>
+        <listitem>
+          <para>
+            If you named your database `piwik`, you might want to rename it to `matomo` to keep things clean,
+            but this is neither enforced nor required.
+          </para>
+        </listitem>
+      </itemizedlist>
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+      <literal>nodejs-4_x</literal> is end-of-life.
+      <literal>nodejs-4_x</literal>, <literal>nodejs-slim-4_x</literal> and <literal>nodePackages_4_x</literal> are removed.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+      The <literal>pump.io</literal> NixOS module was removed.
+      It is now maintained as an
+      <link xlink:href="https://github.com/rvl/pump.io-nixos">external module</link>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+      The Prosody XMPP server has received a major update. The following modules were renamed:
+      <itemizedlist>
+        <listitem>
+          <para>
+            <option>services.prosody.modules.httpserver</option> is now <option>services.prosody.modules.http_files</option>
+          </para>
+        </listitem>
+        <listitem>
+          <para>
+            <option>services.prosody.modules.console</option> is now <option>services.prosody.modules.admin_telnet</option>
+          </para>
+        </listitem>
+      </itemizedlist>
+    </para>
+
+    <para>
+      Many new modules are now core modules, most notably <option>services.prosody.modules.carbons</option>
+      and <option>services.prosody.modules.mam</option>.
+    </para>
+
+    <para>
+      The better-performing <literal>libevent</literal> backend is now enabled by default.
+    </para>
+
+    <para>
+      <literal>withCommunityModules</literal> now passes through the modules to <option>services.prosody.extraModules</option>.
+      Use <literal>withOnlyInstalledCommunityModules</literal> for modules that should not be enabled directly, e.g <literal>lib_ldap</literal>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+      All prometheus exporter modules are now defined as submodules.
+      The exporters are configured using <literal>services.prometheus.exporters</literal>.
+    </para>
+  </listitem>
 </itemizedlist>
 
 </section>
@@ -102,10 +454,106 @@ following incompatible changes:</para>
   </listitem>
   <listitem>
     <para>
-      The option <option>services.xserver.desktopManager.default</option> is now <literal>none</literal> by default.
-      An assertion failure is thrown if WM's and DM's default are <literal>none</literal>.
-      To explicitly run a plain X session without and DM or WM, the newly introduced option <option>services.xserver.plainX</option>
-      must be set to true.
+      In the module <option>networking.interfaces.&lt;name&gt;</option> the
+      following options have been removed:
+      <itemizedlist>
+        <listitem>
+          <para><option>ipAddress</option></para>
+        </listitem>
+        <listitem>
+          <para><option>ipv6Address</option></para>
+        </listitem>
+        <listitem>
+          <para><option>prefixLength</option></para>
+        </listitem>
+        <listitem>
+          <para><option>ipv6PrefixLength</option></para>
+        </listitem>
+        <listitem>
+          <para><option>subnetMask</option></para>
+        </listitem>
+      </itemizedlist>
+      To assign static addresses to an interface the options
+      <option>ipv4.addresses</option> and <option>ipv6.addresses</option>
+      should be used instead.
+      The options <option>ip4</option> and <option>ip6</option> have been
+      renamed to <option>ipv4.addresses</option> <option>ipv6.addresses</option>
+      respectively.
+      The new options <option>ipv4.routes</option> and <option>ipv6.routes</option>
+      have been added to set up static routing.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+      The option <option>services.logstash.listenAddress</option> is now <literal>127.0.0.1</literal> by default.
+      Previously the default behaviour was to listen on all interfaces.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+      <literal>services.btrfs.autoScrub</literal> has been added, to
+      periodically check btrfs filesystems for data corruption.
+      If there's a correct copy available, it will automatically repair
+      corrupted blocks.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+      <literal>displayManager.lightdm.greeters.gtk.clock-format.</literal>
+      has been added, the clock format string (as expected by
+      strftime, e.g. <literal>%H:%M</literal>) to use with the lightdm
+      gtk greeter panel.
+    </para>
+    <para>
+      If set to null the default clock format is used.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+      <literal>displayManager.lightdm.greeters.gtk.indicators</literal>
+      has been added, a list of allowed indicator modules to use with
+      the lightdm gtk greeter panel.
+    </para>
+    <para>
+      Built-in indicators include <literal>~a11y</literal>,
+      <literal>~language</literal>, <literal>~session</literal>,
+      <literal>~power</literal>, <literal>~clock</literal>,
+      <literal>~host</literal>, <literal>~spacer</literal>. Unity
+      indicators can be represented by short name
+      (e.g. <literal>sound</literal>, <literal>power</literal>),
+      service file name, or absolute path.
+    </para>
+    <para>
+      If set to <literal>null</literal> the default indicators are
+      used.
+    </para>
+    <para>
+      In order to have the previous default configuration add
+<programlisting>
+  services.xserver.displayManager.lightdm.greeters.gtk.indicators = [
+    "~host" "~spacer"
+    "~clock" "~spacer"
+    "~session"
+    "~language"
+    "~a11y"
+    "~power"
+  ];
+</programlisting>
+      to your <literal>configuration.nix</literal>.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+      The NixOS test driver supports user services declared by <literal>systemd.user.services</literal>.
+      The methods <literal>waitForUnit</literal>, <literal>getUnitInfo</literal>, <literal>startJob</literal>
+      and <literal>stopJob</literal> provide an optional <literal>$user</literal> argument for that purpose.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+      Enabling bash completion on NixOS, <literal>programs.bash.enableCompletion</literal>, will now also enable
+      completion for the Nix command line tools by installing the
+      <link xlink:href="https://github.com/hedning/nix-bash-completions">nix-bash-completions</link> package.
     </para>
   </listitem>
 </itemizedlist>
diff --git a/nixos/doc/manual/release-notes/rl-1809.xml b/nixos/doc/manual/release-notes/rl-1809.xml
new file mode 100644
index 00000000000..61f9ec8ba99
--- /dev/null
+++ b/nixos/doc/manual/release-notes/rl-1809.xml
@@ -0,0 +1,85 @@
+<section xmlns="http://docbook.org/ns/docbook"
+         xmlns:xlink="http://www.w3.org/1999/xlink"
+         xmlns:xi="http://www.w3.org/2001/XInclude"
+         version="5.0"
+         xml:id="sec-release-18.09">
+
+<title>Release 18.09 (“Jellyfish”, 2018/09/??)</title>
+
+<section xmlns="http://docbook.org/ns/docbook"
+         xmlns:xlink="http://www.w3.org/1999/xlink"
+         xmlns:xi="http://www.w3.org/2001/XInclude"
+         version="5.0"
+         xml:id="sec-release-18.09-highlights">
+
+<title>Highlights</title>
+
+<para>In addition to numerous new and upgraded packages, this release
+has the following highlights: </para>
+
+<itemizedlist>
+  <listitem>
+    <para>
+      TODO
+    </para>
+  </listitem>
+
+</itemizedlist>
+
+</section>
+<section xmlns="http://docbook.org/ns/docbook"
+         xmlns:xlink="http://www.w3.org/1999/xlink"
+         xmlns:xi="http://www.w3.org/2001/XInclude"
+         version="5.0"
+         xml:id="sec-release-18.09-new-services">
+
+<title>New Services</title>
+
+<para>The following new services were added since the last release:</para>
+
+<itemizedlist>
+  <listitem>
+    <para></para>
+  </listitem>
+</itemizedlist>
+
+</section>
+<section xmlns="http://docbook.org/ns/docbook"
+         xmlns:xlink="http://www.w3.org/1999/xlink"
+         xmlns:xi="http://www.w3.org/2001/XInclude"
+         version="5.0"
+         xml:id="sec-release-18.09-incompatibilities">
+
+<title>Backward Incompatibilities</title>
+
+<para>When upgrading from a previous release, please be aware of the
+following incompatible changes:</para>
+
+<itemizedlist>
+  <listitem>
+    <para>
+      The <literal>clementine</literal> package points now to the free derivation.
+      <literal>clementineFree</literal> is removed now and <literal>clementineUnfree</literal>
+      points to the package which is bundled with the unfree <literal>libspotify</literal> package.
+    </para>
+  </listitem>
+</itemizedlist>
+
+</section>
+<section xmlns="http://docbook.org/ns/docbook"
+         xmlns:xlink="http://www.w3.org/1999/xlink"
+         xmlns:xi="http://www.w3.org/2001/XInclude"
+         version="5.0"
+         xml:id="sec-release-18.09-notable-changes">
+
+<title>Other Notable Changes</title>
+
+<itemizedlist>
+  <listitem>
+    <para>
+    </para>
+  </listitem>
+</itemizedlist>
+
+</section>
+</section>
diff --git a/nixos/doc/manual/style.css b/nixos/doc/manual/style.css
deleted file mode 100644
index 3118b37ead1..00000000000
--- a/nixos/doc/manual/style.css
+++ /dev/null
@@ -1,267 +0,0 @@
-/* Copied from http://bakefile.sourceforge.net/, which appears
-   licensed under the GNU GPL. */
-
-
-/***************************************************************************
-                             Basic headers and text:
- ***************************************************************************/
-
-body
-{
-    font-family: "Nimbus Sans L", sans-serif;
-    background: white;
-    margin: 2em 1em 2em 1em;
-}
-
-h1, h2, h3, h4
-{
-    color: #005aa0;
-}
-
-h1 /* title */
-{
-    font-size: 200%;
-}
-
-h2 /* chapters, appendices, subtitle */
-{
-    font-size: 180%;
-}
-
-/* Extra space between chapters, appendices. */
-div.chapter > div.titlepage h2, div.appendix > div.titlepage h2 
-{ 
-    margin-top: 1.5em;
-}
-
-div.section > div.titlepage h2 /* sections */
-{
-    font-size: 150%;
-    margin-top: 1.5em;
-}
-
-h3 /* subsections */
-{
-    font-size: 125%;
-}
-
-div.simplesect h2
-{
-    font-size: 110%;
-}
-
-div.appendix h3
-{
-    font-size: 150%;
-    margin-top: 1.5em;
-}
-
-div.refnamediv h2, div.refsynopsisdiv h2, div.refsection h2 /* refentry parts */
-{
-    margin-top: 1.4em;
-    font-size: 125%;
-}
-
-div.refsection h3
-{
-    font-size: 110%;
-}
-
-
-/***************************************************************************
-                               Examples:
- ***************************************************************************/
-
-div.example
-{
-    border: 1px solid #b0b0b0;
-    padding: 6px 6px;
-    margin-left: 1.5em;
-    margin-right: 1.5em;
-    background: #f4f4f8;
-    border-radius: 0.4em;
-    box-shadow: 0.4em 0.4em 0.5em #e0e0e0;
-}
-
-div.example p.title
-{
-    margin-top: 0em;
-}
-
-div.example pre
-{
-    box-shadow: none;
-}
-
-
-/***************************************************************************
-                            Screen dumps:
- ***************************************************************************/
-
-pre.screen, pre.programlisting
-{
-    border: 1px solid #b0b0b0;
-    padding: 3px 3px;
-    margin-left: 1.5em;
-    margin-right: 1.5em;
-    color: #600000;
-    background: #f4f4f8;
-    font-family: monospace;
-    border-radius: 0.4em;
-    box-shadow: 0.4em 0.4em 0.5em #e0e0e0;
-}
-
-div.example pre.programlisting
-{
-    border: 0px;
-    padding: 0 0;
-    margin: 0 0 0 0;
-}
-
-
-/***************************************************************************
-                               Notes, warnings etc:
- ***************************************************************************/
-
-.note, .warning
-{
-    border: 1px solid #b0b0b0;
-    padding: 3px 3px;
-    margin-left: 1.5em;
-    margin-right: 1.5em;
-    margin-bottom: 1em;
-    padding: 0.3em 0.3em 0.3em 0.3em;
-    background: #fffff5;
-    border-radius: 0.4em;
-    box-shadow: 0.4em 0.4em 0.5em #e0e0e0;
-}
-
-div.note, div.warning
-{
-    font-style: italic;
-}
-
-div.note h3, div.warning h3
-{
-    color: red;
-    font-size: 100%;
-    padding-right: 0.5em;
-    display: inline;
-}
-
-div.note p, div.warning p
-{
-    margin-bottom: 0em;
-}
-
-div.note h3 + p, div.warning h3 + p
-{
-    display: inline;
-}
-
-div.note h3
-{
-    color: blue;
-    font-size: 100%;
-}
-
-div.navfooter *
-{
-    font-size: 90%;
-}
-
-
-/***************************************************************************
-                        Links colors and highlighting: 
- ***************************************************************************/
-
-a { text-decoration: none; }
-a:hover { text-decoration: underline; }
-a:link { color: #0048b3; }
-a:visited { color: #002a6a; }
-
-
-/***************************************************************************
-                              Table of contents:
- ***************************************************************************/
-
-div.toc
-{
-    font-size: 90%;
-}
-
-div.toc dl
-{
-    margin-top: 0em;
-    margin-bottom: 0em;
-}
-
-
-/***************************************************************************
-                               Special elements:
- ***************************************************************************/
-
-tt, code
-{
-    color: #400000;
-}
-
-.term
-{
-    font-weight: bold;
-    
-}
-
-div.variablelist dd p, div.glosslist dd p
-{
-    margin-top: 0em;
-}
-
-div.variablelist dd, div.glosslist dd
-{
-    margin-left: 1.5em;
-}
-
-div.glosslist dt
-{
-    font-style: italic;
-}
-
-.varname
-{
-    color: #400000;
-}
-
-span.command strong
-{
-    font-weight: normal;
-    color: #400000;
-}
-
-div.calloutlist table
-{
-    box-shadow: none;
-}
-
-table
-{
-    border-collapse: collapse;
-    box-shadow: 0.4em 0.4em 0.5em #e0e0e0;
-}
-
-table.simplelist
-{
-    text-align: left;
-    color: #005aa0;
-    border: 0;
-    padding: 5px;
-    background: #fffff5;
-    font-weight: normal;
-    font-style: italic;
-    box-shadow: none;
-    margin-bottom: 1em;
-}
-
-div.navheader table, div.navfooter table {
-    box-shadow: none;
-}