diff options
author | Vincent Haupert <vincent@yaxi.tech> | 2024-02-03 14:29:32 +0100 |
---|---|---|
committer | Vincent Haupert <vincent@yaxi.tech> | 2024-02-03 14:33:39 +0100 |
commit | e6854b295bfa9c6d8fc43fede650d87154a3fcc8 (patch) | |
tree | 246eac9713c7b61b32026d70924cedcce7b79294 /nixos/modules/services/continuous-integration | |
parent | b7b83160f94316e9b28583b8f8bda443fe3f2e12 (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.
Diffstat (limited to 'nixos/modules/services/continuous-integration')
-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"; |