diff options
| author | tv <tv@krebsco.de> | 2026-11-20 01:43:51 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-20 02:58:16 +0100 |
| commit | e13ab7360cb42a543480cc45afae3b155b81b03e (patch) | |
| tree | fa97c0138fb18cbedfac32bb9940935fb8f7e642 | |
| parent | 7878d9eaa173adec4a586c6e0fd71d8058abdf3e (diff) | |
configs/hermes: use hermes on the console as hermes, not root
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.
| -rw-r--r-- | configs/hermes.nix | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/configs/hermes.nix b/configs/hermes.nix index cac976d..b963349 100644 --- a/configs/hermes.nix +++ b/configs/hermes.nix @@ -1,7 +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; # run hermes on the console. -{ config, ... }: +{ config, lib, ... }: let # Not a flake input: flake-compat evaluates hermes-agent's flake, with its # flake.lock, using plain nix. Bump rev and sha256 together. @@ -30,10 +30,13 @@ in }; # Read at boot; a missing file only gets a warning. environmentFiles = [ "/xchg/hermes.env" ]; - # hermes on the console shares the service's state. - addToSystemPackages = true; }; + # The console is hermes', not root's. Its home is stateDir, so hermes + # there uses the service's state at ~/.hermes. + services.getty.autologinUser = lib.mkForce "hermes"; + users.users.hermes.packages = [ config.services.hermes-agent.package ]; + # nixos-init doesn't run activation scripts, and that's where the module # creates the state and installs config.yaml and .env. systemd.services.hermes-agent-setup = { |
