Secret management repository for nix-config using SOPS and age.
Preferred interactive environment is Flox + direnv, so the development shell does not depend on flake.nix or shell.nix continuing to evaluate cleanly. The Nix devshell remains available as a fallback.
direnv allownix developThe Flox environment includes:
- sops: Secret operations (edit, encrypt, decrypt)
- age: Modern encryption tool
- ssh-to-age: Convert SSH keys to age format
- gnupg: PGP key management
- age-plugin-yubikey: Yubikey support for age
- git: Version control
The Flox shell provides convenient functions for common operations:
-
edit-secret
<file>- Edit a secret file with SOPSedit-secret hosts/nanoserver/secrets.yaml
-
new-secret
<file>- Create a new secret file with SOPSnew-secret hosts/myhost/secrets.yaml
-
ssh-to-age-key
<ssh-public-key-file>- Convert SSH public key to age formatssh-to-age-key ~/.ssh/id_ed25519.pub -
list-keys - List all keys configured in .sops.yaml
list-keys
sops hosts/nanoserver/secrets.yaml
sops users/rona/secrets.yamlssh-to-age < ~/.ssh/id_ed25519.pub- Generate age key from host SSH key
- Add to
.sops.yamlkeys section - Add to appropriate creation rules
SOPS configuration is in .sops.yaml with encryption rules for:
- Common host secrets
- Per-host secrets
- User secrets
- Key management secrets
- SOPS_AGE_KEY_FILE: Automatically set to
$HOME/.config/sops/age/keys.txt
This repository is intended to be public. Secret material stays encrypted with SOPS/age.