mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-16 14:39:23 +03:00
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!)
This commit is contained in:
parent
da497034d8
commit
15d14ad150
1 changed files with 10 additions and 2 deletions
|
@ -98,6 +98,14 @@ in
|
|||
'';
|
||||
default = [ ];
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
description = ''
|
||||
Which github-runner derivation to use.
|
||||
'';
|
||||
default = pkgs.github-runner;
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
@ -131,7 +139,7 @@ in
|
|||
] ++ cfg.extraPackages;
|
||||
|
||||
serviceConfig = rec {
|
||||
ExecStart = "${pkgs.github-runner}/bin/runsvc.sh";
|
||||
ExecStart = "${cfg.package}/bin/runsvc.sh";
|
||||
|
||||
# Does the following, sequentially:
|
||||
# - Copy the current and the previous `tokenFile` to the $RUNTIME_DIRECTORY
|
||||
|
@ -208,7 +216,7 @@ in
|
|||
if [[ -z "$empty" ]]; then
|
||||
echo "Configuring GitHub Actions Runner"
|
||||
token=$(< "$RUNTIME_DIRECTORY"/${newConfigTokenFilename})
|
||||
RUNNER_ROOT="$STATE_DIRECTORY" ${pkgs.github-runner}/bin/config.sh \
|
||||
RUNNER_ROOT="$STATE_DIRECTORY" ${cfg.package}/bin/config.sh \
|
||||
--unattended \
|
||||
--work "$RUNTIME_DIRECTORY" \
|
||||
--url ${escapeShellArg cfg.url} \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue