37 lines
1.1 KiB
Nix
37 lines
1.1 KiB
Nix
{ pkgs, config, ... }:
|
|
|
|
let
|
|
nextPkgs = pkgs.callPackage ../../../../packages/woodpecker { };
|
|
|
|
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" ];
|
|
after = [ "woodpecker-server.service" ];
|
|
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}"
|
|
];
|
|
ExecStart = "${nextPkgs.woodpecker-agent}/bin/woodpecker-agent";
|
|
User = userAgent;
|
|
Group = group;
|
|
};
|
|
};
|
|
}
|