···124124 pkgs.openssh
125125 ];
126126127127+ # Home Assistant (styx, configs/hass) left hermes core for the
128128+ # `homeassistant` catalog plugin: the ha_* tools plus a gateway platform
129129+ # for state-change events. Pinned to the sha plugin-catalog/homeassistant.yaml
130130+ # ships; its only Python dependency, aiohttp, is already in the venv via
131131+ # the "matrix" group. HASS_TOKEN comes from hermes-env.
132132+ #
133133+ # The flake builds hermes as version 0.0.0 (pyproject.toml; no release
134134+ # version is stamped), so the plugin's `requires_hermes: ">=0.21.5"` gate
135135+ # refused to load it. The pinned hermes-agent input already has Home
136136+ # Assistant moved out of core (hermes_cli/left_core_migration.py), so the
137137+ # gate is met in substance; drop it.
138138+ extraPlugins = [
139139+ (pkgs.applyPatches {
140140+ name = "homeassistant";
141141+ src = pkgs.fetchFromGitHub {
142142+ owner = "NousResearch";
143143+ repo = "hermes-homeassistant";
144144+ rev = "ba30cb0cf86c52bdb5cde98974bc062e97966529";
145145+ hash = "sha256-Pg4smvkiVpmcmUola0rziMBfq5V7UjzX8864Dem76pI=";
146146+ };
147147+ postPatch = ''
148148+ sed -i '/^requires_hermes:/d' plugin.yaml
149149+ '';
150150+ })
151151+ ];
152152+ # Non-bundled plugins are opt-in. The module links the plugin as
153153+ # plugins/nix-managed-homeassistant, but the left-core migration only
154154+ # recognizes plugins/homeassistant: without the marker it would see
155155+ # HASS_TOKEN, call the plugin missing, and warn on every start that it
156156+ # cannot fetch it (lazy installs are off in the sealed venv).
157157+ settings.plugins.enabled = [ "homeassistant" ];
158158+ settings._left_core_installed = [ "homeassistant" ];
159159+127160 settings.model = {
128161 # Claude Opus 5.5 on lass's Claude subscription: the anthropic provider
129162 # takes the `claude setup-token` OAuth token (sk-ant-oat…) from
···401434 CALDAV_USER = "hermes";
402435 CALDAV_CALENDAR_URL = "https://cal.lassul.us/lass/calendar/";
403436437437+ # Home Assistant on styx, over retiolum (configs/hass opens 8123 there).
438438+ HASS_URL = "http://styx.r:8123";
439439+404440 # Element makes DMs end-to-end encrypted by default, so the bot must do
405441 # E2EE or it can't read messages. The `matrix` dep group already bundles
406442 # mautrix[encryption] (python-olm); "optional" initializes E2EE when those
···430466 };
431467432468 # Secrets (MATRIX_ACCESS_TOKEN, LLAMA_API_TOKEN, API_SERVER_KEY,
433433- # EMAIL_PASSWORD) come from clan vars below,
469469+ # EMAIL_PASSWORD, HASS_TOKEN) come from clan vars below,
434470 # merged into $HERMES_HOME/.env at activation.
435471 environmentFiles = [
436472 config.clan.core.vars.generators.hermes-env.files."hermes.env".path
···615651 persist = true;
616652 };
617653654654+ # Home Assistant long-lived access token for the homeassistant plugin
655655+ # (HA profile -> Security -> Long-lived access tokens). persist=true so the
656656+ # prompt value is stored once.
657657+ clan.core.vars.generators.hermes-homeassistant.prompts.token = {
658658+ description = "Home Assistant long-lived access token for hermes";
659659+ type = "hidden";
660660+ persist = true;
661661+ };
662662+618663 # Assemble the .env Hermes reads (mirrors the opencrow-env pattern).
619664 clan.core.vars.generators.hermes-env = {
620665 dependencies = [
···624669 "radicale-hermes"
625670 "hermes-anthropic"
626671 "hermes-mail"
672672+ "hermes-homeassistant"
627673 ];
628674 files."hermes.env" = { };
629675 runtimeInputs = [ pkgs.coreutils ];
···635681 CALDAV_PASSWORD=$(cat "$in"/radicale-hermes/password)
636682 ANTHROPIC_TOKEN=$(cat "$in"/hermes-anthropic/oauth-token)
637683 EMAIL_PASSWORD=$(cat "$in"/hermes-mail/password)
684684+ HASS_TOKEN=$(cat "$in"/hermes-homeassistant/token)
638685 EOF
639686 '';
640687 };