fix(installer): resolve disko evaluation crash and infinite loops

- Fix disko-config.nix signature by adding '...' to handle unexpected CLI arguments.
- Update disko mode to 'destroy,format,mount' for the modern API and to avoid deprecation warnings.
- Fix infinite loops in 'configure_impermanence' and 'confirm_form_factor' caused by misinterpreting 'No' (rc=1) as an abort.
This commit is contained in:
Bernardo Magri
2026-05-01 16:43:05 +01:00
parent 61cd993e54
commit 3b977f181d
2 changed files with 5 additions and 3 deletions

View File

@@ -841,7 +841,7 @@ confirm_form_factor() {
if [[ $rc -eq 0 ]]; then
FORM_FACTOR="$default"
else
if [[ $rc -eq 130 || $rc -eq 1 ]]; then return 130; fi
if [[ $rc -eq 130 ]]; then return 130; fi
FORM_FACTOR=$([[ "$default" == "laptop" ]] && echo desktop || echo laptop)
fi
success "Form factor: $FORM_FACTOR"
@@ -875,7 +875,8 @@ configure_impermanence() {
ENABLE_IMPERMANENCE="true"
success "Impermanence enabled"
else
if [[ $rc -eq 130 || $rc -eq 1 ]]; then return 130; fi
if [[ $rc -eq 130 ]]; then return 130; fi
ENABLE_IMPERMANENCE="false"
info "Impermanence disabled (traditional persistent root)"
fi
save_state
@@ -1093,7 +1094,7 @@ run_disko_with_retry() {
while true; do
local rc=0
set +e
disko --mode disko \
disko --mode destroy,format,mount \
--argstr mainDrive "$main_drive" \
--arg extraDrives "$extras_nix" \
"$disko_file" 2>&1 | tee "$log"