2022-11-24 22:19:03 -08:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
if [ ! -f "$HOME/.config/age/headless.txt" ]; then
|
|
|
|
logg 'Generating age public key under `~/.config/age/key.txt`'
|
|
|
|
age-keygen > "$HOME/.config/age/headless.txt"
|
|
|
|
fi
|
|
|
|
|
2022-11-24 22:23:11 -08:00
|
|
|
if [ -f "{{ .chezmoi.sourceDir }}/key.txt.age" ]; then
|
|
|
|
# TODO
|
Update dotfiles/.config/age/run_once_before_decrypt-private-key.sh.tmpl, dotfiles/.local/share/chezmoi/home/.chezmoi.yaml.tmpl, dotfiles/.local/share/chezmoi/home/.chezmoiexternal.toml, dotfiles/.local/share/chezmoi/home/.chezmoitemplates/darwin/Brewfile, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/fedora/run_onchange_before_10-install-fedora-dependencies.tmpl, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/freebsd/run_onchange_before_11-install-freebsd-packages.tmpl, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/opensuse/run_onchange_before_11-install-opensuse-software.tmpl, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/ubuntu/run_onchange_before_10_install-ubuntu-dependencies.tmpl, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/centos/run_onchange_before_10-install-centos-dependencies.tmpl, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/archlinux/run_onchange_before_10_install-archlinux-dependencies.tmpl, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/debian/run_onchange_before_10-install-debian-dependencies.tmpl, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/_universal/run_onchange_before_90-install-packages.tmpl, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/_universal/run_onchange_before_91-configure-gpg.tmpl, dotfiles/.local/share/chezmoi/home/.chezmoidata.yml
2022-11-27 09:46:53 -08:00
|
|
|
logg 'Decrypting age key'
|
2022-11-24 22:23:11 -08:00
|
|
|
age --decrypt --output "$HOME/.config/age/key.txt" "{{ .chezmoi.sourceDir }}/key.txt.age"
|
|
|
|
chmod 600 "$HOME/.config/age/key.txt"
|
2022-11-24 22:19:03 -08:00
|
|
|
fi
|