docs: add example of how to add secrets
Some checks failed
Flake checker / Build Nix targets (push) Has been cancelled

This commit is contained in:
2026-02-02 04:42:32 +05:30
parent 23b5917620
commit dd322cb71c
3 changed files with 25 additions and 3 deletions

View File

@@ -276,7 +276,19 @@ sessionVariables = {
- Secrets are managed with SOPS (Secrets OPerationS)
- Encrypted secrets in `secrets/` directory
- Configuration in `.sops.yaml`
- Access secrets via `config.sops.secrets."path/to/secret".path`
- Access secrets via `config.sops.secrets."secret/value".path` which corresponds to following in yaml.
```yaml
foo:
bar: somesecret
```
The path is the file that contains `somesecret`
- Add new secrets using `sops set`
Example
```bash
openssl rand -hex 32 | tr -d '\n' | jq -sR | sops set --value-stdin secrets/secrets.yaml '["foo"]["bar"]'
```
This will add a randomly generated secret to the sops file
## Common Patterns