-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.chezmoi.toml.tmpl
97 lines (87 loc) · 2.92 KB
/
.chezmoi.toml.tmpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
{{- /* Checks if running interactively, which is not the case for GitHub Codespaces */ -}}
{{- $interactive := stdinIsATTY -}}
{{- if $interactive -}}
{{- writeToStdout "💡 Tip: to re-enter these values, run `chezmoi init --data=false`\n\n" -}}
{{- end -}}
{{- /* full_name */ -}}
{{- $full_name := "" -}}
{{- if hasKey . "full_name" -}}
{{- $full_name = .full_name -}}
{{- else if $interactive -}}
{{- $full_name = promptString "Your full name" -}}
{{- end -}}
{{- /* email */ -}}
{{- $email := "" -}}
{{- if hasKey . "email" -}}
{{- $email = .email -}}
{{- else if $interactive -}}
{{- $email = promptString "Your email (@fabrichealth.com)" -}}
{{- end -}}
{{- /* git_email */ -}}
{{- $git_email := $email -}}
{{- if hasKey . "git_email" -}}
{{- $git_email = .git_email -}}
{{- else if $interactive -}}
{{- $git_email = promptString "Your email (for git commits)" $git_email -}}
{{- end -}}
{{- /* github_user */ -}}
{{- $github_user := "" -}}
{{- if hasKey . "github_user" -}}
{{- $github_user = .github_user -}}
{{- else if $interactive -}}
{{- $github_user = promptString "Your github username (CASE SENSITIVE!)" -}}
{{- end -}}
{{- /* editor */ -}}
{{- $choices := list "emacs" "nano" "nvim" "vscode" "zed" "other" -}}
{{- $editor := "nano" -}}
{{- if hasKey . "editor" -}}
{{- $editor = .editor -}}
{{- else if $interactive -}}
{{- $editor = promptChoice "Your text editor for git commits" $choices $editor -}}
{{- if eq $editor "vscode" -}}
{{- $editor = "code" -}}
{{- else if eq $editor "other" -}}
{{- $editor = promptString "Other Editor" -}}
{{- end -}}
{{- end -}}
{{- /* visual */ -}}
{{- $choices := list "emacs" "nvim" "vscode" "zed" "other" -}}
{{- $visual := "vscode" -}}
{{- if hasKey . "visual" -}}
{{- $visual = .visual -}}
{{- else if $interactive -}}
{{- $visual = promptChoice "Your visual editor (IDE)" $choices $visual -}}
{{- if eq $visual "vscode" -}}
{{- $visual = "code" -}}
{{- else if eq $visual "other" -}}
{{- $visual = promptString "Other visual editor (IDE)" -}}
{{- end -}}
{{- end -}}
{{- /* vscode.vim_mode */ -}}
{{- $vim_mode := false -}}
{{- if dig "vscode" "vim_mode" false . -}}
{{- $vim_mode = .vscode.vim_mode -}}
{{- else if $interactive -}}
{{- $vim_mode = promptBool "Use VIM mode in vscode" $vim_mode -}}
{{- end -}}
{{- /* homebrew_prefix */ -}}
{{- $homebrew_prefix := "" -}}
{{- if eq .chezmoi.os "linux" -}}
{{- $homebrew_prefix = "/home/linuxbrew/.linuxbrew" -}}
{{- else if eq .chezmoi.os "darwin" -}}
{{- if eq .chezmoi.arch "arm64" -}}
{{- $homebrew_prefix = "/opt/homebrew" -}}
{{- else -}}
{{- $homebrew_prefix = "/usr/local" -}}
{{- end -}}
{{- end -}}
[data]
full_name = "{{ $full_name }}"
email = "{{ $email }}"
git_email = "{{ $git_email }}"
github_user = "{{ $github_user }}"
editor = "{{ $editor }}"
visual = "{{ $visual }}"
homebrew_prefix = "{{ $homebrew_prefix }}"
[data.vscode]
vim_mode = "{{ $vim_mode }}"