From 7d1968c0e38f6fcbf503939f732619e122936eee Mon Sep 17 00:00:00 2001
From: Jan Tojnar <jtojnar@gmail.com>
Date: Fri, 23 Mar 2018 11:01:52 +0100
Subject: [PATCH 1/4] Nix minimal version: 1.11 -> 2.0

Placeholders are just too convenient.
---
 lib/minver.nix | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/minver.nix b/lib/minver.nix
index 2147820c0e4..fee6b65a244 100644
--- a/lib/minver.nix
+++ b/lib/minver.nix
@@ -1,2 +1,2 @@
 # Expose the minimum required version for evaluating Nixpkgs
-"1.11"
+"2.0"

From 18f953965598ab585cc4b3f9018463905401bdd9 Mon Sep 17 00:00:00 2001
From: Graham Christensen <graham@grahamc.com>
Date: Thu, 30 Aug 2018 08:52:43 -0400
Subject: [PATCH 2/4] nixos docs: add release notes for nix 2.0 requiremnt bump

---
 nixos/doc/manual/release-notes/rl-1809.xml | 44 ++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/nixos/doc/manual/release-notes/rl-1809.xml b/nixos/doc/manual/release-notes/rl-1809.xml
index db9e13da065..6da67fe6d1e 100644
--- a/nixos/doc/manual/release-notes/rl-1809.xml
+++ b/nixos/doc/manual/release-notes/rl-1809.xml
@@ -139,6 +139,50 @@ $ nix-instantiate -E '(import &lt;nixpkgsunstable&gt; {}).gitFull'
      seen a complete rewrite. (See above.)
     </para>
    </listitem>
+   <listitem>
+    <para>
+     The minimum version of Nix required to evaluate Nixpkgs is now 2.0.
+    </para>
+    <itemizedlist>
+     <listitem>
+      <para>
+       For users of NixOS 18.03, NixOS 18.03 defaulted to Nix 2.0, but
+       supported using Nix 1.11 by setting <literal>nix.package =
+       pkgs.nix1;</literal>. If this option is set to a Nix 1.11 package, you
+       will need to either unset the option or upgrade it to Nix 2.0.
+      </para>
+     </listitem>
+     <listitem>
+      <para>
+       For users of NixOS 17.09, you will first need to upgrade Nix by setting
+       <literal>nix.package = pkgs.nixStable2;</literal> and run
+       <command>nixos-rebuild switch</command> as the <literal>root</literal>
+       user.
+      </para>
+     </listitem>
+     <listitem>
+      <para>
+       For users of a daemon-less Nix installation on Linux or macOS, you can
+       upgrade Nix by running <command>curl https://nixos.org/nix/install |
+       sh</command>, or prior to doing a channel update, running
+       <command>nix-env -iA nix</command>.
+      </para>
+      <para>
+       If you have already run a channel update and Nix is no longer able to
+       evaluate Nixpkgs, the error message printed should provide adequate
+       directions for upgrading Nix.
+      </para>
+     </listitem>
+     <listitem>
+      <para>
+       For users of the Nix daemon on macOS, you can upgrade Nix by running
+       <command>sudo -i sh -c 'nix-channel --update &amp;&amp; nix-env -iA
+       nixpkgs.nix'; sudo launchctl stop org.nixos.nix-daemon; sudo launchctl
+       start org.nixos.nix-daemon</command>.
+      </para>
+     </listitem>
+    </itemizedlist>
+   </listitem>
    <listitem>
     <para>
      <literal>lib.strict</literal> is removed. Use

From d8f5f49dfe664d88704839134adf49c228ae8429 Mon Sep 17 00:00:00 2001
From: Graham Christensen <graham@grahamc.com>
Date: Thu, 30 Aug 2018 09:00:05 -0400
Subject: [PATCH 3/4] Reference release notes in the 'version too old' warning

---
 default.nix | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/default.nix b/default.nix
index 180815d4d6d..2070f648b9a 100644
--- a/default.nix
+++ b/default.nix
@@ -15,6 +15,9 @@ if ! builtins ? nixVersion || builtins.compareVersions requiredVersion builtins.
       it is safe to upgrade by running it again:
 
           curl https://nixos.org/nix/install | sh
+
+    For more information, please see the NixOS release notes at
+    https://nixos.org/nixos/manual.
   ''
 
 else

From a6a0005fed854c711d7efafdd4ddc9e681a44cec Mon Sep 17 00:00:00 2001
From: Graham Christensen <graham@grahamc.com>
Date: Thu, 30 Aug 2018 09:05:57 -0400
Subject: [PATCH 4/4] Reference a local copy of the release notes in the
 'version too old' warning, plus a redirect to the support links

---
 default.nix | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/default.nix b/default.nix
index 2070f648b9a..f4b2640ac5a 100644
--- a/default.nix
+++ b/default.nix
@@ -17,7 +17,10 @@ if ! builtins ? nixVersion || builtins.compareVersions requiredVersion builtins.
           curl https://nixos.org/nix/install | sh
 
     For more information, please see the NixOS release notes at
-    https://nixos.org/nixos/manual.
+    https://nixos.org/nixos/manual or locally at
+    ${toString ./doc/manual/release-notes}.
+
+    If you need further help, see https://nixos.org/nixos/support.html
   ''
 
 else