Allow multiple recipients for age encryption
- Add input for role for work and personal - Remove unused values in chezmoi data - Expect age.key instead of having the public key in the pathmain
parent
de14c30c48
commit
f6ed0f750e
@ -1,21 +1,23 @@
|
|||||||
{{- $development := promptBoolOnce . "development" "is this a development environment [false]" -}}
|
{{- $role_choices := list "none" "personal" "work" "server" -}}
|
||||||
{{- $personal_dev := promptBoolOnce . "personal_dev" "is this a personal development environment [false]" -}}
|
{{- $role := promptChoiceOnce . "role" "machine role" $role_choices -}}
|
||||||
{{- $git_email := promptStringOnce . "git_email" "email to use in git config" -}}
|
|
||||||
{{- $git_name := promptStringOnce . "git_name" "name to use in git config" -}}
|
{{- $git_name := promptStringOnce . "git_name" "name to use in git config" -}}
|
||||||
|
{{- $git_email := promptStringOnce . "git_email" "email to use in git config" -}}
|
||||||
{{- $include_legacy := promptBoolOnce . "include_legacy" "include old scripts [false]" -}}
|
{{- $include_legacy := promptBoolOnce . "include_legacy" "include old scripts [false]" -}}
|
||||||
{{- $work := promptBoolOnce . "work" "include work tools [false]" -}}
|
|
||||||
{{- $age_key := promptStringOnce . "age_key" "age public key of recipient" -}}
|
|
||||||
|
|
||||||
encryption = "age"
|
encryption = "age"
|
||||||
|
|
||||||
[age]
|
[age]
|
||||||
identity = "{{ .chezmoi.homeDir }}/.config/chezmoi/{{ $age_key }}.key"
|
identity = "{{ .chezmoi.homeDir }}/.config/chezmoi/age.key"
|
||||||
recipient = "{{ $age_key }}"
|
recipients = [
|
||||||
|
{{- if eq $role "personal" }}
|
||||||
|
"age1sy9etyqzwrjvpw0udxchp5u3jlm78h2c5fqprur7yyq23ngkkaxswzsnq5",
|
||||||
|
{{- else if eq $role "work" }}
|
||||||
|
"age1htqslfl4d5uv76j8eg49u9njqjx5udj9jmg3ujf2gxjjm06z0vqqwz6tlm",
|
||||||
|
{{- end }}
|
||||||
|
]
|
||||||
|
|
||||||
[data]
|
[data]
|
||||||
age_key = "{{ $age_key }}"
|
role = "{{ $role }}"
|
||||||
development = {{ $development }}
|
|
||||||
git_email = "{{ $git_email }}"
|
|
||||||
git_name = "{{ $git_name }}"
|
git_name = "{{ $git_name }}"
|
||||||
personal_dev = {{ $personal_dev }}
|
git_email = "{{ $git_email }}"
|
||||||
include_legacy = {{ $include_legacy }}
|
include_legacy = {{ $include_legacy }}
|
||||||
|
@ -0,0 +1,7 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
if [ ! -f "{{ .chezmoi.homeDir }}/.config/chezmoi/age.key" ]; then
|
||||||
|
mkdir -p "{{ .chezmoi.homeDir }}/.config/chezmoi"
|
||||||
|
age-keygen --output "{{ .chezmoi.homeDir }}/.config/chezmoi/age.key"
|
||||||
|
chmod 400 "{{ .chezmoi.homeDir }}/.config/chezmoi/age.key"
|
||||||
|
fi
|
Loading…
Reference in New Issue