feat(mars): switch luna's memory provider to Honcho

- prepare-dirs pins memory.provider = honcho in Hermes's config.yaml and
  merges the local server into honcho.json (workspace/aiPeer luna, user
  peer darman). Only those keys are asserted; Hermes's own additions stay.
- The SDK installs itself into the image's durable lazy-install target
  (/opt/data/lazy-packages), so nothing to package here.
- Hermes starts after Honcho but doesn't require it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-02 18:23:51 +02:00
co-authored by Claude Opus 5.5
parent 99e5260619
commit b2a700571f
2 changed files with 24 additions and 3 deletions
+17 -1
View File
@@ -259,8 +259,10 @@ in
# 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.
# memory.provider IS pinned: switching back is a repo change (honcho.nix).
yq '.dashboard.trusted_proxies = ["${neptunTailnetIp}"]
| .tts.provider = (.tts.provider // "elevenlabs")' "$conf" > "$conf.new"
| .tts.provider = (.tts.provider // "elevenlabs")
| .memory.provider = "honcho"' "$conf" > "$conf.new"
chown ${hermesUid}:${hermesGid} "$conf.new"
chmod --reference="$conf" "$conf.new"
mv -f "$conf.new" "$conf"
@@ -296,6 +298,20 @@ in
# `hermes setup` overrides it — that is how a rotated key kept 401ing.
write_env_key OPENCODE_GO_API_KEY < ${config.sops.secrets.opencode_go_api_key.path}
write_env_key ELEVENLABS_API_KEY < ${config.sops.secrets.elevenlabs_api_key.path}
# Only these keys are asserted; anything Hermes adds to honcho.json stays.
# No apiKey: the plugin uses a placeholder for a loopback base URL.
setpriv --reuid=${hermesUid} --regid=${hermesGid} --clear-groups \
${pkgs.runtimeShell} -c '
set -eu
f=$1
[ -s "$f" ] || echo "{}" > "$f"
${pkgs.jq}/bin/jq ".baseUrl = \"http://127.0.0.1:8000\"
| .hosts.hermes = ((.hosts.hermes // {}) + {
enabled: true, workspace: \"luna\", aiPeer: \"luna\",
peerName: \"darman\", pinUserPeer: true })" "$f" > "$f.new"
mv -f "$f.new" "$f"
' _ ${hermesHome}/honcho.json
write_env_key API_SERVER_KEY < ${config.sops.secrets.hermes_api_server_key.path}
if [ -d ${hermesHome}/.config ]; then
+7 -2
View File
@@ -1,7 +1,7 @@
{ config, pkgs, ... }:
# Honcho memory server for luna (Hermes's memory provider, once switched in
# Hermes's own config). API + deriver from the official image; Postgres and
# Honcho memory server: luna's memory provider (wired up in hermes-agent.nix
# prepare-dirs). API + deriver from the official image; Postgres and
# Ollama (embeddings) run natively. Everything binds loopback only.
let
honchoImage = "ghcr.io/plastic-labs/honcho@sha256:c74955d6dbea6dda42c2dd9dd13dea726fcba36ba5c0b6bae4867f7ed762896d"; # v3.2.2
@@ -125,4 +125,9 @@ in
after = [ "podman-honcho-api.service" ];
requires = [ "podman-honcho-api.service" ];
};
# wants, not requires: Telegram must survive Honcho being down.
systemd.services.podman-hermes-agent = {
after = [ "podman-honcho-api.service" ];
wants = [ "podman-honcho-api.service" ];
};
}