1
0
Fork 0

Convert sway from hostname-allowlist to bootstrap prompt

Replaces the implicit hostname-based enable (miche/byte/kaiser got
sway automatically) with an explicit promptBool asked at first init.

New flow:
  1. `chezmoi init` asks: "sway_setup? [y/N]"
  2. User says y or N (default N)
  3. Answer is captured in data.sway_setup
  4. run_once_40-install-sway.sh.tmpl gates on .sway_setup
  5. Per-box override via marker files (preserved):
     - ~/.config/chezmoi/features/sway     → force ON
     - ~/.config/chezmoi/features/no-sway  → force OFF

Migration for existing boxes:
  - Miche/byte/kaiser already have ~/.config/chezmoi/features/sway
    marker (from previous hostname-allowlist install) → sway_setup=true
  - Rye/crouton have no marker → sway_setup=false (default)
  - Both groups pick up the new template on next chezmoi apply
This commit is contained in:
Rain 2026-06-22 14:47:43 -04:00
parent 5e2a3378cc
commit a9ba9af8db
2 changed files with 14 additions and 27 deletions

View file

@ -16,8 +16,8 @@ set -euo pipefail
log() { printf '\033[1;34m[sway]\033[0m %s\n' "$*"; }
# --- 0. Gate on the .sway flag ---
{{ if not .sway -}}
log "sway not enabled for this host (.sway=false). Skipping."
{{ if not .sway_setup -}}
log "sway_setup not enabled for this host (.sway_setup=false). Skipping."
log "To enable: touch ~/.config/chezmoi/features/sway && chezmoi apply"
exit 0
{{ end -}}