lol

nixos/gitea-actions-runner: settings option to configure daemon

authored by

Jörg Thalheim and committed by
Jörg Thalheim
7ad7e993 5075896a

+16 -1
+16 -1
nixos/modules/services/continuous-integration/gitea-actions-runner.nix
··· 31 31 32 32 cfg = config.services.gitea-actions-runner; 33 33 34 + settingsFormat = pkgs.formats.yaml { }; 35 + 34 36 # Check whether any runner instance label requires a container runtime 35 37 # Empty label strings result in the upstream defined defaultLabels, which require docker 36 38 # https://gitea.com/gitea/act_runner/src/tag/v0.1.5/internal/app/cmd/register.go#L93-L98 ··· 119 121 that follows the filesystem hierarchy standard. 120 122 ''; 121 123 }; 124 + settings = mkOption { 125 + description = lib.mdDoc '' 126 + Configuration for `act_runner daemon`. 127 + See https://gitea.com/gitea/act_runner/src/branch/main/internal/pkg/config/config.example.yaml for an example configuration 128 + ''; 129 + 130 + type = types.submodule { 131 + freeformType = settingsFormat.type; 132 + }; 133 + 134 + default = { }; 135 + }; 122 136 123 137 hostPackages = mkOption { 124 138 type = listOf package; ··· 169 183 wantsHost = hasHostScheme instance; 170 184 wantsDocker = wantsContainerRuntime && config.virtualisation.docker.enable; 171 185 wantsPodman = wantsContainerRuntime && config.virtualisation.podman.enable; 186 + configFile = settingsFormat.generate "config.yaml" instance.settings; 172 187 in 173 188 nameValuePair "gitea-runner-${escapeSystemdPath name}" { 174 189 inherit (instance) enable; ··· 222 237 fi 223 238 224 239 ''; 225 - ExecStart = "${cfg.package}/bin/act_runner daemon"; 240 + ExecStart = "${cfg.package}/bin/act_runner daemon --config ${configFile}"; 226 241 SupplementaryGroups = optionals (wantsDocker) [ 227 242 "docker" 228 243 ] ++ optionals (wantsPodman) [