Compare commits

..

1 commit

Author SHA1 Message Date
Marcelo Borges f17e933d1d
Merge 2db2c775b4 into 0324f60ab1 2024-10-27 08:40:59 +00:00

View file

@ -15,7 +15,6 @@ DISABLE_HARDEN=0
TEMP_CLONE=0 TEMP_CLONE=0
SKIP_CLONE=0 SKIP_CLONE=0
SKIP_EMAIL=0 SKIP_EMAIL=0
AUTO_CONFIRM=0
EDITOR="${EDITOR:-nano}" # Default to nano if EDITOR is not set EDITOR="${EDITOR:-nano}" # Default to nano if EDITOR is not set
# Helper function to display usage message # Helper function to display usage message
@ -29,7 +28,6 @@ show_help() {
printf " -t, --temp-clone Clone into a temporary directory\n" printf " -t, --temp-clone Clone into a temporary directory\n"
printf " -s, --skip-clone Skip the cloning step if directory exists\n" printf " -s, --skip-clone Skip the cloning step if directory exists\n"
printf " -se, --skip-email Skip the email replacement step in flake.nix\n" printf " -se, --skip-email Skip the email replacement step in flake.nix\n"
printf " -ac, --auto-confirm Automatically confirm the system rebuild\n"
printf " -h, --help Show this help message\n" printf " -h, --help Show this help message\n"
exit 0 exit 0
} }
@ -49,7 +47,6 @@ while [ "$#" -gt 0 ]; do
-t|--temp-clone) TEMP_CLONE=1; shift;; -t|--temp-clone) TEMP_CLONE=1; shift;;
-s|--skip-clone) SKIP_CLONE=1; shift;; -s|--skip-clone) SKIP_CLONE=1; shift;;
-se|--skip-email) SKIP_EMAIL=1; shift;; -se|--skip-email) SKIP_EMAIL=1; shift;;
-ac|--auto-confirm) AUTO_CONFIRM=1; shift;;
-h|--help) show_help;; -h|--help) show_help;;
--) shift; break;; --) shift; break;;
*) printf "${RED}Error:${NC} Unknown option: $1\n"; show_help; exit 1;; *) printf "${RED}Error:${NC} Unknown option: $1\n"; show_help; exit 1;;
@ -118,13 +115,11 @@ else
fi fi
# Confirmation prompt for system rebuild # Confirmation prompt for system rebuild
if [ "$AUTO_CONFIRM" -eq 0 ]; then printf "${YELLOW}Ready to rebuild the system with nixos-rebuild. Do you want to proceed? (y/n) ${NC}"
printf "${YELLOW}Ready to rebuild the system with nixos-rebuild. Do you want to proceed? (y/n) ${NC}" read -r confirm
read -r confirm if [ "$confirm" != "y" ]; then
if [ "$confirm" != "y" ]; then printf "${RED}Aborting system rebuild.${NC}\n"
printf "${RED}Aborting system rebuild.${NC}\n" exit 0
exit 0
fi
fi fi
# Rebuild system with new configuration # Rebuild system with new configuration