github-runner: Allow configuring the package to use (#134661)

This addresses #120263 in part, by allowing users to override the
github-runner derivation that is bound to turn non-functional via the
self-update mechanism. (And it'll allow using a buildFHSUserEnv-based
derivation, if someone ends up building that!)

authored by

Andreas Fuchs and committed by
GitHub
15d14ad1 da497034

+10 -2
+10 -2
nixos/modules/services/continuous-integration/github-runner.nix
··· 98 98 ''; 99 99 default = [ ]; 100 100 }; 101 + 102 + package = mkOption { 103 + type = types.package; 104 + description = '' 105 + Which github-runner derivation to use. 106 + ''; 107 + default = pkgs.github-runner; 108 + }; 101 109 }; 102 110 103 111 config = mkIf cfg.enable { ··· 131 139 ] ++ cfg.extraPackages; 132 140 133 141 serviceConfig = rec { 134 - ExecStart = "${pkgs.github-runner}/bin/runsvc.sh"; 142 + ExecStart = "${cfg.package}/bin/runsvc.sh"; 135 143 136 144 # Does the following, sequentially: 137 145 # - Copy the current and the previous `tokenFile` to the $RUNTIME_DIRECTORY ··· 208 216 if [[ -z "$empty" ]]; then 209 217 echo "Configuring GitHub Actions Runner" 210 218 token=$(< "$RUNTIME_DIRECTORY"/${newConfigTokenFilename}) 211 - RUNNER_ROOT="$STATE_DIRECTORY" ${pkgs.github-runner}/bin/config.sh \ 219 + RUNNER_ROOT="$STATE_DIRECTORY" ${cfg.package}/bin/config.sh \ 212 220 --unattended \ 213 221 --work "$RUNTIME_DIRECTORY" \ 214 222 --url ${escapeShellArg cfg.url} \