chore: manage.sh accept extraArgs

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

View file

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