-
Notifications
You must be signed in to change notification settings - Fork 0
/
.chezmoi.toml.tmpl
69 lines (63 loc) · 2.42 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
{{/* boolean feature tags */}}
{{- $docker := false -}}{{/* true if this machine should have Docker installed */}}
{{- $ephemeral := false -}}{{/* true if this machine is ephemeral, e.g. a cloud or VM instance */}}
{{- $headless := false -}}{{/* true if this machine does not have a screen and keyboard */}}
{{- $personal := false -}}{{/* true if this machine should have personal secrets */}}
{{- $osID := .chezmoi.os -}}
{{- if (and (eq .chezmoi.os "linux") (hasKey .chezmoi.osRelease "id")) -}}
{{- $osID = printf "%s-%s" .chezmoi.os .chezmoi.osRelease.id -}}
{{- end -}}
{{/* detect GitHub codespaces, VSCode remote containers, Docker containers, Multipass VMs, and Vagrant boxes */}}
{{- if or (env "CODESPACES") (env "REMOTE_CONTAINERS_IPC") (eq .chezmoi.username "root" "ubuntu" "vagrant" "vscode") -}}
{{- $ephemeral = true -}}
{{- $headless = true -}}
{{- end -}}
{{/* work around unreliable hostname on darwin */}}
{{- $hostname := .chezmoi.hostname -}}
{{- if eq .chezmoi.os "darwin" -}}
{{- $computerName := output "scutil" "--get" "ComputerName" | trim -}}
{{- if eq $computerName "Tom’s MacBook Air" -}}
{{- $hostname = "toms-mba" -}}
{{- else -}}
{{- $hostname = $computerName -}}
{{- end -}}
{{- end -}}
{{- if eq .chezmoi.os "windows" -}}
{{- $ephemeral = true -}}
{{- end -}}
{{- if not $ephemeral -}}
{{- if eq $hostname "legion" -}}
{{- $docker = true -}}
{{- else if eq $hostname "raspberrypi4" -}}
{{- $headless = true -}}
{{- $personal = true -}}
{{- else if eq $hostname "thinkpad" -}}
{{- $personal = true -}}
{{- else if eq $hostname "toms-mba" -}}
{{- $personal = true -}}
{{- else if stdinIsATTY -}}
{{- $headless = promptBoolOnce . "headless" "headless" -}}
{{- $ephemeral = promptBoolOnce . "ephemeral" "ephemeral" -}}
{{- if not $ephemeral -}}
{{- $docker = promptBoolOnce . "docker" "docker" -}}
{{- $personal = promptBoolOnce . "personal" "personal" -}}
{{- end -}}
{{- else -}}
{{- $ephemeral = true -}}
{{- $headless = true -}}
{{- end -}}
{{- end -}}
{{- $email := "[email protected]" -}}
{{- if not $personal -}}
{{- $email = "[email protected]" -}}
{{- end -}}
[data]
docker = {{ $docker }}
ephemeral = {{ $ephemeral }}
email = {{ $email | quote }}
headless = {{ $headless }}
hostname = {{ $hostname | quote }}
personal = {{ $personal }}
osid = {{ $osID | quote }}
font = 10
pyenv = true