Skip to content

Commit

Permalink
Merge pull request #441 from ip1981/master
Browse files Browse the repository at this point in the history
Add `--fallback` and `--cores` options to `nixops deploy`
  • Loading branch information
domenkozar committed May 30, 2016
2 parents 3ea47bc + 3e697a6 commit 0c7859b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/nixops
Expand Up @@ -73,10 +73,11 @@ def open_deployment():
depl.extra_nix_path = sum(args.nix_path or [], [])
for (n, v) in args.nix_options or []: depl.extra_nix_flags.extend(["--option", n, v])
if args.max_jobs != None: depl.extra_nix_flags.extend(["--max-jobs", str(args.max_jobs)])
if args.max_jobs != None: depl.extra_nix_flags.extend(["--max-jobs", str(args.max_jobs)])
if args.cores != None: depl.extra_nix_flags.extend(["--cores", str(args.cores)])
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.fallback: depl.extra_nix_flags.append("--fallback")
if not args.read_only_mode: depl.extra_nix_eval_flags.append("--read-write-mode")

return depl
Expand Down Expand Up @@ -691,9 +692,11 @@ def add_subparser(name, help):
# Nix options that we pass along.
subparser.add_argument('-I', nargs=1, action="append", dest="nix_path", metavar='PATH', help='append a directory to the Nix search path')
subparser.add_argument("--max-jobs", '-j', type=int, metavar='N', help='set maximum number of concurrent Nix builds')
subparser.add_argument("--cores", type=int, metavar='N', help='sets the value of the NIX_BUILD_CORES environment variable in the invocation of builders')
subparser.add_argument("--keep-going", action='store_true', help='keep going after failed builds')
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('--fallback', action='store_true', help='fall back on installation from source')
subparser.add_argument('--option', nargs=2, action="append", dest="nix_options", metavar=('NAME', 'VALUE'), help='set a Nix option')
subparser.add_argument('--read-only-mode', action='store_true', help='run Nix evaluations in read-only mode')

Expand Down

0 comments on commit 0c7859b

Please sign in to comment.