Secrets
Secrets are managed with agenix under secrets/. That means the repo can keep encrypted secret files in Git without committing plaintext values.
Files
- encrypted material:
*.age - recipient mapping:
secrets/secrets.nix
Standard Flow
From the repository root, edit an existing secret with the rules file in scope:
bash
(cd secrets && agenix -e miniflux.age)Add a New Secret
- Add the new filename and its recipient keys to
secrets/secrets.nix. - From the repository root, create the encrypted file with
(cd secrets && agenix -e service-name.age), replacingservice-namewith the real name. Agenix readssecrets.nixfrom its working directory. - Reference the secret from the affected host or module. For example, in
hosts/<name>/configuration.nix:
nix
age.secrets.miniflux.file = ../../secrets/miniflux.age;Safety Rules
- never commit plaintext secrets.
- keep names service-oriented and lowercase.
- validate affected host builds before merge.
Source
secrets/README.mdsecrets/secrets.nix