feat(packages/rebuild): add quick mode to skip commit and reboot prompts

This commit is contained in:
Mohammad Rafiq 2025-06-12 22:57:37 +08:00
parent 8ea093d939
commit 9de4ef0ce6
No known key found for this signature in database

View file

@ -19,6 +19,7 @@ pkgs.writeShellScriptBin "rebuild" # sh
fi fi
#TODO: get hostnames from flake nixosConfigurations #TODO: get hostnames from flake nixosConfigurations
QUICK=false
NO_GENERATION_CHECK=false NO_GENERATION_CHECK=false
TEST_SHELL=false TEST_SHELL=false
REMOTE_HOSTS=() REMOTE_HOSTS=()
@ -29,6 +30,10 @@ pkgs.writeShellScriptBin "rebuild" # sh
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
case "$1" in case "$1" in
--quick | -q)
QUICK=true
shift
;;
--no-generation-check | -n) --no-generation-check | -n)
NO_GENERATION_CHECK=true NO_GENERATION_CHECK=true
shift shift
@ -101,7 +106,10 @@ pkgs.writeShellScriptBin "rebuild" # sh
fi fi
fi fi
prompt "Commit changes" commit if "$QUICK"; then
prompt "Reboot system" sudo systemctl reboot prompt "Commit changes" commit
prompt "Reboot system" sudo systemctl reboot
fi
exit 0 exit 0
'' ''