CLD panel next to luna showing the 5-hour and weekly usage windows (plus
any per-model weekly caps), polled every 5 min via a new `claude-usage`
script that reuses Claude Code's OAuth login and refreshes it when expired.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pihole v6 made dns.domain an object and silently ignores a bare
FTLCONF_dns_domain, so every lease resolved as <host>.lan and names like
mars.sol (luna's apps) did not resolve at all. Set dns.domain.name.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- TTS defaults to eleven_v3_conversational over the Text to Dialogue
socket: performs audio tags and gets her German right. Flash still
works via the TTS socket.
- Every spoken message is prefixed with a [voice] marker so luna's
profile on mars can tell the channel apart.
- LunaIndicator/LunaCall replaced by a LunaPanel in the bar rail, with
captions; headless test updated to match.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gitea-mcp in HTTP mode on :8093, reachable only over tailscale0. It
holds no token; each client sends its own PAT as a Bearer header.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Three that each cost a debugging round, and none of which looks like its
cause: terra's mic levels (every default threshold was above the user's
speech), the noise floor chasing a rising sound, and `try_recv()` popping
a command that an `if let Ok(Cancel)` then throws away — which is why
SUPER+V during her reply did nothing at all.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Top-left under the rail: whether the mic is open, whether she is
thinking, and whether she is talking — the states a 5s reply makes you
want to see. No avatar yet; the meter is a placeholder for it, and the
states and their colours are the part that has to read correctly first.
LunaIndicator is Item-rooted so render.sh can shoot all five states
offscreen (tests/LunaIndicatorHeadless.qml); LunaCall is the thin
PanelWindow. Beside the notification stack rather than among the modals:
it never takes the keyboard and raises no scrim, so it is deliberately
absent from `modalOpen`.
LunaState is read-only — the toggle runs the CLI — and treats a missing
socket as normal, since the daemon is a user service that may start after
the shell or not be installed at all.
Two things measurement decided rather than reasoning. ExclusionMode
.Ignore put it OVER the bar (it ignores other surfaces' zones, not just
its own), and switching to Normal was not enough either: the rail's
exclusive zone still left it at y=8 against a bar occupying 0..147. So
the shell passes bar.contentHeight down, the same value the backdrop
already reads. And the card is one chamfered path rather than a
rectangle with a triangle over its corner, which left the square border
showing underneath and read as an artifact.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The key is a toggle rather than push-to-talk, because "voice mode is
active" has to be a state something can display; a held key cannot
sustain one. So the daemon grew a VAD loop: speech starts a capture,
`silenceMs` of quiet ends it. A turn is awaited inline, which is also
what stops her hearing herself — the tick cannot fire while she speaks.
The keybind runs the CLI, not a quickshell GlobalShortcut, so the mic can
still be switched off while the shell is reloading and a QML error can
never leave it open with nothing on screen saying so.
Every threshold had to be resized for terra's mic, which is QUIET:
0.001-0.002 ambient against 0.0045 speaking, about 6dB apart. The VAD
floor of 0.006 and whisper's own 0.015 gate both sat ABOVE the user's
voice, and a 3.5x multiplier cannot separate signals that close — three
independent reasons nothing could ever trigger. Hence vadMult 1.8,
vadFloor 0.0025, and stt::normalize lifting the clip (capped at 30x, so
near-silence is not amplified into words) before whisper sees it.
The floor tracker also had to stop feeding on everything: a rising sound
dragged its own threshold up faster than it rose, and a tone peaking at
0.029 was outrun by a threshold that reached 0.018. Only samples below
the current trigger update it now.
Four diagnostics, because none of the above was visible while it was
failing: `watch` prints the socket protocol, `say` runs a turn from typed
text (a broken mic vs a broken pipeline), `level` is a live meter with
the trigger marked, `devices` lists the inputs. Amplitude is now emitted
on every tick, not only while she speaks — a meter that moves only during
playback cannot answer "is it hearing me".
Also: connect-time replay of mode/state, so restarting the shell while
voice mode is on does not leave it blind until the next event, which in
an idle conversation is never.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
luna-voiced: mic -> whisper-cpp (local, vulkan) -> Hermes' API on mars ->
ElevenLabs streaming TTS -> speaker, bound to SUPER+V. State, amplitude
and a viseme timeline are published on a unix socket; nothing consumes
that yet, but it is the data source the quickshell avatar will read.
STT stays local on purpose. mars already runs faster-whisper for Telegram
voice notes, but routing the mic through it would put every spoken word
on the network for no latency win.
Shape notes, all of them things the first live runs decided:
- Viseme offsets are relative to speech_start (emitted when the first
PCM frame reaches the speaker), never wall clock, so the shell and
the daemon never have to compare clocks. ElevenLabs sends character
alignment, not visemes, so the mapping is ours; the glTF morph target
names are the contract.
- clean_for_speech is a whitelist. She writes "(¬‿¬)", whose characters
live in Latin-1 and punctuation blocks rather than any emoji range,
so enumerating what to drop never converges. Em dashes become commas
because they are a pause — dropping one ran two clauses together and
changed what a sentence meant.
- whisper invents words out of silence ("you", "Thank you."), and a
held key over a quiet room is long AND empty, so has_speech gates on
the loudest 100ms window rather than on duration.
- Beeps on key down/up and a distinct low tone for "heard nothing":
push-to-talk with no acknowledgement is indistinguishable from broken,
and a dead mic must not feel like a slow reply.
- A warmup request at startup: her first reply after the container
starts costs ~16s against ~5s warm, and the first one is always the
one you are waiting for.
- `luna-voice watch` prints the socket protocol and `luna-voice say`
runs a turn from typed text, which is how a broken mic is told apart
from a broken pipeline.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
API_SERVER_ENABLED/HOST/PORT in the env template, bound 0.0.0.0 for the
same reason the dashboard is: the container is --network=host and nothing
opens 8642 in the firewall, so it is reachable over tailscale0 only.
API_SERVER_KEY has to go through .env like the ElevenLabs key did
(461d6cc). Confirmed the same way: with the key set only in the container
env the server came up — so API_SERVER_ENABLED/HOST *did* pass through —
but answered every bearer token with "Invalid gateway API key". The s6
passthrough list carries the plain API_SERVER_* vars and drops the secret
one. The .env write is now a write_env_key helper so both keys share it.
restartUnits gains prepare-dirs, which is what writes the .env line; the
container then has to come back up to read it.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
hermes_api_server_key is the bearer token for Hermes' OpenAI-compatible
API server, generated once and stored in both vaults: mars serves it,
terra is its only client.
elevenlabs_api_key is mirrored into terra for the same reason — terra
calls ElevenLabs directly (the client-direct path Hermes documents)
rather than relaying audio through mars, so both hosts need the value
and a rotation touches two files.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
prepare-dirs is an inactive oneshot and switch-to-configuration only
restarts active units, so the .env delivery added in 461d6cc deployed
cleanly and then did nothing — the container kept running with the old
script until something else restarted it.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The image's s6 init hands the gateway a fixed set of container env vars;
ELEVENLABS_API_KEY is not one of them, so --env-file alone left
text_to_speech reporting it unset even though the var was in the
container config and the resolver read os.environ fine.
prepare-dirs now merges the single line into ${hermesHome}/.env
(HERMES_HOME=/opt/data), as uid 986 so root never writes into hermesHome,
with the key on an fd opened as root so it stays out of argv and the journal.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
podman reads --env-file only at container creation, so re-rendering
hermes-agent.env left the running container on its old environment and
TTS kept reporting ELEVENLABS_API_KEY not set after the key landed.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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 <noreply@anthropic.com>
origin/master gained PRs #7/#8 on a base that never received the three
local commits, so it still carried FORWARDED_ALLOW_IPS="*" and lacked
jupiter-reachable.service.
Conflict in hosts/mars/hermes-agent.nix resolved by keeping this side's
narrower dashboard trust (trusted_proxies + HERMES_DASHBOARD_PUBLIC_URL,
fec8d7c) and dropping the wildcard it replaced, while keeping both
KittenTTS env vars and PR #8's PYTHONPATH.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Telegram voice-note transcription on mars, no cloud: faster-whisper 1.2.1
(ctranslate2 CPU) installed into the SAME kittentts side-venv via
stt-requirements.txt (appended by the provisioning unit; input stamp
extended). Second auto-patchelf pass RPATHs the newly installed
ctranslate2/av binaries. Container env gains
PYTHONPATH=/opt/data/kittentts-venv/... so hermes's local-stt provider
imports faster-whisper in-process (the image venv is read-only for uid
986, so the built-in lazy installer cannot work there).
Validated live: Telegram voice note transcribed on CPU (i5-4460,
lang=en, text exact) with the same pins.
The venv's python is Nix python313 (also inside the container, via the
/nix/store mount), whose loader never searches /usr/lib, so PyPI manylinux
wheels failed with "libstdc++.so.6: cannot open shared object file".
auto-patchelf the staged venv against gcc-lib + zlib; RPATHs are store
paths, so the delivered copy works in the container too. The lib paths join
the input hash so a toolchain bump rebuilds.
Verified locally with mars's exact uv/python313: construct offline from the
staged hub layout and synthesize with voice "Luna".
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
uv reads the version from the wheel filename, and the fetchurl store path's
hash prefix made it reject the file ("invalid version"). Expose it via a
linkFarm under kittentts-0.8.1-py3-none-any.whl.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
- pkgs.setpriv does not exist (mars failed to eval); setpriv is in util-linux.
- `sh` is not on a unit's PATH; call ${pkgs.runtimeShell} directly.
- Drop `env HOME="$hermesHome"`: unset shell var under `set -u`, and unneeded.
- Staging dir 0700 -> 0755: the uid-986 delivery step could not read it.
- Rebuild the staging venv whenever the stamp misses, else an input bump
delivered the old venv under the new stamp.
- Add diffutils: `cmp` in the fast path was missing, so every boot re-delivered.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1: stageVenv declared with the other path vars before the early-exit
reads it (set -u no longer kills the self-heal path on later boots).
2: delivery is rm+cp as the container uid via setpriv — no mv -Tf
rename-replace on a non-empty directory (that failed every
re-provision); chown -R step gone with it.
3: network-online.target back in after= — this unit CAN download at
boot, so uv must not run pre-network.
4: root never writes into hermesHome at all. refs/main, snapshots and
venv staging happen under root-owned staging; delivery drops to uid 986
via setpriv, rm -rf + cp -a from the staging sources. Symlink-takeover
of refs/install targets and the rm/cp race on the delivered tree are
structurally gone.
Minor: sanity check now constructs KittenTTS against the staged hub
tree, not just imports; fetchurls pinned to the commit sha matching
refs/main; fast-path comment matches behavior (staging venv skips
rebuild on damaged delivery).
Review round 1 fixes:
1+2 (security): build+stamp+uv-cache moved out of hermesHome into a
0700 root-owned staging dir (/var/lib/hermes-kittentts). Root executes
python only from the staging venv after an offline import check;
finished artifacts are copied into hermesHome and the stamp compares
delivered copy vs staging byte-for-byte. No root code path follows
anything the container can write, so no stamp symlink-takeover and no
planted-wheel-in-cache execution.
3: HF snapshot dir is the real commit sha with refs/main written, so
hf_hub_download resolves the seeded cache offline (was 'kitten', never
found).
4: container env pins HF_HOME=/opt/data/kittentts-hf + HF_HUB_OFFLINE=1.
5: stamp keyed on the full input set (requirements+wheel+stub+models),
not requirements alone; deletion of a delivered file drops out of the
fast path and re-provisions cheaply.
6: orders after/requires hermes-agent-prepare-dirs.
tts.provider: kittentts, voice Luna, mini-0.8 model (80M params) per
darman. CPU-only onnxruntime inference — no GPU on mars, validated ~1x
realtime on a weaker dev box. Upstream's misaki[en]+spacy declaration is
deliberately not honored (pulls torch→CUDA, 5.6 GB); a .pth-registered
stub satisfies the dead misaki import, failing loudly if it is ever
actually used. HF model cache pre-seeded from hash-pinned store paths so
HF_HUB_OFFLINE=1 runs with zero boot-time network. Provisioner shaped by
the Mnemosyne review: uv venv --clear, root never executes python from
the venv, ownership to the container uid before anything imports, stamp
checked against venv+model files.
jupiter resolves to its tailnet IP, but network-online.target fires on
the LAN link before tailscaled routes tailscale0. Hermes'
RequiresMountsFor pulls the mount at boot, so it failed with ENETUNREACH
and took prepare-dirs, the Mnemosyne link and the container down with it,
with nothing retrying. The mount now requires a oneshot that polls
jupiter:445 for up to 5 minutes.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Replaces FORWARDED_ALLOW_IPS="*" with dashboard.trusted_proxies pinned to
neptun's tailnet IP (merged into config.yaml by prepare-dirs via yq) and
pins HERMES_DASHBOARD_PUBLIC_URL so the OIDC redirect_uri stays https.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The notification daemon and popup stack now live under
HyprChrome/Widgets/Notifications and are owned by HyprChromeShell, so
popups land on the rail's monitor below its exclusive zone. Replaces
widgets/notifications; NotificationCard renders headless for tests.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
- fetchPypi: sdists are published underscore-named, so the hyphenated
pname 404'd.
- sitePackages is relative; prefix the env path so the unit's -d check
and the symlink point at the store.
- hermes_memory_provider ships in mnemosyne-memory, not mnemosyne-hermes;
move the import check accordingly.
- Drop the unused /opt/data/mnemosyne-env mount, the orphaned
requirements.txt, and trim comments.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Supersedes the venv-based fix attempt in 694317a entirely: replaces the
runtime side-venv with a python3.withPackages derivation
(pkgs/mnemosyne-env.nix: mnemosyne-memory 3.15.1 + mnemosyne-hermes 0.5.0
via fetchPypi, base deps only). Env mounted :ro into the container; the
oneshot only writes the plugins/mnemosyne symlink to the env's
site-packages passthru — a canonical store path valid on both sides. No
runtime fetch, no stamp, no root-executes-luna-writable-code, no
host/container path mismatch, no config.yaml sed.
Mnemosyne isn't bundled with the official image; third-party PyPI plugin.
Built as a side venv + plugin symlink inside hermesHome so it lands
inside HERMES_WRITE_SAFE_ROOT and survives image rebuilds. Pinned
requirements captured from a validated live install.
greetd now runs a throwaway Hyprland hosting dotfiles/quickshell/greeter.qml,
configured per host via homelab.greeter.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
An apostrophe in a condensed comment closed the single-quoted jq program,
so the unit script failed to build.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Flatpak detects the sandbox timezone from /etc/timezone, not the
/etc/localtime symlink NixOS creates by default. Without it every
flatpak app (Telegram included) silently falls back to UTC, showing
message timestamps 2h off from local time.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UJqEmY1y3AYX3JoX4Y6b21
Comments had drifted into multi-paragraph narrative (git commit
lineage, debugging stories, restated code) in several hot spots
(scripts/deploy, hermes-agent.nix, flake.nix, gitea.nix, headscale.nix).
Trim every comment to its load-bearing "why" — gotchas, safety
warnings, and non-obvious rationale survive verbatim in substance,
just tightened to 1-2 sentences; historical narrative and anything
already covered in CLAUDE.md is cut. No code/logic changed.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UJqEmY1y3AYX3JoX4Y6b21
PolkitPanel replaces BarPanel as the dialog's chrome. Deliberately not a
subclass or a fork: most of BarPanel is density machinery — summary slot,
animated height, state pair, transitions — that a modal never uses, and
inheriting it would tie the dialog's look to a component whose real job is the
rail, so every restyle here would have to be justified against the panels up
there. It keeps the shell's silhouette (cut corners with detached accent caps,
the accent rules, the header strip) and drops the rail's tick decoration.
ESC closes the rail. The bar had no keyboard focus at all, so this adds it,
gated by the shell rather than left to the compositor to arbitrate between two
exclusive surfaces — that resolves by stacking and would invert silently the
day the layers change:
grabsKeyboard: shell.expanded && !polkit.prompting
so ESC dismisses the prompt while one is open and closes the rail afterwards.
Verified by instrumenting the handoff: expanded -> true, prompt open -> false,
prompt dismissed -> true, collapsed -> false. Note the rail now takes EXCLUSIVE
keyboard focus while expanded, which is the cost of answering a keypress the
user has not aimed at anything.
The dialog sits a third of the way down rather than centred, panel centre on
the third so it grows symmetrically as the message wraps, floored at a margin
so a tall prompt on a short output cannot be pushed off the top.
Also carries the backdrop tuning: dim 0.75 -> 0.65, gridOpacity 0.15 -> 0.10,
crossOpacity 0.45 -> 0.15, now that the scrim is used by the prompt as well as
the rail.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GAq2kKCLazZmrKvkd3akud
The file said ~/.config/quickshell is a symlink to this repo and that saving a
file hot-reloads the running shell. Both are wrong and cost real debugging
time: hosts/terra/home.nix ships the tree with xdg.configFile."quickshell",
which COPIES it into the store, so the config dir is a read-only symlink into
/nix/store and the running shell watches the frozen copy. Hot reload only
applies to a working-tree instance, which is what `nix develop` + qs-dev is
for.
Also records the trap that follows from it: a new file must be git-added
before it can be deployed at all, because flakes read the git tree and drop
untracked files silently — producing a deployed config that fails to load,
which does not surface until the next restart because the running shell keeps
serving the store path it resolved at launch.
Architecture section was stale independently of that: shell.qml has not
instantiated Bar/BarTop/BarBottom for a while, there are eleven launcher
variants rather than eight, the HyprChrome tree was undocumented, and there
are TWO Theme singletons — a token added to one does not exist in the other.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GAq2kKCLazZmrKvkd3akud
Moves PolkitPrompt from shell.qml into HyprChromeShell. Whether a prompt is
open is shell state by the same rule as the screen and the layer pair: two
surfaces read it.
The prompt no longer carries a backdrop of its own. There is one
ChromeBackdrop per output and a prompt raises them all, so a prompt over an
already-expanded rail reuses the scrim that is there rather than stacking a
second one on it, and a prompt over a collapsed rail expands that same scrim
from its bar-height band to the whole output.
The layer pair now keys off `scrimUp` (expanded OR prompting) rather than off
the density, which keeps bar and backdrop exactly one level apart in every
state. A prompt over a collapsed rail raises both: BACKGROUND sits under
ordinary windows so a scrim there dims nothing, and the bar has to stay one
above the scrim or the shell dims its own chrome. The rail is raised but
stays collapsed — its layer answers to the scrim, its height to `expanded`.
Outputs the rail does not live on get a scrim only while a prompt is up; a
modal that dims one monitor and leaves the others lit does not read as modal.
Expanding the rail still dims only the rail's screen, which is the existing
behaviour and the right one.
The dialog follows Hyprland.focusedMonitor rather than the rail's screen — a
password prompt belongs where the user is looking — matched by name against
Quickshell.screens, falling back to the rail's screen rather than to nothing.
SUPER A is frozen while a prompt is open, and dropped rather than queued, so
the rail does not spring open the moment the dialog goes.
Verified on two monitors via hyprctl layers, both densities, plus the toggle
block with an odd number of presses (two cancel out and prove nothing).
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GAq2kKCLazZmrKvkd3akud