-
Notifications
You must be signed in to change notification settings - Fork 1
/
.chezmoi.yaml.tmpl
68 lines (61 loc) · 1.98 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
---
edit:
command: "code"
args: ["--wait"]
color: true
{{/* onepassword:
command: "op"
prompt: false */}}
{{- $name := "Jens Hilligsøe" -}}
{{- $email := "[email protected]" -}}
{{- $github_user := "hilli" -}}
{{- $codespaces := env "CODESPACES" | not | not -}}
{{- $ephemeral := false -}}
{{- $personal := false -}}
{{- $desktop := false -}}
{{- writeToStdout "Writing chezmoi config\n" -}}
{{/* work around unreliable hostname on darwin */}}
{{- $hostname := .chezmoi.hostname -}}
{{- if eq .chezmoi.os "darwin" -}}
{{- $hostname = output "scutil" "--get" "ComputerName" | trim -}}
{{- end -}}
{{/* Determine ownership from hostname */}}
{{- if eq $hostname "ultra1" "maclap1" -}}
{{- writeToStdout "Personal macOS host detected from hostname...\n" -}}
{{- $personal = true -}}
{{- end }}
{{- if eq .chezmoi.os "linux" }}
{{ $computerName := output "hostname" | trim }}
{{- if $codespaces -}}
{{- writeToStdout "Codespaces detected...\n" -}}
sourceDir: {{ .chezmoi.sourceDir | quote }}
{{- $email = "[email protected]" -}}
{{- $personal = false -}}
{{- $ephemeral = true -}}
{{- else if eq $hostname "nuc1" "minim1" -}}
{{- writeToStdout "Personal Linux/Mac host (non-desktop function) detected from hostname...\n" -}}
{{- $personal = true -}}
{{- $ephemeral = false -}}
{{- $desktop = false -}}
{{- end -}}
{{- end }}
{{/* {{- writeToStdout "Personal: " ($personal | quote) "\n" -}} */}}
{{/* {{- writeToStdout "Ephemeral: " ($ephemeral | quote) "\n" -}} */}}
{{/* {{- writeToStdout "Desktop: " ($desktop | quote) "\n" -}} */}}
{{- if not $ephemeral }}
encryption: "age"
age:
identity: "~/.age-key.txt"
recipient: "age1dzj2wu2xg927nkqwtrx2fm7hc8jv9qkyl58y9zxkcvj5pgppdp5s54343g"
{{ end -}}
data:
name: {{ $name }}
ephemeral: {{ $ephemeral }}
desktop: {{ $desktop }}
personal: {{ $personal }}
email: {{ $email }}
codespaces: {{ $codespaces }}
hostname: {{ $hostname }}
github_user: {{ $github_user }}
useBuiltinAge: true
{{ writeToStdout "chezmoi config done.\n" }}