Skip to content

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 (including per-service subdirectories such as secrets/bella/ and secrets/goblin/)
  • recipient mapping: secrets/secrets.nix

Standard Flow ​

agenix comes from the flake input (and is installed by home.nix). NixOS hosts auto-import agenix.nixosModules.default in flake.nix.

From the repository root, edit an existing secret with the rules file in scope:

bash
(cd secrets && agenix -e miniflux.age)

After changing recipient keys in secrets/secrets.nix, rekey all secrets:

bash
(cd secrets && agenix -r)

Add a New Secret ​

  1. Add the new filename and its recipient keys to secrets/secrets.nix.
  2. From the repository root, create the encrypted file with (cd secrets && agenix -e service-name.age), replacing service-name with the real name. Agenix reads secrets.nix from its working directory.
  3. 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.md
  • secrets/secrets.nix