forked from jasonmorganson/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.chezmoi.yaml.tmpl
28 lines (24 loc) · 992 Bytes
/
.chezmoi.yaml.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
{{- $interactive := not (any (env "CI") (env "HEADLESS") (env "GITPOD_WORKSPACE_ID") (env "CODER_RUNTIME") (env "GITHUB_ACTIONS") (env "CODESPACES") (env "REMOTE_CONTAINERS_IPC")) -}}
{{- $user := env "USER" -}}
{{- if $interactive -}}
{{- $user = promptString "Username" }}
{{- else -}}
{{- $user = coalesce (env "CODER_USERNAME") (env "USERNAME") (env "USER") .chezmoi.username -}}
{{- end -}}
{{- $name := env "NAME" -}}
{{- if $interactive -}}
{{- $name = promptString "Name" }}
{{- else -}}
{{- $name = coalesce (env "CODER_USERNAME") (env "GITPOD_GIT_USER_NAME") (env "NAME") .chezmoi.username -}}
{{- end -}}
{{- $email := env "EMAIL" -}}
{{- if $interactive -}}
{{- $email = promptString "Email" }}
{{- else -}}
{{- $email = coalesce (env "CODER_USER_EMAIL") (env "GITPOD_GIT_USER_EMAIL") (env "EMAIL") (printf "%s@%s" .chezmoi.username .chezmoi.group) -}}
{{- end -}}
sourceDir: "{{ .chezmoi.sourceDir }}"
data:
user: "{{ $user }}"
name: "{{ $name }}"
email: "{{ $email }}"