about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVincent Haupert <vincent@yaxi.tech>2024-02-03 14:29:32 +0100
committerVincent Haupert <vincent@yaxi.tech>2024-02-03 14:33:39 +0100
commite6854b295bfa9c6d8fc43fede650d87154a3fcc8 (patch)
tree246eac9713c7b61b32026d70924cedcce7b79294
parentb7b83160f94316e9b28583b8f8bda443fe3f2e12 (diff)
downloadnixlib-e6854b295bfa9c6d8fc43fede650d87154a3fcc8.tar
nixlib-e6854b295bfa9c6d8fc43fede650d87154a3fcc8.tar.gz
nixlib-e6854b295bfa9c6d8fc43fede650d87154a3fcc8.tar.bz2
nixlib-e6854b295bfa9c6d8fc43fede650d87154a3fcc8.tar.lz
nixlib-e6854b295bfa9c6d8fc43fede650d87154a3fcc8.tar.xz
nixlib-e6854b295bfa9c6d8fc43fede650d87154a3fcc8.tar.zst
nixlib-e6854b295bfa9c6d8fc43fede650d87154a3fcc8.zip
nixos/github-runners: only override pkg if it has a `nodeRuntimes` arg
Older versions of the github-runner package might not have the
`nodeRuntimes` argument yet causing an error as the NixOS module always
tries to override the argument.

The commit makes sure we only override `nodeRuntimes` if the configured
package has a `nodeRuntimes` argument.
-rw-r--r--nixos/modules/services/continuous-integration/github-runner/service.nix3
1 files changed, 2 insertions, 1 deletions
diff --git a/nixos/modules/services/continuous-integration/github-runner/service.nix b/nixos/modules/services/continuous-integration/github-runner/service.nix
index 535df7f68e07..784aea0edea7 100644
--- a/nixos/modules/services/continuous-integration/github-runner/service.nix
+++ b/nixos/modules/services/continuous-integration/github-runner/service.nix
@@ -22,7 +22,8 @@ with lib;
 
 let
   workDir = if cfg.workDir == null then runtimeDir else cfg.workDir;
-  package = cfg.package.override { inherit (cfg) nodeRuntimes; };
+  # Support old github-runner versions which don't have the `nodeRuntimes` arg yet.
+  package = cfg.package.override (old: optionalAttrs (hasAttr "nodeRuntimes" old) { inherit (cfg) nodeRuntimes; });
 in
 {
   description = "GitHub Actions runner";