diff --git a/nix/modules/hive-ci.nix b/nix/modules/hive-ci.nix index 66d8e510..188b960c 100644 --- a/nix/modules/hive-ci.nix +++ b/nix/modules/hive-ci.nix @@ -268,10 +268,22 @@ in systemd.services."gitea-runner-hive".wants = [ "hive-ci-register.service" ]; # git is required by the runner's checkout step. - # Everything else (nix, rust tools) is either part of NixOS - # by default or pulled in hermetically by nix flake check. + # 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. # curl/jq in the register script use absolute store paths. - environment.systemPackages = [ pkgs.git ]; + 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. + systemd.services."gitea-runner-hive".environment.PATH = + "/run/current-system/sw/bin:/nix/var/nix/profiles/default/bin:/usr/bin:/bin"; }; }; };