From 04d18891019d9a998accbe9b06e4f0b08aec1ded Mon Sep 17 00:00:00 2001 From: Ari Sosnovsky Date: Wed, 16 Sep 2026 10:56:48 -0400 Subject: [PATCH] Fix hermes-install: give the service an actual PATH Confirmed live: "curl: command not found" inside hermes-install, despite curl being in environment.systemPackages. Real NixOS gotcha - systemPackages populates the interactive PATH (/run/current-system/sw/bin via /etc/profile), but systemd services get their own minimal PATH unless the unit is explicitly given one via `path = [...]`. The installer also shells out to git/node/python/gcc internally, so it's not just curl that was unreachable. Factored the package list (previously only in environment.systemPackages) into a shared `hermesInstallDeps` binding, used for both environment.systemPackages and hermes-install's `path`, so there's one list to keep in sync rather than two. set -euo pipefail (from the last fix) meant this failed loudly and retried instead of silently self-marking done - working as intended, just surfacing the next real bug in the chain. Co-Authored-By: Claude Sonnet 5 --- guest/common.nix | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/guest/common.nix b/guest/common.nix index c1acb5d..7e27e0b 100644 --- a/guest/common.nix +++ b/guest/common.nix @@ -26,6 +26,21 @@ let stateDir = "/var/lib/hermes"; useHostCache = cachePublicKey != ""; + + # Shared between environment.systemPackages (the interactive PATH) and + # hermes-install's own `path` (below). environment.systemPackages does NOT + # propagate into systemd services' PATH on its own - a bare `curl` inside + # a systemd script only resolves if the unit is explicitly given a `path`, + # which is what actually failed here (confirmed live: "curl: command not + # found" from inside hermes-install, despite curl being in + # systemPackages). The installer also shells out to git/node/python/gcc + # internally, so the service needs all of this, not just curl. + hermesInstallDeps = with pkgs; [ + git curl jq ripgrep fd tree htop + uv nodejs ffmpeg + direnv nix-direnv nix-output-monitor + gcc gnumake pkg-config python3 xz + ]; in { # Both disks are virtio-blk, including the one this very image boots from @@ -197,6 +212,7 @@ in wants = [ "network-online.target" ]; wantedBy = [ "multi-user.target" ]; unitConfig.ConditionPathExists = "!${stateDir}/.hermes-installed"; + path = hermesInstallDeps; serviceConfig = { Type = "oneshot"; User = "hermes"; @@ -219,14 +235,7 @@ in ]; }; - environment.systemPackages = with pkgs; [ - git curl jq ripgrep fd tree htop - uv nodejs ffmpeg - direnv nix-direnv nix-output-monitor - # Hermes's installer wants these: a C/C++ toolchain for native Node - # modules (node-pty), plus xz for Node tarball extraction. - gcc gnumake pkg-config python3 xz - ]; + environment.systemPackages = hermesInstallDeps; programs.direnv = { enable = true;