| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
| |
cargo, clippy, rustc and rustfmt from the host's nixpkgs, for every user
(so in the remotes' PATH), and what crates' build scripts commonly need:
nixpkgs' wrapped cc and pkg-config, and OpenSSL, with pkg-config finding
the system's .pc files through PKG_CONFIG_PATH. Meant to go below the
layers that change more often, as its image is big and changes rarely.
|
| |
|
|
|
|
|
|
| |
hermes.env (the API key, and the Webapp's sign-in) came from /xchg,
which every VM started in the same directory sees. Now it's a secret
(fc.secrets."hermes.env", /run/secrets/hermes.env), which the run
script requires: --secret hermes.env=FILE. (The module still copies it
into ~/.hermes/.env, onto the home drive.)
|
| |
|
|
|
|
|
| |
The remotes' PATH had only the packages of the service's path, so
fc-egress, claude-remote, and anything else installed system-wide
weren't there. Now /run/current-system/sw comes after them. claude's
own packages stay the service's (packages, that is, not that string).
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
claude-remote list (the default) shows the remotes, static, dynamic,
with a unit loaded, or with a directory, with their kind, state, and
whether they trust their directory yet; inspect NAME shows a remote's
unit, directory, trust, claude.ai session (bridge-pointer.json), and
the last lines of its terminal; start, stop and restart NAME go through
systemctl (a remote started here is dynamic: it lasts until stopped
here), and start points to attach while the remote doesn't trust its
directory; attach [NAME] opens its terminal (it's claude-attach, which
is gone); log NAME shows its journal. Which remotes are static, it
asks systemd (multi-user.target's wants), so changing them doesn't
change it. A package (pkgs/claude-remote.nix), with bash completion of
the commands and the remotes' names.
|
| |
|
|
|
|
| |
Remote Control names the sessions it creates after the host, by
default, which all remotes share. Now it names them after the remote
(CLAUDE_REMOTE_CONTROL_SESSION_NAME_PREFIX), NAME-...
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
A remote started with systemctl start claude-remote-control@NAME, rather
than by multi-user.target's wants, now lasts until systemctl stop, across
reboots: while it's meant to run, it has a file of its name in
/home/.var/lib/claude/remote-control (the claude facet's part of what
would be in /var/lib, which is on the tmpfs, on the home drive; root's),
written when it starts (as root: ExecStartPre=+), and removed when it
stops, but not by a failure (it restarts) nor by a shutdown
(ExecStopPost=+, by SERVICE_RESULT and systemctl is-system-running). At
boot, claude-remote-control-restore starts them again, but for those
that are static by then, whose files it removes instead; static ones
never get one.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
A Remote Control server per directory meant a context per directory of
repositories, so two couldn't work on the same ones. Now
claude-remote-control@NAME is a remote, a context of its own: it works
in ~/remotes/NAME, its project for Claude Code (sessions, memory,
trust), created if need be; and every remote works on the repositories
in ~/src, an additional directory for all of them, by the machine's
managed settings (/etc/claude-code/managed-settings.json, which also
means for any claude here, and that nobody's own settings take it
away). The default remote is main (it was @src), and claude-attach's
default with it.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
claude-remote-control is a template now, claude-remote-control@DIR, one
per directory in ~claude, created if need be (but not ~ itself, nor
anything above it, nor a dot file): @src is the one there was, and
another layer can add more to multi-user.target's wants. Each runs in a
tmux of its own, /run/claude/DIR/tmux, in a runtime directory of its
own: a second tmux new-session in the same server would exit without a
process for systemd to follow (Type=forking), and stopping a unit
removes its runtime directory. claude-attach takes the DIR (default:
src).
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Hermes copies its bundled (and optional) skills out of the store into
~/.hermes/skills with shutil.copytree, which keeps the store's modes,
so the copies were read-only, files and directories: skill_manage
couldn't patch a bundled skill, nor write its temporary files next to
it. Patch the three places that copy a skill (seeding, updating,
restoring) to make the copy writable for its owner afterwards, and
copy the categories' DESCRIPTION.md without its mode.
The manifest's hashes are of paths and contents only, so writable
copies don't count as user-modified, and updates still replace them.
Tested against the pinned source's tools/ with read-only bundled
skills: seeding, an update and a restore leave nothing read-only
(before: 382 paths), and nothing gets reported as user-modified.
Copies made before this stay read-only; chmod -R u+w ~/.hermes/skills
fixes them.
|
| |
|
|
|
|
|
|
|
|
| |
run-firecracker-vm's guests no longer have nix unless they have its
nix layer (layers/nix.nix). Claude builds and tries things with it
(nix-build, nix-shell), so claude asserts that it's there, as in
[ layers/nix.nix configs/claude.nix ], rather than coming up without.
With it, the run script requires --store, as before only for the store
to persist. hermes doesn't need nix: on its own, its store is
read-only.
|
| |
|
|
|
|
|
|
|
| |
claude and hermes each had their own claude-code and unfree predicate.
On top of each other, the predicates don't add up, one replaces the
other, and the claudes could drift apart with the next bump. Now both
import modules/claude-code.nix, which the module system takes only once:
claude-code, as pkgs.claude-code (an overlay), and its unfree predicate.
The package stays the same store path.
|
| |
|
|
|
|
|
| |
RequiresMountsFor only requires home.mount if there is one, which the
fc-home generator only makes with the drive (--home): without it, the
services started anyway, with their state on the tmpfs. Now they
assert that /home is a mount point, and fail otherwise.
|
| |
|
|
|
|
|
|
| |
The guest creates its users anew at every boot (userborn's state is on
the tmpfs), so a user's uid depended on which other users there were:
another layer's user could take claude's 1000, and the files on the
home drive would belong to someone else. claude keeps 1000, which its
files have already; hermes, and its group, get 1001.
|
| |
|
|
|
|
|
|
|
|
| |
hermes was the module's system user, with its home group-writable and
setgid (2770), for the module's hostUsers, which aren't used here: anyone
in the group could read the Claude login and hermes.env's secrets. Now
it's a normal user (still in its group hermes), and its home is 0700:
systemd-tmpfiles takes the first line for a path and ignores the
module's (with a warning), and hermes-agent-setup undoes the module
script's chmod 2770.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Both layers set fc.home.required, so the run script refuses to start
the guest without --home, instead of keeping the state on the tmpfs.
hermes' home (stateDir) moves from the store drive to /home/hermes,
where claude's is, too: the store drive is for the store, which should
be fine to throw away, and the home drive keeps what can't be. Like
claude's, the user's home doesn't get created with the user, as /home
isn't mounted yet then; the module's tmpfiles create it, and hermes'
services require the mount.
To keep the existing state, once, with both drives attached:
mv /nix/.rw-store/hermes /home/hermes
|
| | |
|
| |
|
|
|
| |
Denied by the egress list anyway: http-intake.logs.us5.datadoghq.com and
mcp-proxy.anthropic.com.
|
| |
|
|
|
| |
A Claude Code Remote Control server, on the Claude subscription, running
as claude in a tmux which root opens with claude-attach.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
Root's login shell ran hermes-attach, which starts hermes' tmux, and
root logs in automatically on the console. Root attaches with
hermes-attach when it wants to.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
hermes-tmux.service started at boot and restarted hermes whenever it
quit, and as its RuntimeDirectory, /run/hermes went away whenever it
stopped, so attaching failed with "error creating /run/hermes/tmux".
Now hermes-tmux.socket holds /run/hermes/tmux, and the first client
starts tmux (-D, on systemd's socket), whose config starts hermes in
session hermes. Quitting hermes ends the session, and with exit-empty
the server and the service, until the next client. Detaching doesn't.
Hermes imports provider plugins from copies under
~/.hermes/runtime/provider-plugins, a set per process, reclaimed by
later processes. Copies of the read-only plugin from before couldn't
be removed, and crashes leave theirs: remove them all at boot, before
any Hermes runs.
|
| |
|
|
|
|
|
| |
The gateway formats its stderr log lines with a timestamp of their own,
which journald adds anyway. Patch hermes-agent's source to leave it out
when stderr is the journal (JOURNAL_STREAM is set); the log files in
~/.hermes/logs keep theirs.
|
| |
|
|
|
|
|
|
|
| |
Managed (HERMES_MANAGED, or the module's .managed marker), Hermes
refuses to save config.yaml at all, so /model --global and hermes model
couldn't keep a change; only session-only /model worked. Set
HERMES_MANAGED=false, which wins over the marker, for the gateway, the
tmux and hermes' shells, and make config.yaml writable for hermes. The
settings here still replace their keys in config.yaml at every boot.
|
| |
|
|
|
|
|
|
| |
The gateway serves the Webapp, Hermes Desktop in a browser, on port
9120. Bound to 0.0.0.0, so the host can reach it at the guest's
address, which needs the dashboard's sign-in: username, password (or
its hash) and a token-signing secret, as HERMES_DASHBOARD_BASIC_AUTH_*
in hermes.env in the host's xchg, merged into ~/.hermes/.env at boot.
|
| |
|
|
|
| |
The classic CLI takes every Enter on the console as a newline, so there
was no way to send; the TUI (hermes --tui) sends.
|
| |
|
|
|
|
|
| |
2.1.329 isn't in nixpkgs master's manifest yet. npm's platform package
@anthropic-ai/claude-code-linux-x64 has the release's plain binary, and
the registry gives its integrity hash, so take it from there: no zstd,
and no checksum to copy from elsewhere.
|
| |
|
|
|
|
|
|
|
| |
The plugin's requests failed: "Claude Code 2.1.223 does not support this
model; version 2.1.280 or newer is required". nixos-26.05 has 2.1.223.
Override its claude-code with 2.1.328, version and checksum from
nixpkgs master's manifest. Release binaries are zstd-compressed now,
which 26.05's installPhase doesn't expect, so decompress them first.
x86_64-linux only, like the checksum.
|
| |
|
|
|
|
| |
The sources of hermes-agent, its flake inputs and the provider plugin
now come from fixed-output derivations. Their store paths are the same
as before, as name and hash are.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
Root's login shell attaches to hermes' tmux, and detaching gives the
shell back, but getting into the tmux again took tmux with the right
socket. hermes-attach does that, and the login shell uses it, too.
|
| |
|
|
|
| |
So hermes is on the PATH of hermes' shells, like the ones in new windows
of the tmux, and not only of the units.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Replace the anthropic provider, with its API key from /xchg, by the
Claude Subscription DirectSDK plugin from hermes-official-plugins. It
runs each turn through the claude CLI, from nixpkgs' claude-code, and
has no credentials of its own: log in once with claude auth login as
hermes, e.g. in a new window of the tmux. The login goes to ~/.claude,
i.e. into stateDir, so it lasts as long as the rest of the state.
The plugin needs Hermes 0.21.4, or main from 118984d7a02f on, which the
pinned revision includes.
|
| |
|
|
|
|
|
|
|
| |
profiles/perlless forbids perl in the system closure, and hermes-agent
brought it in twice: nixpkgs' git (send-email, gitweb & co.), on the
package's runtime PATH and the module's unit PATH, and wl-clipboard,
whose xdg-utils needs perl. Override the package with gitMinimal and
without wl-clipboard, which has no use without Wayland, and replace the
unit's PATH, as the package brings git itself.
|
| |
|
|
|
|
|
| |
hermes-agent patches patchelf for a bug of 0.19 (NixOS/patchelf#674).
nixos-26.05's patchelf is 0.15, which doesn't have that bug, and the
patch fails to apply to it. Make overrideAttrs a no-op on a patchelf
older than 0.19, in the pkgs only hermes-agent's flake sees.
|
| |
|
|
|
|
|
|
|
|
|
| |
nixos-26.05's fetchPnpmDeps calls pnpm.override for a pnpm >= 11, to
rebuild its nodejs-slim with a pinned SQLite. hermes-agent passes its
pinned pnpm 12, a plain attrset carrying nixpkgs' nodejs-slim, which has
no override. Give it one, in the pkgs only hermes-agent's flake sees.
This evaluates, but the build is untested: the pinned SQLite may make
the pnpm deps' fixed-output hash differ from hermes-agent's. With
nixos-unstable the overlay changes no derivation.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
flake-compat evaluates hermes-agent's flake with the nixpkgs locked in
its flake.lock, nixos-unstable. Instead, call the flake and its inputs
directly, with this system's pkgs as nixpkgs, which all of them follow
anyway. The other inputs are still fetched as locked. The NixOS
module is imported from its file, as the flake's nixosModules.default
needs pkgs, which imports can't use.
hermes-agent targets nixos-unstable: with nixos-26.05, evaluation fails
in fetchPnpmDeps, which expects a pnpm it can override.
|
| |
|
|
|
|
|
|
| |
The console is root's again. hermes runs as hermes in a tmux started by
hermes-tmux.service, and root's login shell attaches to it; detaching
gives root's shell back. tmux lets root attach to another user's
server. Quitting hermes ends the session, and systemd starts a new
one.
|
| |
|
|
|
|
|
| |
The console logs in as hermes instead of root, and the hermes CLI goes
into that user's packages instead of the system's. The user's home is
the service's stateDir, so the CLI finds the service's state at
~/.hermes without HERMES_HOME set system-wide.
|
|
|
Hermes Agent from its own NixOS module, imported through flake-compat,
with what this guest needs on top:
- nixos-init doesn't run activation scripts, so the module's setup runs
as hermes-agent-setup.service before the gateway
- state lives on the rw-store drive, as /var is a tmpfs
- the hermes user doesn't linger, as users.manageLingering is off
(hermes' cron needs a user manager; nothing else does)
The API key comes from /xchg/hermes.env.
|