From 8e1c359245b5de955808403e91c352d771650cc3 Mon Sep 17 00:00:00 2001 From: inkch Date: Thu, 18 Jan 2024 11:57:35 +0900 Subject: [PATCH] add run_ script to decrypt `age` key --- run_before_decrypt-private-key.sh.tmpl | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 run_before_decrypt-private-key.sh.tmpl diff --git a/run_before_decrypt-private-key.sh.tmpl b/run_before_decrypt-private-key.sh.tmpl new file mode 100644 index 0000000..dbffe10 --- /dev/null +++ b/run_before_decrypt-private-key.sh.tmpl @@ -0,0 +1,7 @@ +#!/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