age
age encrypts the two files in the repository that cannot be public. chezmoi decrypts them on apply with the identity in ~/.config/chezmoi/key.txt.
File in dotfiles/ | Target | Contents |
|---|---|---|
key.txt.age | ~/.config/chezmoi/key.txt | the age identity itself |
private_dot_config/sops/age/encrypted_private_keys.txt.age | ~/.config/sops/age/private_keys.txt | the sops key for other repos |
key.txt.age is passphrase-encrypted, so a fresh machine can unlock it without any other secret. run_once_before_decrypt-age-key asks for that passphrase once and writes the identity with mode 600. Every other .age file is encrypted to the identity’s public key.
Runtime secrets such as API keys are not in the repo at all. They go in ~/.config/secrets.env; see Shell.
chezmoi add --encrypt ~/.config/thing/credentials # add a new encrypted filechezmoi decrypt dotfiles/key.txt.age # inspect one