From 1bdd70fc4d45ad832c3acaf3ff370e9e9d43800f Mon Sep 17 00:00:00 2001 From: Erik Simon Date: Sun, 20 Sep 2026 17:28:27 +0200 Subject: [PATCH] feat(mars): provision luna's ElevenLabs API key via sops MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ELEVENLABS_API_KEY is the only env override ElevenLabs takes; provider, voice_id and model_id are config.yaml-only. Seeds tts.provider through the existing prepare-dirs yq merge so it defaults to elevenlabs without pinning it — KittenTTS stays provisioned as the offline fallback. Needs elevenlabs_api_key in secrets/mars.yaml before the next deploy, or sops-nix fails activation on the missing key. Co-Authored-By: Claude Opus 5 --- hosts/mars/hermes-agent.nix | 6 +++++- hosts/mars/secrets.nix | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/hosts/mars/hermes-agent.nix b/hosts/mars/hermes-agent.nix index 8012f70..fe489f9 100644 --- a/hosts/mars/hermes-agent.nix +++ b/hosts/mars/hermes-agent.nix @@ -256,7 +256,11 @@ in # only this key is merged in; without it the Secure cookie flag breaks. conf=${hermesHome}/config.yaml [ -e "$conf" ] || : > "$conf" - yq '.dashboard.trusted_proxies = ["${neptunTailnetIp}"]' "$conf" > "$conf.new" + # tts.provider is seeded, not pinned: `=` would stomp luna's own choice on + # every restart, and the engine is hers to change (KittenTTS stays as the + # offline fallback). `//` only fills it in when unset. + yq '.dashboard.trusted_proxies = ["${neptunTailnetIp}"] + | .tts.provider = (.tts.provider // "elevenlabs")' "$conf" > "$conf.new" chown ${hermesUid}:${hermesGid} "$conf.new" chmod --reference="$conf" "$conf.new" mv -f "$conf.new" "$conf" diff --git a/hosts/mars/secrets.nix b/hosts/mars/secrets.nix index 4f86df0..d3f1869 100644 --- a/hosts/mars/secrets.nix +++ b/hosts/mars/secrets.nix @@ -28,6 +28,9 @@ sops.secrets.opencode_go_api_key = { }; sops.secrets.telegram_bot_token = { }; sops.secrets.hermes_dashboard_oidc_client_secret = { }; + # ElevenLabs TTS/STT. Unlike the webhook secret this must live in the + # container env — luna calls the API herself. + sops.secrets.elevenlabs_api_key = { }; # Same value as secrets/jupiter.yaml (the sending side), stored WITHOUT a # trailing newline — a stray newline would change the HMAC key and fail # every delivery. Written host-side by hermes-agent-webhook-routes, so it @@ -43,6 +46,7 @@ WEBHOOK_ENABLED=true WEBHOOK_PORT=8644 HERMES_DASHBOARD_OIDC_CLIENT_SECRET=${config.sops.placeholder.hermes_dashboard_oidc_client_secret} + ELEVENLABS_API_KEY=${config.sops.placeholder.elevenlabs_api_key} ''; # luna's gitea push token (services/dev/gitea.nix provisions the account +