mirror of
https://github.com/dnlbauer/dotfiles.git
synced 2026-09-11 05:55:29 +00:00
feat: add machineClass and ssh config
This commit is contained in:
16
run_onchange_before_02_decrypt_age_key.sh.tmpl
Normal file
16
run_onchange_before_02_decrypt_age_key.sh.tmpl
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
{{- if ne .machineClass "private" }}
|
||||
exit 0
|
||||
{{- end }}
|
||||
|
||||
echo "Decrypting age key ..."
|
||||
if [ ! -f "$HOME/.config/chezmoi/key.txt" ]; then
|
||||
mkdir -p "$HOME/.config/chezmoi"
|
||||
chezmoi age decrypt --output "$HOME/.config/chezmoi/key.txt" --passphrase "{{ .chezmoi.sourceDir }}/key.txt.age"
|
||||
chmod 600 "$HOME/.config/chezmoi/key.txt"
|
||||
fi
|
||||
|
||||
echo "Done decrypting age key"
|
||||
Reference in New Issue
Block a user