Skip to content

Commit 959e30f

Browse files
committed
Store brew prefix in config
1 parent 8021003 commit 959e30f

1 file changed

Lines changed: 21 additions & 9 deletions

File tree

home/.chezmoi.toml.tmpl

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,33 @@
11
{{ $email := promptStringOnce . "email" "Email Address (Git, GPG, etc.)" -}}
22
{{ $gitName := promptStringOnce . "gitName" "Name to use for git actions" -}}
33
{{ $gitHooksPath := promptStringOnce . "gitHooksPath" "Custom core Git hooks path" -}}
4-
{{ $gui := promptBoolOnce . "gui" "Enable GUI options?" -}}
4+
{{ $gui := promptBoolOnce . "gui" "Enable GUI options" -}}
55
{{ $defaultPkgType := "brew" -}}
66
{{ if eq .chezmoi.os "linux" -}}
77
{{ $defaultPkgType = "apt" -}}
88
{{ end -}}
99
{{ $useLinuxBrew := false -}}
1010
{{ if eq .chezmoi.os "linux" -}}
11-
{{ $useLinuxBrew = promptBoolOnce . "useLinuxBrew" "Use LinuxBrew?" -}}
11+
{{ $useLinuxBrew = promptBoolOnce . "useLinuxBrew" "Use LinuxBrew" -}}
12+
{{ end -}}
13+
14+
{{ $brewPrefix := "" -}}
15+
{{ if eq .chezmoi.os "darwin" -}}
16+
{{ if eq .chezmoi.arch "arm64" -}}
17+
{{ $brewPrefix = "/opt/homebrew" -}}
18+
{{ else -}}
19+
{{ $brewPrefix = "/usr/local" -}}
20+
{{ end -}}
21+
{{ else if and (eq .chezmoi.os "linux") $useLinuxBrew -}}
22+
{{ $brewPrefix = "/home/linuxbrew/.linuxbrew" -}}
1223
{{ end -}}
1324

1425
[data]
15-
email = {{ $email | quote }}
16-
gitName = {{ $gitName | quote }}
17-
gitHooksPath = {{ $gitHooksPath | quote }}
18-
gui = {{ $gui }}
19-
defaultPkgType = {{ $defaultPkgType | quote }}
20-
useLinuxBrew = {{ $useLinuxBrew }}
21-
tags = {{ get $ "tags" | default list | toToml -}}
26+
email = {{ $email | toToml }}
27+
gitName = {{ $gitName | toToml }}
28+
gitHooksPath = {{ $gitHooksPath | toToml }}
29+
gui = {{ $gui | toToml }}
30+
defaultPkgType = {{ $defaultPkgType | toToml }}
31+
useLinuxBrew = {{ $useLinuxBrew | toToml }}
32+
tags = {{ get $ "tags" | default list | toToml }}
33+
brewPrefix = {{ $brewPrefix | toToml }}

0 commit comments

Comments
 (0)