From 1f0b4c7f12795021999306996223a840f617785a Mon Sep 17 00:00:00 2001 From: Yuri Moens Date: Wed, 12 Mar 2025 08:58:33 +0100 Subject: [PATCH] Add chezmoi template variables --- .chezmoi.toml.tmpl | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .chezmoi.toml.tmpl diff --git a/.chezmoi.toml.tmpl b/.chezmoi.toml.tmpl new file mode 100644 index 0000000..7aedbdc --- /dev/null +++ b/.chezmoi.toml.tmpl @@ -0,0 +1,26 @@ +{{- $profile := false -}} +{{- if eq (substr 0 3 .chezmoi.hostname) "lx-" -}} +{{- $profile = "sfpd" -}} +{{- else -}} +{{- $profile = promptStringOnce . "profile" "Profile" -}} +{{- end -}} + +{{- $user := false -}} +{{- $email := false -}} + +{{- if eq $profile "personal" -}} +{{- $user = "ymo" -}} +{{- $email = "yuri.moens@gmail.com" -}} +{{- else if eq $profile "sfpd" -}} +{{- $user = "moyur" -}} +{{- $email = "yuri.moens@sfpd.fgov.be" -}} +{{- end -}} + +encryption = "gpg" +[gpg] + recipient = "yuri.moens@gmail.com" + +[data] + profile = "{{ $profile }}" + user = "{{ $user }}" + email = {{ $email | quote }}