summaryrefslogtreecommitdiffstats
path: root/configs
diff options
context:
space:
mode:
Diffstat (limited to 'configs')
-rw-r--r--configs/hermes.nix27
1 files changed, 19 insertions, 8 deletions
diff --git a/configs/hermes.nix b/configs/hermes.nix
index 66b1094..395414e 100644
--- a/configs/hermes.nix
+++ b/configs/hermes.nix
@@ -1,6 +1,7 @@
# Hermes Agent (Nous Research), with its own NixOS module, fitted to this
-# guest. Put ANTHROPIC_API_KEY=... into hermes.env in /xchg on the host.
-# hermes runs as hermes in a tmux, which root's console opens.
+# guest. hermes runs as hermes in a tmux, which root's console opens. It
+# uses the Claude subscription through the claude CLI: log in once with
+# claude auth login, in a new window there (C-b c).
{ config, lib, pkgs, ... }:
let
tmux = "${pkgs.tmux}/bin/tmux -S /run/hermes/tmux";
@@ -72,12 +73,21 @@ in
# like nix's database, see /nix/var.
stateDir = "/nix/.rw-store/hermes";
settings.model = {
- provider = "anthropic";
- default = "claude-opus-5-5";
+ provider = "claude-subscription-directsdk-experimental";
+ default = "opus";
};
- # Read at boot; a missing file only gets a warning.
- environmentFiles = [ "/xchg/hermes.env" ];
+ 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 ];
};
+ nixpkgs.config.allowUnfreePredicate = pkg: lib.getName pkg == "claude-code";
# hermes' home is stateDir, so this uses the service's state at ~/.hermes.
# tmux lets root attach to it. Quitting hermes ends the session, and
@@ -94,6 +104,7 @@ in
ExecStart = "${tmux} new-session -d -s hermes ${lib.getExe config.services.hermes-agent.package}";
Restart = "always";
};
+ inherit (config.systemd.services.hermes-agent) path;
};
# Detaching gets root's shell back.
programs.bash.loginShellInit = ''
@@ -101,11 +112,11 @@ in
'';
# The module adds pkgs.git, which needs perl; the package has gitMinimal.
- systemd.services.hermes-agent.path = lib.mkForce [
+ systemd.services.hermes-agent.path = lib.mkForce ([
config.services.hermes-agent.package
pkgs.bash
pkgs.coreutils
- ];
+ ] ++ config.services.hermes-agent.extraPackages);
# nixos-init doesn't run activation scripts, and that's where the module
# creates the state and installs config.yaml and .env.