-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.chezmoi.yaml.tmpl
49 lines (45 loc) · 1.82 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
46
47
48
49
{{/* Global flags */}}
{{- $ephemeral := false -}}{{/* currently unused */}}
{{- $headless := false -}}{{/* currently unused */}}
{{- $personal := false -}}{{/* true if this machine should have personal secrets */}}
{{- $work := false -}}{{/* true if this machine should have work secrets */}}
{{- "" -}}
{{/* Handle hostname (including on macOS). */}}
{{- $hostname := .chezmoi.hostname -}}
{{- if eq .chezmoi.os "darwin" -}}
{{- $computerName := output "scutil" "--get" "ComputerName" | trim -}}
{{- if eq $computerName "Chris’s MacBook Pro" -}}
{{- $hostname = "chapterhouse" -}}
{{- else if eq $computerName "Chris Waltrip KFLFK3Q77P" -}}
{{- $hostname = "caladan" -}}
{{- else -}}
{{- $hostname = $computerName -}}
{{- end -}}
{{- end -}}
{{/* Get all the configuration values */}}
{{- $email := promptStringOnce . "email" "Email address" -}}
{{- $bitwardenAccount := promptStringOnce . "bitwardenAccount" "Bitwarden email address" -}}
{{- if not $ephemeral -}}
{{- if eq $hostname "chapterhouse" -}}
{{- $personal = true -}}
{{- else if eq $hostname "caladan" -}}
{{- $work = true -}}
{{- else if stdinIsATTY -}}
{{- $personal = promptBoolOnce . "personal" "Store personal secrets?" -}}
{{- $work = promptBoolOnce . "work" "Store work secrets?" -}}
{{- $headless = promptBoolOnce . "headless" "Is this system headless?" -}}
{{- $ephemeral = promptBoolOnce . "ephemeral" "Is this system ephemeral?" -}}
{{- else -}}
{{- $ephemeral = true -}}
{{- $headless = true -}}
{{- end -}}
{{- end -}}
data:
name: "Chris Waltrip"
email: {{ $email | quote }}
hostname: {{ $hostname | quote }}
personal: {{ $personal }}
work: {{ $work }}
ephemeral: {{ $ephemeral }}
headless: {{ $headless }}
bitwardenAccount: {{ $bitwardenAccount | quote }}{{/* currently unused */}}