From 181535650b5c0d81ad31ef0f557e58d049c1b28a Mon Sep 17 00:00:00 2001 From: atlas Date: Wed, 3 Jun 2026 21:25:05 +0200 Subject: [PATCH] fix(#1199): add nix to hive-ci PATH for runner job execution The gitea-actions-runner's host-scheme job processes use the service's environment PATH, not the NixOS login-shell PATH. Without this, 'nix flake check' and similar steps fail with 'nix: command not found'. - add pkgs.nix to environment.systemPackages (ensures the binary is in /run/current-system/sw/bin) - set explicit PATH on gitea-runner-hive service covering both /run/current-system/sw/bin and /nix/var/nix/profiles/default/bin --- nix/modules/hive-ci.nix | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) 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"; }; }; };