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.
This commit is contained in:
Vincent Haupert 2024-02-03 14:29:32 +01:00
parent b7b83160f9
commit e6854b295b

View File

@ -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";