Secrets

Secrets are stored in conf/secrets/owais.yaml and encrypted with SOPS. NixOS hosts decrypt them with SOPS-Nix; non-NixOS machines can extract selected files with the helper script.

Active Secrets

SecretNixOS pathUsed by
keys_gh/run/secrets/keys_ghGitHub SSH
keys_codeberg/run/secrets/keys_codebergCodeberg SSH
keys_tangled/run/secrets/keys_tangledTangled and Knot SSH
umans_key/run/secrets/umans_keyClaude Code Umans API

Files are owned by owais:users with mode 0600.

NixOS Model

PieceRole
conf/secrets/owais.yamlEncrypted secret values.
.sops.yamlRecipient and file encryption policy.
/var/lib/sops-nix/key.txtAge key used by NixOS during activation.
conf/shared.nixDeclares which secrets should appear under /run/secrets.

SSH and Claude Code reference /run/secrets paths directly.

Local Editing

Use the local age key when editing from the repo:

SOPS_AGE_KEY_FILE=$(pwd)/age.txt nix shell nixpkgs#sops -c sops conf/secrets/owais.yaml

Validate decryptability without printing values:

SOPS_AGE_KEY_FILE=$(pwd)/age.txt nix shell nixpkgs#sops -c sops -d conf/secrets/owais.yaml >/dev/null

Update recipients after changing .sops.yaml:

nix shell nixpkgs#sops -c sops updatekeys conf/secrets/owais.yaml

Non-NixOS Extraction

conf/scripts/keys.sh extracts Git SSH keys for machines that do not use SOPS-Nix.

Expected inputOutput
~/.config/sops/age/keys.txtLocal age key
conf/secrets/owais.yamlEncrypted source
~/.local/share/sops/keys_ghGitHub key
~/.local/share/sops/keys_codebergCodeberg key
~/.local/share/sops/keys_tangledTangled key

Run:

mkdir -p ~/.config/sops/age
cp age.txt ~/.config/sops/age/keys.txt
./conf/scripts/keys.sh

The script sets key file permissions to 0600.

Common Failure Modes

SymptomLikely cause
SOPS cannot decrypt locallySOPS_AGE_KEY_FILE points at the wrong key.
NixOS rebuild cannot decrypt/var/lib/sops-nix/key.txt is missing or wrong.
SSH ignores a keyFile permissions or IdentityFile path are wrong.
Claude Code cannot authenticate/run/secrets/umans_key is missing after rebuild.