Prerequisites
- You’re already using or have a basic understanding of chezmoi, and want to start committing secrets / sensitive information to your chezmoi repository
- You have age installed
Context
Personally, I started off using a password manager but quickly found it cumbersome to have to authorize every
chezmoi apply command because the secrets had to pulled and processed when running the command. Which… makes
sense, I wouldn’t want my Terminal Emulator to have unencumbered access to my Password Manager.
Thinking about it a bit more, I realized that I didn’t particularly need the secrets to be secrets when they’re on my device. I’m operating under the assumption that I can trust the device that I’m on and simply need things to stay a secret when on my repository.
Guide
- Create an age key
age-keygen -o key.txt- Make sure to note the public key in the output, which looks something like:
Public key: agexxx... key.txtis now your private key
- Encrypt your private key
age -p -o key.txt.age key.txt- Make note of this passphrase, it’ll be used to decrypt the encrypted file later
- Move the encrypted private key to your chezmoi folder
- Add the encrypted private key to your
.chezmoiignore - Create the script
- Update your
.chezmoi.toml.tmplwith the age configuration