Skip to content

Commit a45527d

Browse files
committed
prompts: drop trailing '?' + add useGitea toggle
Two small things from testing on the Mac: 1. chezmoi appends '?' to every prompt title, so prompts that end in '?' came out as '??'. Strip the trailing '?' from every prompt title. 2. Add useGitea boolean prompt (default false) so users who use a self-hosted Gitea instance get a recurring reminder to run scripts/post/setup_gitea.sh. Quiet for everyone else. Existing machines will see 'config file template has changed' on next apply and need `chezmoi init --prompt` once to pick up useGitea.
1 parent 48c25f6 commit a45527d

3 files changed

Lines changed: 17 additions & 8 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ Asked at init and cached; re-prompt via `chezmoi init --prompt`.
5151
| `includePersonalApps` | Bambu Studio, KiCad (macOS only). |
5252
| `installDocker` | Docker via get.docker.com (Linux only). |
5353
| `installClaudeCode` | Claude Code via `claude.ai/install.sh` (Linux only; macOS gets it via brew). |
54+
| `useGitea` | Enable the post-install reminder for `scripts/post/setup_gitea.sh`. |
5455

5556
Plus two string prompts: `email` and `name` for git config.
5657

home/.chezmoi.toml.tmpl

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
{{- $name := promptStringOnce . "name" "Git name" "Eliott Teissonniere" -}}
88
{{- $githubUser := promptStringOnce . "githubUser" "GitHub username" "ETeissonniere" -}}
99

10-
{{- $isDesktop := promptBoolOnce . "isDesktop" "Desktop workstation (not a VM/server)?" true -}}
10+
{{- $isDesktop := promptBoolOnce . "isDesktop" "Desktop workstation (not a VM/server)" true -}}
11+
{{- $useGitea := promptBoolOnce . "useGitea" "Use a (self-hosted) Gitea instance" false -}}
1112

1213
{{- $includeVirt := false -}}
1314
{{- $includeSocials := false -}}
@@ -19,15 +20,15 @@
1920

2021
{{- if eq .chezmoi.os "darwin" -}}
2122
{{- if $isDesktop -}}
22-
{{- $includeVirt = promptBoolOnce . "includeVirt" "Include virtualization tools (UTM)?" true -}}
23-
{{- $includeSocials = promptBoolOnce . "includeSocials" "Include social apps (Telegram, WhatsApp)?" false -}}
23+
{{- $includeVirt = promptBoolOnce . "includeVirt" "Include virtualization tools (UTM)" true -}}
24+
{{- $includeSocials = promptBoolOnce . "includeSocials" "Include social apps (Telegram, WhatsApp)" false -}}
2425
{{- end -}}
25-
{{- $isLaptop = promptBoolOnce . "isLaptop" "Laptop (install Tailscale)?" false -}}
26-
{{- $includeWorkApps = promptBoolOnce . "includeWorkApps" "Include work apps (Slack)?" false -}}
27-
{{- $includePersonalApps = promptBoolOnce . "includePersonalApps" "Include personal apps (Bambu Studio, KiCad)?" false -}}
26+
{{- $isLaptop = promptBoolOnce . "isLaptop" "Laptop (install Tailscale)" false -}}
27+
{{- $includeWorkApps = promptBoolOnce . "includeWorkApps" "Include work apps (Slack)" false -}}
28+
{{- $includePersonalApps = promptBoolOnce . "includePersonalApps" "Include personal apps (Bambu Studio, KiCad)" false -}}
2829
{{- else -}}
29-
{{- $installDocker = promptBoolOnce . "installDocker" "Install Docker (via get.docker.com)?" true -}}
30-
{{- $installClaudeCode = promptBoolOnce . "installClaudeCode" "Install Claude Code (via install.sh)?" true -}}
30+
{{- $installDocker = promptBoolOnce . "installDocker" "Install Docker (via get.docker.com)" true -}}
31+
{{- $installClaudeCode = promptBoolOnce . "installClaudeCode" "Install Claude Code (via install.sh)" true -}}
3132
{{- end -}}
3233

3334
sourceDir = {{ .chezmoi.workingTree | quote }}
@@ -48,6 +49,7 @@ sourceDir = {{ .chezmoi.workingTree | quote }}
4849
name = {{ $name | quote }}
4950
githubUser = {{ $githubUser | quote }}
5051
isDesktop = {{ $isDesktop }}
52+
useGitea = {{ $useGitea }}
5153
includeVirt = {{ $includeVirt }}
5254
includeSocials = {{ $includeSocials }}
5355
isLaptop = {{ $isLaptop }}

home/run_after_99-post-install-checks.sh.tmpl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ if [[ -f "$HOME/.ssh/id_ed25519.pub" ]] && command -v gh >/dev/null 2>&1; then
1717
fi
1818
fi
1919

20+
{{ if .useGitea -}}
21+
if command -v tea >/dev/null 2>&1 && [[ ! -f "$HOME/.config/tea/config.yml" ]]; then
22+
pending+=("Set up Gitea (tea login + SSH key): {{ .chezmoi.workingTree }}/scripts/post/setup_gitea.sh")
23+
fi
24+
{{- end }}
25+
2026
if [[ ${#pending[@]} -gt 0 ]]; then
2127
echo
2228
echo "==> Post-install steps pending:"

0 commit comments

Comments
 (0)