From e6854b295bfa9c6d8fc43fede650d87154a3fcc8 Mon Sep 17 00:00:00 2001 From: Vincent Haupert Date: Sat, 3 Feb 2024 14:29:32 +0100 Subject: 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. --- .../modules/services/continuous-integration/github-runner/service.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'nixos/modules') 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"; -- cgit 1.4.1