-
Notifications
You must be signed in to change notification settings - Fork 2
/
.chezmoi.toml.tmpl
163 lines (145 loc) · 7.72 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
{{- $isWsl := or (env "WSL_DISTRO_NAME") (env "IS_WSL") | not | not -}}
{{- $isDevcontainer := or (env "REMOTE_CONTAINERS") (env "CODESPACES") (env "VSCODE_REMOTE_CONTAINERS_SESSION") | not | not -}}
{{- $isGnome := lookPath "gnome-shell" | not | not -}}
{{- $hasHomeGPG := not ( kindIs "boolean" ( stat (joinPath .chezmoi.homeDir ".gnupg/private-keys-v1.d" ) ) ) -}}
{{- $headlessGuess := ( or $isWsl (not (or ( env "DISPLAY" ) (eq .chezmoi.os "windows" ) ) ) ) -}}
{{- $gpgconfiguredGuess := $hasHomeGPG -}}
{{- $headless := promptBool "headless" $headlessGuess -}}
{{- $gpgconfigured := promptBool "gpgconfigured" $gpgconfiguredGuess -}}
{{- $autoGit := promptBool "auto git?" true -}}
{{- $optbins := (list) -}}
{{- $usrbins := (list) -}}
{{- $usrlocalbins := (list) -}}
{{- $binpaths := (list) -}}
{{- $binroots := (list) -}}
{{- $terminfosearch := (list) -}}
{{- $termfallback := (list "linux" "vt100" ) -}}
{{- $gpgLocation := "/usr/bin/gpg" -}}
#{{ if eq .chezmoi.os "darwin" }} Darwin
{{- $optbins = (list) -}}
{{- $usrbins = (list) -}}
{{- $usrlocalbins = (list) -}}
{{- $binpaths = (list (joinPath .chezmoi.homeDir "/.dotnet/tools") ) -}}
{{- $binroots = (list "/" "/usr/" .chezmoi.homeDir (joinPath .chezmoi.homeDir "/.local" ) (joinPath .chezmoi.homeDir "/go" ) (joinPath .chezmoi.homeDir "/Library/flutter" ) (joinPath .chezmoi.homeDir "/.pub-cache" ) (joinPath .chezmoi.homeDir "/.cache/npm" ) ) -}}
{{- $terminfosearch = (list "/usr/share/terminfo" "/usr/lib/share/terminfo" "/usr/share/lib/terminfo" ) -}}
{{- $termfallback = (list "xterm" "linux" "vt100" ) -}}
#{{ else if eq .chezmoi.os "linux" }} Linux
{{- $optbins = (list) -}}
{{- $usrbins = (list "games" ) -}}
{{- $usrlocalbins = (list) -}}
{{- $binpaths = (list (joinPath .chezmoi.homeDir "/.dotnet/tools" ) ) -}}
{{- $binroots = (list "/" "/usr/" "/usr/local/" .chezmoi.homeDir (joinPath .chezmoi.homeDir "/.local" ) (joinPath .chezmoi.homeDir "/go" ) (joinPath .chezmoi.homeDir "/libs/flutter" ) (joinPath .chezmoi.homeDir "/.pub-cache" ) (joinPath .chezmoi.homeDir "/.cache/npm" ) ) -}}
{{- $terminfosearch = (list "/usr/share/terminfo" "/usr/lib/share/terminfo" "/usr/share/lib/terminfo" ) -}}
{{- $termfallback = (list "rxvt" "xterm" "linux" "vt100" ) -}}
#{{ else if eq .chezmoi.os "windows" }} Windows
{{- $optbins = (list) -}}
{{- $usrbins = (list) -}}
{{- $usrlocalbins = (list) -}}
{{- $binpaths = (list) -}}
{{- $binroots = (list) -}}
{{- $terminfosearch = (list) -}}
{{- $termfallback = (list "linux" "vt100" ) -}}
{{- $gpgLocation = "C:\\Program Files (x86)\\GnuPG\\bin\\gpg.exe" -}}
#{{ else if eq .chezmoi.os "solaris" }} Solaris
{{- $optbins = (list "httrack" "SUNWsneep" "test" "VRTSvxvm" "SUNWvts" "SUNWexplo" "VRTS" "VRTSob" ) -}}
{{- $usrbins = (list "local" "sfw" "ccs" ) -}}
{{- $usrlocalbins = (list "mysql" "apache" "apache2" "php" ) -}}
{{- $binpaths = (list (joinPath .chezmoi.homeDir "/.dotnet/tools" ) ) -}}
{{- $binroots = (list "/" "/usr/" .chezmoi.homeDir (joinPath .chezmoi.homeDir "/.local" ) (joinPath .chezmoi.homeDir "/go" ) ) -}}
{{- $terminfosearch = (list "/usr/share/terminfo" "/usr/lib/share/terminfo" "/usr/share/lib/terminfo" ) -}}
{{- $termfallback = (list "xterm" "linux" "vt100" ) -}}
#{{ else }} Unknown OS {{ .chezmoi.os }}
{{- $optbins = (list) -}}
{{- $usrbins = (list) -}}
{{- $usrlocalbins = (list) -}}
{{- $binpaths = (list) -}}
{{- $binroots = (list) -}}
{{- $terminfosearch = (list) -}}
{{- $termfallback = (list "linux" "vt100" ) -}}
#{{ end }} End OS Specific code
{{- $gitCredentialManagerLocation := findExecutable "bin/git-credential-manager" $binroots -}}
{{- $vimdiffLocation := findExecutable "bin/vimdiff" $binroots -}}
{{- $nvimdiffLocation := findExecutable "bin/nvimdiff" $binroots -}}
{{- $kdiff3Location := findExecutable "bin/kdiff3" $binroots -}}
{{- $vimLocation := findExecutable "bin/vim" $binroots -}}
{{- $neovimLocation := findExecutable "bin/nvim" $binroots -}}
{{- $vimpagerLocation := findExecutable "bin/vimpager" $binroots -}}
{{- $nvimpagerLocation := findExecutable "bin/nvimpager" $binroots -}}
{{- $zshLocation := findExecutable "bin/zsh" $binroots -}}
{{- $lessLocation := findExecutable "bin/less" $binroots -}}
{{- $mvnLocation := findExecutable "bin/mvn" $binroots -}}
{{- $zellijLocation := findExecutable "bin/zellij" $binroots -}}
{{- $tmuxLocation := findExecutable "bin/tmux" $binroots -}}
{{- if and (eq .chezmoi.os "linux") (not (stat $gitCredentialManagerLocation )) -}}
{{- writeToStdout "Can't find GCM: https://github.com/GitCredentialManager/git-credential-manager/releases \n" -}}
{{- end -}}
{{- if and (eq .chezmoi.os "linux") (not (stat $neovimLocation)) -}}
{{- writeToStdout "Can't find neovim \n" -}}
{{- end -}}
{{- if and (eq .chezmoi.os "linux") (not (stat $vimLocation)) -}}
{{- writeToStdout "Can't find vim \n" -}}
{{- end -}}
{{- if and (eq .chezmoi.os "linux") (not (stat $vimdiffLocation)) -}}
{{- writeToStdout "Can't find vimdiff \n" -}}
{{- end -}}
{{- if and (eq .chezmoi.os "linux") (not (stat $vimpagerLocation)) -}}
{{- writeToStdout "Can't find vimpager \n" -}}
{{- end -}}
{{- if and (not (eq .chezmoi.os "windows")) (not (stat $zellijLocation)) -}}
{{- writeToStdout "Can't find zellij \n" -}}
{{- end -}}
{{- if and (not (eq .chezmoi.os "windows")) (not (stat $tmuxLocation)) -}}
{{- writeToStdout "Can't find tmux \n" -}}
{{- end -}}
{{- if and (eq .chezmoi.os "linux") (not $headless) (not (stat $kdiff3Location)) -}}
{{- writeToStdout "Can't find kdiff3 \n" -}}
{{- end -}}
{{- if and (eq .chezmoi.os "windows") (not (stat $gpgLocation )) -}}
{{- writeToStdout "Missing GPG install Kleopatra https://gpg4win.org/download.html \n" -}}
{{- end -}}
{{- if and (not (eq .chezmoi.os "windows")) (not (stat $zshLocation )) -}}
{{- writeToStdout "Can't find zsh \n" -}}
{{- end -}}
{{- if and (not (eq .chezmoi.os "windows")) (not (stat $lessLocation )) -}}
{{- writeToStdout "Can't find less \n" -}}
{{- end -}}
{{- if not (stat $mvnLocation ) -}}
{{- writeToStdout "Can't find maven (mvn) \n" -}}
{{- end -}}
[git]
autoCommit = {{ $autoGit }}
autoPush = {{ $autoGit }}
[data]
headless={{ $headless }}
gpgconfigured={{ $gpgconfigured }}
isWsl={{ $isWsl }}
isDevcontainer={{ $isDevcontainer }}
isGnome={{ $isGnome }}
gitCredentialManagerLocation="{{ $gitCredentialManagerLocation }}"
vimdiffLocation="{{ $vimdiffLocation }}"
nvimdiffLocation="{{ $nvimdiffLocation }}"
kdiff3Location="{{ $kdiff3Location }}"
vimLocation="{{ $vimLocation }}"
neovimLocation="{{ $neovimLocation }}"
vimpagerLocation="{{ $vimpagerLocation }}"
nvimpagerLocation="{{ $nvimpagerLocation }}"
gpgLocation="{{$gpgLocation}}"
zshLocation="{{$zshLocation}}"
lessLocation="{{$lessLocation}}"
mvnLocation="{{$mvnLocation}}"
optbins = [{{range $each := $optbins}}"{{$each}}", {{end}}]
usrbins = [{{range $each := $usrbins}}"{{$each}}", {{end}}]
usrlocalbins = [{{range $each := $usrlocalbins}}"{{$each}}", {{end}}]
binpaths = [{{range $each := $binpaths}}"{{$each}}", {{end}}]
binroots = [{{range $each := $binroots}}"{{$each}}", {{end}}]
terminfosearch = [{{range $each := $terminfosearch}}"{{$each}}", {{end}}]
termfallback = [{{range $each := $termfallback}}"{{$each}}", {{end}}]
[diff]
command = "more"
{{if stat $nvimdiffLocation -}}
[merge]
command = "{{$nvimdiffLocation}}"
{{else if stat $vimdiffLocation -}}
[merge]
command = "{{$vimdiffLocation}}"
{{end -}}