summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndreas Fuchs <asf@materialize.com>2021-08-24 05:23:39 -0400
committerGitHub <noreply@github.com>2021-08-24 11:23:39 +0200
commit15d14ad1500e645b98fd4cfa73e301697580d11a (patch)
tree83de9e2958da951af677b66d9daee915acf92d82
parentda497034d8429b733111cda03b4790743e2272db (diff)
downloadnixpkgs-15d14ad1500e645b98fd4cfa73e301697580d11a.tar
nixpkgs-15d14ad1500e645b98fd4cfa73e301697580d11a.tar.gz
nixpkgs-15d14ad1500e645b98fd4cfa73e301697580d11a.tar.bz2
nixpkgs-15d14ad1500e645b98fd4cfa73e301697580d11a.tar.lz
nixpkgs-15d14ad1500e645b98fd4cfa73e301697580d11a.tar.xz
nixpkgs-15d14ad1500e645b98fd4cfa73e301697580d11a.tar.zst
nixpkgs-15d14ad1500e645b98fd4cfa73e301697580d11a.zip
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!)
-rw-r--r--nixos/modules/services/continuous-integration/github-runner.nix12
1 files changed, 10 insertions, 2 deletions
diff --git a/nixos/modules/services/continuous-integration/github-runner.nix b/nixos/modules/services/continuous-integration/github-runner.nix
index 9627b723f8f..f951c155323 100644
--- a/nixos/modules/services/continuous-integration/github-runner.nix
+++ b/nixos/modules/services/continuous-integration/github-runner.nix
@@ -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} \