diff --git a/nix/modules/hive-ci.nix b/nix/modules/hive-ci.nix index d6b56fea..cbd27c22 100644 --- a/nix/modules/hive-ci.nix +++ b/nix/modules/hive-ci.nix @@ -231,6 +231,23 @@ in defaultText = lib.literalExpression "pkgs.gitea-actions-runner"; description = "gitea-actions-runner package."; }; + + jobTimeout = lib.mkOption { + type = lib.types.str; + default = "1h"; + example = "3h"; + description = '' + Per-job wall-clock timeout the runner enforces (act_runner's + `runner.timeout`). A job that exceeds it is killed, so a hung or + runaway build is bounded instead of holding the runner's single + slot indefinitely. Default `1h` comfortably covers a cold-cache + nix build while still bounding a stuck job; raise it (e.g. + `"3h"`) if you legitimately run jobs longer than that. Accepts a + Go duration string (`30m`, `1h`, `2h30m`). Note: this is + enforced by the runner process, so it only fires while that + process is itself healthy. + ''; + }; }; config = lib.mkIf cfg.enable { @@ -343,8 +360,8 @@ in labels = cfg.labels; settings = { runner.capacity = cfg.concurrency; - # Generous timeout for cold-cache nix builds. - runner.timeout = "3h"; + # Per-job wall-clock cap — see the `jobTimeout` option. + runner.timeout = cfg.jobTimeout; }; };