summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-20 20:13:01 +0000
committertv <tv@krebsco.de>2026-11-20 21:38:49 +0100
commitca65927a2497dc9fab6f90327622c6124b18a627 (patch)
tree1d0a4f00c36f102c2b2af1500277630722ae8297
parentf284a60c9d6efedf659bcc940dc0daf119b54944 (diff)
configs/hermes: the Claude API by default, the subscription selectable
Using the Claude subscription from Hermes, even through the official claude CLI, is at best a gray area of Anthropic's terms, while an API key from the Console organization linked to the subscription is what they provide for, and the plan's monthly API credits cover it. So the default is now Hermes' own anthropic provider with Claude Opus 5.5, and ANTHROPIC_API_KEY from hermes.env in the host's xchg, which the setup merges into ~/.hermes/.env already. The subscription plugin stays installed, selectable with /model or hermes model. Without an API key, the anthropic provider would borrow the claude.ai login in ~/.claude and send it passing itself off as Claude Code. That login is claude's, for the plugin, so turn the borrowing off (auth.adopt_external_logins); claude reads it itself, so the plugin keeps working.
-rw-r--r--configs/hermes.nix16
1 files changed, 13 insertions, 3 deletions
diff --git a/configs/hermes.nix b/configs/hermes.nix
index 6000e06..b0f5570 100644
--- a/configs/hermes.nix
+++ b/configs/hermes.nix
@@ -1,6 +1,9 @@
# Hermes Agent (Nous Research), with its own NixOS module, fitted to this
# guest. hermes runs as hermes in a tmux, which root opens with
-# hermes-attach. It uses the Claude subscription through the claude CLI:
+# hermes-attach. Two ways to Claude, selectable with /model or hermes
+# model: the Claude API (provider anthropic, the default), with the API key
+# from the host's xchg (see environmentFiles), and the Claude subscription
+# through the claude CLI (provider claude-subscription-directsdk-experimental):
# log in once with claude auth login, in a new window there (C-b c).
{ config, lib, pkgs, hostPkgs, ... }:
let
@@ -115,10 +118,17 @@ in
# /var is a tmpfs. This is on the only drive that can outlive a boot,
# like nix's database, see /nix/var.
stateDir = "/nix/.rw-store/hermes";
+ # The anthropic provider uses ANTHROPIC_API_KEY from hermes.env, see below.
+ # Don't put ANTHROPIC_TOKEN or CLAUDE_CODE_OAUTH_TOKEN otherwise hermes
+ # disguises itself as claude code.
settings.model = {
- provider = "claude-subscription-directsdk-experimental";
- default = "opus";
+ provider = "anthropic";
+ default = "claude-opus-5-5";
};
+ # Prevent anthropic provider from using ~/.claude/.credentials.json
+ # claude-subscription-directsdk-experimental is unaffected as it's going
+ # via the claude CLI.
+ settings.auth.adopt_external_logins = false;
# The Webapp (Hermes Desktop in a browser), served by the gateway, for
# the host at http://GUEST:9120. Off loopback, it needs a sign-in:
# put HERMES_DASHBOARD_BASIC_AUTH_USERNAME, ..._PASSWORD (or