no-mistakes(review): Seed OpenSuperWhisper model path only, stop overwriting app settings

This commit is contained in:
Lap Tran committed 2026-10-24 15:46:06 -04:00
1 parent 4a4ce6c585
commit 16677278ba
3 files changed
+13 -15

No files matched your search

+8 -11
View File
@@ -406,10 +406,12 @@ in
# The app reads its model from its own Application Support directory, so the
# 1.6 GB Whisper model is downloaded here once and kept outside the Nix store.
# A failed download must not fail the switch: warn, drop the partial file, and
# let the app's Settings download it later. Never write hasCompletedOnboarding -
# onboarding must still run so the captain can grant Microphone/Accessibility
# (macOS TCC grants are manual by design). A running app picks up new defaults
# on its next launch; do not kill it here.
# let the app's Settings download it later. Only a missing or unusable model
# selection is seeded; every other setting belongs to the app and survives the
# rebuild. Never write hasCompletedOnboarding - onboarding must still run so the
# captain can grant Microphone/Accessibility (macOS TCC grants are manual by
# design). A running app picks up new defaults on its next launch; do not kill
# it here.
home.activation.openSuperWhisper = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
set -euo pipefail
supportDir="$HOME/Library/Application Support/ru.starmel.OpenSuperWhisper"
@@ -433,13 +435,8 @@ in
fi
defaults=/usr/bin/defaults
"$defaults" write ru.starmel.OpenSuperWhisper selectedEngine -string whisper
"$defaults" write ru.starmel.OpenSuperWhisper whisperLanguage -string en
"$defaults" write ru.starmel.OpenSuperWhisper autoPasteTranscription -bool true
"$defaults" write ru.starmel.OpenSuperWhisper holdToRecord -bool true
"$defaults" write ru.starmel.OpenSuperWhisper addSpaceAfterSentence -bool true
"$defaults" write ru.starmel.OpenSuperWhisper startHiddenInMenuBar -bool true
if [ -f "$modelPath" ]; then
selectedModel="$("$defaults" read ru.starmel.OpenSuperWhisper selectedWhisperModelPath 2>/dev/null || true)"
if [ -f "$modelPath" ] && { [ -z "$selectedModel" ] || [ ! -f "$selectedModel" ]; }; then
"$defaults" write ru.starmel.OpenSuperWhisper selectedWhisperModelPath -string "$modelPath"
fi
'';