-
Notifications
You must be signed in to change notification settings - Fork 0
/
.chezmoi.toml.tmpl
61 lines (49 loc) · 1.67 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
{{- $name := "" -}}
{{- $email := "" -}}
{{- $gpg_key_id := "" -}}
{{- $github := "" -}}
{{- $tz := "" -}}
{{- $org_roam_dir := "" -}}
{{- with (index . "user") -}}
{{- with (index . "name") -}}{{- $name = . -}}{{- end -}}
{{- with (index . "email") -}}{{- $email = . -}}{{- end -}}
{{- with (index . "gpg_key_id") -}}{{- $gpg_key_id = . -}}{{- end -}}
{{- with (index . "github") -}}{{- $github = . -}}{{- end -}}
{{- with (index . "tz") -}}{{- $tz = . -}}{{- end -}}
{{- with (index . "org_roam_dir") -}}{{- $org_roam_dir = . -}}{{- end -}}
{{- end -}}
{{- $noagent := true -}}
{{- $authorized_keys := "" -}}
{{- $config := "" -}}
{{- with (index . "ssh") -}}
{{- if hasKey . "no_agent" -}}{{- $noagent = (index . "no_agent") -}}{{- end -}}
{{- with (index . "authorized_keys") -}}{{- $authorized_keys = . -}}{{- end -}}
{{- with (index . "config") -}}{{- $config = . -}}{{- end -}}
{{- end -}}
{{- if (eq $name "") -}}
{{- $name = promptString "Display Name" -}}
{{- end -}}
{{- if (eq $email "") -}}
{{- $email = promptString "Email Address" -}}
{{- end -}}
{{- if (eq $github "") -}}
{{- $github = promptString "GitHub ID (for importing authorized ssh keys)" -}}
{{- end -}}
{{- if (eq $tz "") -}}
{{- $tz = "America/Phoenix" -}}
{{- end -}}
[data]
[data.user]
name = {{ $name | quote }}
email = {{ $email | quote }}
gpg_key_id = {{ $gpg_key_id | quote }}
github = {{ $github | quote }}
tz = {{ $tz | quote }}
org_roam_dir = {{ $org_roam_dir | quote }}
[data.ssh]
no_agent = {{ $noagent }}
authorized_keys = [{{ with $authorized_keys}}{{ range . }}
{{ . | quote }},{{ end }}
{{ end }}]
config = """
{{ $config }}"""