2023-03-09 14:15:44 +03:00
|
|
|
{ pkgs, config, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
canigouData = import ../../data.secret.nix;
|
|
|
|
|
|
|
|
data = import ./data.secret.nix;
|
|
|
|
inherit (data) userAgent group grpcPort;
|
|
|
|
|
|
|
|
dockerSockVolume = "/var/run/docker.sock:/var/run/docker.sock";
|
|
|
|
dockerConfVolume = "${config.age.secrets.woodpecker-docker-config.path}:/root/.docker/config.json";
|
|
|
|
in
|
|
|
|
{
|
|
|
|
systemd.services.woodpecker-agent = {
|
|
|
|
enable = true;
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
2023-03-23 12:07:38 +03:00
|
|
|
after = [ "network-online.target" ];
|
|
|
|
wants = [ "network-online.target" ];
|
2023-03-09 14:15:44 +03:00
|
|
|
restartIfChanged = true;
|
|
|
|
serviceConfig = {
|
|
|
|
EnvironmentFile = [
|
|
|
|
config.age.secrets.woodpecker-common-env.path
|
|
|
|
];
|
|
|
|
Environment = [
|
|
|
|
"WOODPECKER_DEBUG_PRETTY=true"
|
|
|
|
"WOODPECKER_LOG_LEVEL=trace"
|
|
|
|
"WOODPECKER_SERVER=${canigouData.addr}:${toString grpcPort}"
|
|
|
|
"WOODPECKER_MAX_WORKFLOWS=2"
|
|
|
|
"WOODPECKER_BACKEND=docker"
|
|
|
|
"WOODPECKER_BACKEND_DOCKER_VOLUMES=${dockerSockVolume},${dockerConfVolume}"
|
|
|
|
];
|
2023-03-31 17:40:22 +03:00
|
|
|
ExecStart = "${pkgs.unstable.woodpecker-agent}/bin/woodpecker-agent";
|
2023-03-09 14:15:44 +03:00
|
|
|
User = userAgent;
|
|
|
|
Group = group;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|