diff options
| author | tv <tv@krebsco.de> | 2026-11-20 05:06:29 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-20 06:07:19 +0100 |
| commit | 1df9a8cd39d9613f1e6514fcd77c9d203efce402 (patch) | |
| tree | a2ab68e60214f73c11829daac9f6c9b3733290d3 /configs/hermes.nix | |
| parent | 41e5a1003875c1e43c55b903fa218347e511789c (diff) | |
configs/hermes: install the provider plugin as a writable copy
Hermes knew the plugin (hermes plugins list) but not its provider.
Hermes imports a provider plugin from a snapshot: it copies the plugin
with shutil.copytree, modes included, and renames the copy from a
temporary directory into its place. Moving a directory to another
parent needs write permission on the directory itself, for its "..", so
with extraPlugins' symlink into the store, the copy is read-only, the
rename fails with EACCES for hermes (root could), and Hermes only logs
"Could not stage provider plugin".
Install a writable copy in hermes-agent-setup instead. extraPlugins'
old symlink goes away there, too, as the module removes nix-managed-*
links on each run.
Diffstat (limited to 'configs/hermes.nix')
| -rw-r--r-- | configs/hermes.nix | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/configs/hermes.nix b/configs/hermes.nix index c1a6cb6..ea50dbd 100644 --- a/configs/hermes.nix +++ b/configs/hermes.nix @@ -5,6 +5,14 @@ { config, lib, pkgs, ... }: let tmux = "${pkgs.tmux}/bin/tmux -S /run/hermes/tmux"; + # The provider plugin, installed by hermes-agent-setup, see there. + claude-subscription-directsdk = pkgs.runCommand "claude-subscription-directsdk" { } '' + cp -r ${builtins.fetchTarball { + url = "https://github.com/NousResearch/hermes-official-plugins/archive/80025332933bf84fb3c7b68f369d9fe59a771e98.tar.gz"; + sha256 = "1ivgwfqnhgpwsp204ljsm4jwcq00n8zs4pd5dgyx0crb3hdig3bq"; + }}/claude-subscription-directsdk $out + ''; + # Root's way (back) into hermes' tmux. hermes-attach = pkgs.writeShellScriptBin "hermes-attach" '' exec ${tmux} attach -t hermes @@ -80,14 +88,6 @@ in provider = "claude-subscription-directsdk-experimental"; default = "opus"; }; - extraPlugins = [ - (pkgs.runCommand "claude-subscription-directsdk" { } '' - cp -r ${builtins.fetchTarball { - url = "https://github.com/NousResearch/hermes-official-plugins/archive/80025332933bf84fb3c7b68f369d9fe59a771e98.tar.gz"; - sha256 = "1ivgwfqnhgpwsp204ljsm4jwcq00n8zs4pd5dgyx0crb3hdig3bq"; - }}/claude-subscription-directsdk $out - '') - ]; # The login is in ~/.claude, i.e. in stateDir. extraPackages = [ pkgs.claude-code ]; }; @@ -132,7 +132,18 @@ in before = [ "hermes-agent.service" ]; serviceConfig.Type = "oneshot"; serviceConfig.RemainAfterExit = true; - script = config.system.activationScripts.hermes-agent-setup.text; + script = config.system.activationScripts.hermes-agent-setup.text + '' + + # Not with extraPlugins, which links to the store: Hermes stages a + # provider plugin by copying it, mode included, and renaming the + # copy into another directory, which needs a writable directory to + # update its "..", and fails as hermes with the store's read-only + # one. So a writable copy instead. + p=${config.services.hermes-agent.stateDir}/.hermes/plugins/claude-subscription-directsdk + rm -rf "$p" + cp -r --no-preserve=mode ${claude-subscription-directsdk} "$p" + chown -R hermes:hermes "$p" + ''; }; # users.manageLingering is off here. Without a user manager, hermes' |
