about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--doc/manual/nix-instantiate.xml12
-rw-r--r--src/nix-instantiate/nix-instantiate.cc3
2 files changed, 15 insertions, 0 deletions
diff --git a/doc/manual/nix-instantiate.xml b/doc/manual/nix-instantiate.xml
index 618b61f159dc..9488bb733833 100644
--- a/doc/manual/nix-instantiate.xml
+++ b/doc/manual/nix-instantiate.xml
@@ -35,6 +35,7 @@
         <arg choice='plain'>
           <option>--eval-only</option>
           <arg><option>--strict</option></arg>
+          <arg><option>--no-readonly-mode</option></arg>
         </arg>
         <arg choice='plain'><option>--find-file</option></arg>
       </group>
@@ -140,6 +141,17 @@ policies.</para>
 
   </varlistentry>
 
+  <varlistentry><term><option>--no-readonly-mode</option></term>
+
+    <listitem><para>When used with <option>--eval-only</option>,
+    perform evaluation in read/write mode so nix language features
+    that require it will still work (at the cost of needing to do
+    instantiation of every evaluated derivation).</para>
+
+    </listitem>
+
+  </varlistentry>
+
 </variablelist>
 
 <variablelist condition="manpage">
diff --git a/src/nix-instantiate/nix-instantiate.cc b/src/nix-instantiate/nix-instantiate.cc
index b7f944062cec..1f4d1ffab8fb 100644
--- a/src/nix-instantiate/nix-instantiate.cc
+++ b/src/nix-instantiate/nix-instantiate.cc
@@ -107,6 +107,9 @@ void run(Strings args)
             settings.readOnlyMode = true;
             evalOnly = true;
         }
+        else if (arg == "--no-readonly-mode") {
+            settings.readOnlyMode = false;
+        }
         else if (arg == "--parse-only") {
             settings.readOnlyMode = true;
             parseOnly = evalOnly = true;