chore: manage.sh accept extraArgs

This commit is contained in:
Primrose 2026-02-02 11:06:12 +01:00
parent 78b288592e
commit b66d357c56
Signed by: primrose
GPG key ID: 4E887A4CA9714ADA

View file

@ -14,19 +14,6 @@ function mk-nixos-cmd-args() {
echo "${args[@]}" echo "${args[@]}"
} }
function wrapped-nixos-rebuild() {
hostname="$1"
action="$2"
# shellcheck disable=SC2046
nixos-rebuild "$action" $(mk-nixos-cmd-args "$hostname") --no-reexec
}
function wrapped-nixos-install() {
hostname="$1"
# shellcheck disable=SC2046
nixos-install $(mk-nixos-cmd-args "$hostname")
}
function help() { function help() {
cat <<EOF cat <<EOF
manage.sh manage.sh
@ -54,7 +41,13 @@ os)
help help
exit 1 exit 1
fi fi
wrapped-nixos-rebuild "$1" "$2" hostname="$1"
action="$2"
shift
shift
# shellcheck disable=SC2046
nixos-rebuild "$action" $(mk-nixos-cmd-args "$hostname") "$@" --no-reexec
;; ;;
install) install)
@ -62,7 +55,11 @@ install)
help help
exit 1 exit 1
fi fi
wrapped-nixos-install "$1" hostname="$1"
shift
# shellcheck disable=SC2046
echo nixos-install $(mk-nixos-cmd-args "$hostname") "$@"
;; ;;
help | *) help | *)