diff options
author | Vincent Haupert <vincent@yaxi.tech> | 2024-02-03 14:29:32 +0100 |
---|---|---|
committer | github-actions[bot] <github-actions[bot]@users.noreply.github.com> | 2024-02-08 15:20:39 +0000 |
commit | 1f83c951917be4389b8364f6e7632564064bba9d (patch) | |
tree | 4350d3f23c1101c889e8bf64a6eaceb2dfcfbe83 /nixos/modules/services | |
parent | 620b309240d774a0ea00611d8291f96141c1e60e (diff) |
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. (cherry picked from commit e6854b295bfa9c6d8fc43fede650d87154a3fcc8)
Diffstat (limited to 'nixos/modules/services')
-rw-r--r-- | nixos/modules/services/continuous-integration/github-runner/service.nix | 3 |
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 535df7f68e076..784aea0edea7b 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"; |