-
-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy path.chezmoi.yaml.tmpl
45 lines (38 loc) · 1.58 KB
/
.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{{- $name := "Manassarn Manoonchai" -}}
{{- $email := "[email protected]" -}}
{{- $github_user := "narze" -}}
{{- $computer_name := default "narze-computer-name" (env "CM_computer_name") -}}
{{- $hostname := default "narze" (env "CM_hostname") -}}
{{- $is_codespace := false }}
{{- $nas_mount_path := default "~/mnt/nas" (env "NAS_PATH") -}}
{{- $passphrase := default "change me with 'SETPASS=1 chezmoi init'" (index . "passphrase") -}}
{{- $is_codespace:= env "CODESPACES" | not | not -}}
{{- if (env "ASK") }}
{{- $computer_name = promptString "Computer Name" $computer_name -}}
{{- $hostname = promptString "Hostname" $hostname -}}
{{- $name = promptString "Full Name" $name -}}
{{- $email = promptString "Email" $email -}}
{{- $github_user = promptString "GitHub Username" $github_user -}}
{{- end }}
{{- if (env "SETPASS") }}
{{ $passphrase = promptString "Encryption Passphrase" $passphrase -}}
{{- end }}
{{- $delta_is_not_installed := true }}
{{- if (contains "delta" (output "bash" "-c" "command -v delta || true")) }}
{{- $delta_is_not_installed = false }}
{{- end }}
data:
name: {{ $name | quote }}
email: {{ $email | quote }}
github_user: {{ $github_user | quote }}
computer_name: {{ $computer_name | quote }}
hostname: {{ $hostname | quote }}
nas_mount_path: {{ $nas_mount_path | quote }}
passphrase: {{ $passphrase | quote }}
flags:
delta_is_not_installed: {{ $delta_is_not_installed }}
is_codespace: {{ $is_codespace }}
encryption: gpg
gpg:
symmetric: true
args: ["--batch", "--passphrase", {{ $passphrase | quote }}, "--no-symkey-cache", "--quiet"]