From 4d1ce6f3132f5c840b27342b473964bd33875802 Mon Sep 17 00:00:00 2001 From: atlas Date: Wed, 3 Jun 2026 21:39:16 +0200 Subject: [PATCH] fix: use path= (ExecSearchPath) to add nix to hive-ci runner PATH --- nix/modules/hive-ci.nix | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/nix/modules/hive-ci.nix b/nix/modules/hive-ci.nix index a5be370f..88d42838 100644 --- a/nix/modules/hive-ci.nix +++ b/nix/modules/hive-ci.nix @@ -267,27 +267,21 @@ in systemd.services."gitea-runner-hive".after = [ "hive-ci-register.service" ]; systemd.services."gitea-runner-hive".wants = [ "hive-ci-register.service" ]; - # git is required by the runner's checkout step. + # git is already in the gitea-actions-runner service PATH (the + # nixpkgs module builds it from the package's runtime deps). # nix is required for `nix flake check` / `nix build` workflow - # steps — it's not in the runner's job PATH by default since - # systemd services don't inherit the NixOS login-shell PATH. + # steps — it's not included by the upstream module. + # Use the `path` service attribute (generates ExecSearchPath=) + # to prepend nix's bin dir to PATH without touching the + # environment.PATH the nixpkgs module sets — overriding that + # would lose git, curl, nodejs, and other runner deps. # curl/jq in the register script use absolute store paths. environment.systemPackages = [ pkgs.git pkgs.nix ]; - # Expose /run/current-system/sw/bin (where system packages - # land) and the nix profile bin dir to the runner's job - # execution environment. The gitea-actions-runner host scheme - # spawns job processes with the service's environment; without - # this PATH override, `nix` and `git` aren't visible to steps. - # mkForce is required: the nixpkgs gitea-actions-runner module - # also sets PATH in the service environment, so without an - # explicit priority the evaluator raises a conflicting - # definition error. - systemd.services."gitea-runner-hive".environment.PATH = - lib.mkForce "/run/current-system/sw/bin:/nix/var/nix/profiles/default/bin:/usr/bin:/bin"; + systemd.services."gitea-runner-hive".path = [ pkgs.nix ]; }; }; };