From 0c3e8a616e8e243ee45c78491fe86f50230d82b9 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Tue, 4 Feb 2014 09:17:59 -0500 Subject: [PATCH] nix-instantiate: Add a --no-readonly-mode flag This allows running nix-instantiate --eval-only without performing the evaluation in readonly mode, letting features like import from derivation and automatic substitution of builtins.storePath paths work. Signed-off-by: Shea Levy --- doc/manual/nix-instantiate.xml | 12 ++++++++++++ src/nix-instantiate/nix-instantiate.cc | 3 +++ 2 files changed, 15 insertions(+) diff --git a/doc/manual/nix-instantiate.xml b/doc/manual/nix-instantiate.xml index 618b61f15..9488bb733 100644 --- a/doc/manual/nix-instantiate.xml +++ b/doc/manual/nix-instantiate.xml @@ -35,6 +35,7 @@ + @@ -140,6 +141,17 @@ policies. + + + When used with , + 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). + + + + + diff --git a/src/nix-instantiate/nix-instantiate.cc b/src/nix-instantiate/nix-instantiate.cc index b7f944062..1f4d1ffab 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;