Secrets
Secrets
Encrypted secrets management with SOPS and AGE
Stackpanel stores secrets in SOPS-encrypted YAML files under .stack/secrets/. The active model is SOPS-first:
- recipients are declared in Nix
- recipient groups are reusable named sets of recipients
- creation rules render directly into
.stack/secrets/.sops.yaml - app and variable values can point directly at secrets with
ref+sops://...#/KEY
Getting Started
- Enter the devshell with
nix develop --impure. - Add your public key in
stackpanel.secrets.recipientsorstackpanel.users. - Configure
stackpanel.secrets.sops-age-keys.sourcessosops-age-keyscan return a private key whose public key matches one configured recipient. - Add at least one
stackpanel.secrets.creation-rulesentry, or configure one in Studio under Variables → SOPS. - Store secret values in
.stack/secrets/**/*.sops.yamland reference them directly withref+sops://...#/KEY.
How It Works
- Stackpanel generates a local AGE key for you on shell entry.
- Recipient public keys live in Nix config.
sops-age-keyscan resolve keys from ordered sources such as user paths, repo paths, macOS Keychain, 1Password refs, vals refs, and scripts..stack/secrets/.sops.yamlis generated from recipients, recipient groups, and creation rules.- SOPS encrypts matching files directly to the resolved recipients from the first matching rule, with a catch-all fallback when needed.
- When recipient keys change, an existing recipient runs
.stack/secrets/bin/rekey.shand commits the updated SOPS files.
Common Commands
| Command | Description |
|---|---|
secrets:set KEY --group GROUP --value VALUE | Legacy helper for grouped vars files |
secrets:get KEY --group GROUP | Legacy helper for grouped vars files |
secrets:list [GROUP] | Legacy helper for grouped vars files |
secrets:load GROUP [--format dotenv|json|yaml] | Legacy helper for grouped vars files |
Team Workflow
- A teammate adds their public key in Nix config.
- They commit the updated config and generated
.stack/secrets/.sops.yaml. - Someone who already has access runs
.stack/secrets/bin/rekey.sh. - The updated
.sops.yamland SOPS files are committed and shared.