diff options
author | Jörg Thalheim <joerg@thalheim.io> | 2023-07-13 13:02:57 +0200 |
---|---|---|
committer | Jörg Thalheim <Mic92@users.noreply.github.com> | 2023-08-13 12:54:15 +0100 |
commit | 7ad7e99370e1a281f0edd307f70f50b577ce876a (patch) | |
tree | 95ea701aea9d4eafe2b17d3f953497569e4f70db /nixos/modules/services/continuous-integration | |
parent | 5075896acb0b2bbdfcf18e6535356bf0c7ad44ea (diff) |
nixos/gitea-actions-runner: settings option to configure daemon
Diffstat (limited to 'nixos/modules/services/continuous-integration')
-rw-r--r-- | nixos/modules/services/continuous-integration/gitea-actions-runner.nix | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/nixos/modules/services/continuous-integration/gitea-actions-runner.nix b/nixos/modules/services/continuous-integration/gitea-actions-runner.nix index fb70c48991260..6a0c740daae7f 100644 --- a/nixos/modules/services/continuous-integration/gitea-actions-runner.nix +++ b/nixos/modules/services/continuous-integration/gitea-actions-runner.nix @@ -31,6 +31,8 @@ let cfg = config.services.gitea-actions-runner; + settingsFormat = pkgs.formats.yaml { }; + # Check whether any runner instance label requires a container runtime # Empty label strings result in the upstream defined defaultLabels, which require docker # https://gitea.com/gitea/act_runner/src/tag/v0.1.5/internal/app/cmd/register.go#L93-L98 @@ -119,6 +121,18 @@ in that follows the filesystem hierarchy standard. ''; }; + settings = mkOption { + description = lib.mdDoc '' + Configuration for `act_runner daemon`. + See https://gitea.com/gitea/act_runner/src/branch/main/internal/pkg/config/config.example.yaml for an example configuration + ''; + + type = types.submodule { + freeformType = settingsFormat.type; + }; + + default = { }; + }; hostPackages = mkOption { type = listOf package; @@ -169,6 +183,7 @@ in wantsHost = hasHostScheme instance; wantsDocker = wantsContainerRuntime && config.virtualisation.docker.enable; wantsPodman = wantsContainerRuntime && config.virtualisation.podman.enable; + configFile = settingsFormat.generate "config.yaml" instance.settings; in nameValuePair "gitea-runner-${escapeSystemdPath name}" { inherit (instance) enable; @@ -222,7 +237,7 @@ in fi ''; - ExecStart = "${cfg.package}/bin/act_runner daemon"; + ExecStart = "${cfg.package}/bin/act_runner daemon --config ${configFile}"; SupplementaryGroups = optionals (wantsDocker) [ "docker" ] ++ optionals (wantsPodman) [ |