Skip to content

[Bug]: Nix level-1 gateway install generates systemd unit that bypasses Hermes wrapper #48071

Closed

Description

@nikhilmaddirala

Bug Description

The Nix level-1 / profile-style install path documents that after installing the Nix package, the normal CLI workflow should work, including hermes setup and hermes gateway install.

In my Nix-installed environment, hermes gateway install generated a user systemd unit whose ExecStart calls the raw Nix Python interpreter with -m hermes_cli.main. That bypasses the Nix hermes wrapper that adds the packaged site-packages, so the gateway service crash-loops with ModuleNotFoundError: No module named 'hermes_cli'.

Steps to Reproduce

  1. Install Hermes through the Nix package path. In my case this is installed via Home Manager, equivalent in shape to nix profile install github:NousResearch/hermes-agent:

    /etc/profiles/per-user/tyrion/bin/hermes -> /nix/store/1k2fmjkilf7k7s5xkra1bvznp8rbzdbk-hermes-agent-2026.6.5/bin/hermes
    
  2. Run setup and configure Discord/gateway:

    hermes setup
  3. Accept gateway service installation/start.

  4. Inspect the generated service:

    sed -n '1,80p' ~/.config/systemd/user/hermes-gateway.service
    journalctl --user -u hermes-gateway.service -n 20 --no-pager

Expected Behavior

The generated user systemd service should start the same Hermes executable/environment that works interactively. For a Nix package install, that likely means using the installed hermes wrapper, for example:

ExecStart=/etc/profiles/per-user/tyrion/bin/hermes gateway run --replace

or otherwise resolving to the Nix package wrapper:

ExecStart=/nix/store/...-hermes-agent-2026.6.5/bin/hermes gateway run --replace

The service should not bypass the wrapper and invoke bare Python unless it also preserves the package site-packages setup.

Actual Behavior

The generated unit contains:

ExecStart=/nix/store/60m4rxhg2fldqaak400c0lry96ijrzqn-python3-3.13.13/bin/python3.13 -m hermes_cli.main gateway run --replace
WorkingDirectory=/home/tyrion/.hermes
Environment="PATH=/nix/store/q1r7qkrnbhakljr4j228v2yi2874jkl9-nodejs-slim-24.15.0/bin:/home/tyrion/.local/bin:/home/tyrion/.npm-global/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
Environment="VIRTUAL_ENV=/nix/store/1k2fmjkilf7k7s5xkra1bvznp8rbzdbk-hermes-agent-2026.6.5/lib/python3.13/site-packages/venv"
Environment="HERMES_HOME=/home/tyrion/.hermes"

The service repeatedly fails with:

/nix/store/60m4rxhg2fldqaak400c0lry96ijrzqn-python3-3.13.13/bin/python3.13: Error while finding module specification for 'hermes_cli.main' (ModuleNotFoundError: No module named 'hermes_cli')
hermes-gateway.service: Main process exited, code=exited, status=1/FAILURE
hermes-gateway.service: Failed with result 'exit-code'.

Running the interactive CLI itself works:

Hermes Agent v0.16.0 (2026.6.5)
Project: /nix/store/1k2fmjkilf7k7s5xkra1bvznp8rbzdbk-hermes-agent-2026.6.5/lib/python3.13/site-packages
Python: 3.13.13
OpenAI SDK: 2.33.0
Up to date

Environment

  • Hermes Agent: v0.16.0 (2026.6.5)
  • Install shape: Nix package installed into a user profile via Home Manager, equivalent to Nix level-1/profile install rather than the NixOS module
  • OS: Linux / NixOS host
  • Generated service: user systemd unit at ~/.config/systemd/user/hermes-gateway.service

Additional Context

This appears related to the same class of service entrypoint issues reported in #8475, #7976, #9201, and #8519, but this repro is specifically for the documented Nix level-1 workflow where hermes gateway install is expected to work after a Nix package/profile install.

The Nix wrapper at /nix/store/...-hermes-agent-2026.6.5/bin/hermes sets up the packaged Python path before importing hermes_cli.main; the generated systemd unit does not.

Activity

  1. added
    type/bugSomething isn't working
    comp/gatewayGateway runner, session dispatch, delivery
    P1High — major feature broken, no workaround
    on Jun 17, 2026
  2. teknium1 commented on Jun 25, 2026

    @teknium1
    Collaborator

    Nix is no longer supported.

  3. added
    area/install-updateInstaller, updater, packaging, wheels, doctor
    and removed on Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High — major feature broken, no workaroundarea/install-updateInstaller, updater, packaging, wheels, doctorcomp/gatewayGateway runner, session dispatch, deliverytype/bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions