Skip to content

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/TargetContents
key.txt.age~/.config/chezmoi/key.txtthe age identity itself
private_dot_config/sops/age/encrypted_private_keys.txt.age~/.config/sops/age/private_keys.txtthe 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.

Terminal window
chezmoi add --encrypt ~/.config/thing/credentials # add a new encrypted file
chezmoi decrypt dotfiles/key.txt.age # inspect one