From 8fe4e0879c15102f5d30f9803d53ba4e8493a120 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Mon, 26 Aug 2019 22:45:31 +0200 Subject: [PATCH] home-manager: support a few extra pass-through options These options will be passed through to the `nix-build` tool. --- doc/man-home-manager.xml | 64 +++++++++++++++++++++++++++++++++++++++ home-manager/home-manager | 14 ++++++++- 2 files changed, 77 insertions(+), 1 deletion(-) diff --git a/doc/man-home-manager.xml b/doc/man-home-manager.xml index d83566a3..6f7a0551 100644 --- a/doc/man-home-manager.xml +++ b/doc/man-home-manager.xml @@ -102,6 +102,22 @@ + + --cores number + + + + --max-jobs number + + + + --keep-failed + + + + --keep-going + + --show-trace @@ -354,6 +370,54 @@ + + + + + + + Passed on to + nix-build + 1 . + + + + + + + + + + Passed on to + nix-build + 1 . + + + + + + + + + + Passed on to + nix-build + 1 . + + + + + + + + + + Passed on to + nix-build + 1 . + + + diff --git a/home-manager/home-manager b/home-manager/home-manager index 86adde1e..2e7f8c72 100644 --- a/home-manager/home-manager +++ b/home-manager/home-manager @@ -423,6 +423,14 @@ function doHelp() { echo " -n Do a dry run, only prints what actions would be taken" echo " -h Print this help" echo + echo "Options passed on to nix-build(1)" + echo + echo " --cores NUM" + echo " --keep-failed" + echo " --keep-going" + echo " --max-jobs NUM" + echo " --show-trace" + echo echo "Commands" echo echo " help Print this help" @@ -490,7 +498,11 @@ while [[ $# -gt 0 ]]; do -n|--dry-run) export DRY_RUN=1 ;; - --show-trace) + --max-jobs|--cores) + PASSTHROUGH_OPTS+=("$opt" "$1") + shift + ;; + --keep-failed|--keep-going|--show-trace) PASSTHROUGH_OPTS+=("$opt") ;; -v|--verbose)