dotfiles/.chezmoiscripts/run_before_decrypt-private-key.sh.tmpl
inkch a941ff9437 move chezmoi script to .chezmoiscripts ("special" directory)
.chezmoiscripts
---------------
If a directory called .chezmoiscripts exists in the root of the source
directory then any scripts in it are executed as normal scripts without
creating a corresponding directory in the target state.

--- https://www.chezmoi.io/reference/special-files-and-directories/chezmoiscripts/
2024-01-18 12:03:34 +09:00

8 lines
272 B
Bash

#!/bin/sh
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