Permalink
Browse files

Add --read-write-mode flag to call nix-instantiate with --read-write-…

…mode when evaluationg

Signed-off-by: Shea Levy <shea@shealevy.com>
  • Loading branch information...
1 parent b60dda3 commit 1ea5d70a209afe226e61cc8e7907f8812da3bed6 @shlevy shlevy committed Feb 7, 2014
Showing with 4 additions and 0 deletions.
  1. +2 −0 nixops/deployment.py
  2. +2 −0 scripts/nixops
View
@@ -63,6 +63,7 @@ def __init__(self, statefile, uuid, log_file=sys.stderr):
self._last_log_prefix = None
self.extra_nix_path = []
self.extra_nix_flags = []
+ self.extra_nix_eval_flags = []
self.nixos_version_suffix = None
self.logger = nixops.logger.Logger(log_file)
@@ -242,6 +243,7 @@ def _nix_path_flags(self):
def _eval_flags(self, exprs):
flags = self._nix_path_flags()
args = {key: RawValue(val) for key, val in self.args.iteritems()}
+ flags.extend(self.extra_nix_eval_flags)
flags.extend(
["--arg", "networkExprs", py2nix(exprs, inline=True),
"--arg", "args", py2nix(args, inline=True),
View
@@ -72,6 +72,7 @@ def open_deployment():
if args.keep_going: depl.extra_nix_flags.append("--keep-going")
if args.keep_failed: depl.extra_nix_flags.append("--keep-failed")
if args.show_trace: depl.extra_nix_flags.append("--show-trace")
+ if args.read_write_mode: depl.extra_nix_eval_flags.append("--read-write-mode")
return depl
@@ -628,6 +629,7 @@ def add_subparser(name, help):
subparser.add_argument("--keep-failed", '-K', action='store_true', help='keep temporary directories of failed builds')
subparser.add_argument('--show-trace', action='store_true', help='print a Nix stack trace if evaluation fails')
subparser.add_argument('--option', nargs=2, action="append", dest="nix_options", metavar=('NAME', 'VALUE'), help='set a Nix option')
+ subparser.add_argument('--read-write-mode', action='store_true', help='run nix evaluations in read-write mode')
return subparser

0 comments on commit 1ea5d70

Please sign in to comment.