mirror of
https://github.com/dnlbauer/dotfiles.git
synced 2026-09-10 13:35:30 +00:00
17 lines
411 B
Bash
17 lines
411 B
Bash
#!/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"
|