-
Notifications
You must be signed in to change notification settings - Fork 0
/
.chezmoi.yaml.tmpl
73 lines (68 loc) · 2.16 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
69
70
71
72
73
{{- /* Checks if running interactively */ -}}
{{- $interactive := stdinIsATTY -}}
{{- /* Template file for chezmoi config file */ -}}
{{- $headless := false -}}{{/* true if this machine does not have a screen and keyboard */}}
{{- $kubernetes := false -}}{{/* true if this machine is used for Kubernetes work */}}
{{- $i3wm := false -}}{{/* true if this machine is using i3wm */}}
{{- $swaywm := false -}}{{/* true if this machine is using swaywm */}}
{{- $agekey := false -}}{{/* true if this machine has agekey to decrypt secret */}}
{{- $hostname := .chezmoi.hostname -}}
{{ if eq .chezmoi.hostname "taurus22" "taurus" "taurus20" "taurus-wsl" -}}
{{- $headless = false -}}
{{- $kubernetes = true -}}
{{- $i3wm = false -}}
{{- $swaywm = true -}}
{{- $agekey = true -}}
{{- end -}}
{{- if eq $hostname "vpc15" -}}
{{- $headless = false -}}
{{- $kubernetes = true -}}
{{- $i3wm = false -}}
{{- $swaywm = false -}}
{{- $agekey = true -}}
{{- end -}}
{{- if hasKey . "headless" -}}
{{- $headless = .headless -}}
{{- else if $interactive -}}
{{- $headless = promptBool "headless" -}}
{{- end -}}
{{- if hasKey . "kubernetes" -}}
{{- $kubernetes = .kubernetes -}}
{{- else if $interactive -}}
{{- $kubernetes = promptBool "kubernetes" -}}
{{- end -}}
{{- if hasKey . "agekey" -}}
{{- $agekey = .agekey -}}
{{- else if $interactive -}}
{{- $agekey = promptBool "agekey" -}}
{{- end -}}
{{- if $interactive -}}
{{- writeToStdout "💡 Tip: you can re-enter your data with `chezmoi init --data=false`.\n" -}}
{{- end -}}
{{- $osid := .chezmoi.os -}}
{{- if hasKey .chezmoi.osRelease "id" -}}
{{- $osid = printf "%s-%s" .chezmoi.os .chezmoi.osRelease.id -}}
{{- end -}}
data:
osid: {{ $osid | quote }}
headless: {{ $headless }}
kubernetes: {{ $kubernetes }}
i3wm: {{ $i3wm }}
swaywm: {{ $swaywm }}
agekey: {{ $agekey }}
format: yaml
encryption: age
{{- if $agekey }}
#age:
# identity: /home/testuser/.config/sops/age/keys.txt
# recipient: age159ce95h5mlt0emfhgdgntu8z50pjfdvxell9s4zxt5ly5mh7ugvq2g5nsu
{{- end }}
merge:
command: nvim
args:
- -d
- "{{ "{{ .Destination }}" }}"
- "{{ "{{ .Source }}" }}"
- "{{ "{{ .Target }}" }}"
git:
autoAdd: true