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 ''; 99 default = [ ]; 100 }; 101 }; 102 103 config = mkIf cfg.enable { ··· 131 ] ++ cfg.extraPackages; 132 133 serviceConfig = rec { 134 - ExecStart = "${pkgs.github-runner}/bin/runsvc.sh"; 135 136 # Does the following, sequentially: 137 # - Copy the current and the previous `tokenFile` to the $RUNTIME_DIRECTORY ··· 208 if [[ -z "$empty" ]]; then 209 echo "Configuring GitHub Actions Runner" 210 token=$(< "$RUNTIME_DIRECTORY"/${newConfigTokenFilename}) 211 - RUNNER_ROOT="$STATE_DIRECTORY" ${pkgs.github-runner}/bin/config.sh \ 212 --unattended \ 213 --work "$RUNTIME_DIRECTORY" \ 214 --url ${escapeShellArg cfg.url} \
··· 98 ''; 99 default = [ ]; 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 + }; 109 }; 110 111 config = mkIf cfg.enable { ··· 139 ] ++ cfg.extraPackages; 140 141 serviceConfig = rec { 142 + ExecStart = "${cfg.package}/bin/runsvc.sh"; 143 144 # Does the following, sequentially: 145 # - Copy the current and the previous `tokenFile` to the $RUNTIME_DIRECTORY ··· 216 if [[ -z "$empty" ]]; then 217 echo "Configuring GitHub Actions Runner" 218 token=$(< "$RUNTIME_DIRECTORY"/${newConfigTokenFilename}) 219 + RUNNER_ROOT="$STATE_DIRECTORY" ${cfg.package}/bin/config.sh \ 220 --unattended \ 221 --work "$RUNTIME_DIRECTORY" \ 222 --url ${escapeShellArg cfg.url} \