feat: add authFile option + sops-nix documentation

- authFile option for declarative OAuth token management
- sops-nix integration examples in README
- Plain file secrets example in README
This commit is contained in:
Ciphercat 2026-03-16 00:36:12 +00:00
commit 5930ea925d
2 changed files with 65 additions and 0 deletions

View file

@ -162,6 +162,16 @@ in
'';
};
authFile = mkOption {
type = types.nullOr types.path;
default = null;
description = ''
Path to an auth.json file containing OAuth credentials (Nous Portal, Codex, Anthropic OAuth).
Use with sops-nix to manage OAuth tokens declaratively.
If null, auth.json is managed at runtime via `hermes model`.
'';
};
# ── Documents (SOUL.md, AGENTS.md, etc.) ─────────────────────────────
documents = mkOption {
type = types.attrsOf (types.either types.str types.path);
@ -272,6 +282,11 @@ in
# Link config file
install -o ${cfg.user} -g ${cfg.group} -m 0640 -D ${configFile} ${cfg.stateDir}/.hermes/cli-config.yaml
# Link auth file if provided
${lib.optionalString (cfg.authFile != null) ''
install -o ${cfg.user} -g ${cfg.group} -m 0600 ${cfg.authFile} ${cfg.stateDir}/.hermes/auth.json
''}
# Link documents into workspace
${lib.concatStringsSep "\n" (lib.mapAttrsToList (name: _value: ''
install -o ${cfg.user} -g ${cfg.group} -m 0644 ${documentDerivation}/${name} ${cfg.workingDirectory}/${name}