mirror of
https://codeberg.org/leana8959/.files.git
synced 2026-02-03 07:29:41 +00:00
chore: manage.sh accept extraArgs
This commit is contained in:
parent
78b288592e
commit
b66d357c56
1 changed files with 12 additions and 15 deletions
27
manage.sh
27
manage.sh
|
|
@ -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"
|
||||
action="$2"
|
||||
shift
|
||||
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 | *)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue