nix-config/modules/services/woodpecker/agent-docker/default.nix
Bruno BELANYI fcdb5ba593
Some checks are pending
ci/woodpecker/push/check Pipeline is running
modules: services: woodpecker: remove DNS hack
I'm not sure what changed, but it looks like I don't need it anymore.

Initially I wanted to apply the same DNS fix as [1].

[1]: https://blog.kotatsu.dev/posts/2023-04-21-woodpecker-nix-caching/
2023-10-18 21:38:22 +02:00

43 lines
1 KiB
Nix

{ config, lib, ... }:
let
cfg = config.my.services.woodpecker;
hasRunner = (name: builtins.elem name cfg.runners);
in
{
config = lib.mkIf (cfg.enable && hasRunner "docker") {
services.woodpecker-agents = {
agents.docker = {
enable = true;
environment = {
WOODPECKER_SERVER = "localhost:${toString cfg.rpcPort}";
WOODPECKER_MAX_WORKFLOWS = "10";
WOODPECKER_BACKEND = "docker";
WOODPECKER_FILTER_LABELS = "type=docker";
WOODPECKER_HEALTHCHECK = "false";
};
environmentFile = [ cfg.sharedSecretFile ];
extraGroups = [ "docker" ];
};
};
# Make sure it is activated in that case
my.system.docker.enable = true;
# Adjust runner service for nix usage
systemd.services.woodpecker-agent-docker = {
after = [ "docker.socket" ]; # Needs the socket to be available
# might break deployment
restartIfChanged = false;
serviceConfig = {
BindPaths = [
"/var/run/docker.sock"
];
};
};
};
}