2022-06-23 10:41:43 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
nix-packages,
|
|
|
|
system,
|
|
|
|
...
|
|
|
|
}: {
|
|
|
|
systemd.services.drone-runner-docker = {
|
|
|
|
wantedBy = ["multi-user.target"];
|
|
|
|
after = ["docker.service"];
|
|
|
|
environment = {
|
|
|
|
DRONE_RPC_HOST = "drone.int.chir.rs";
|
|
|
|
DRONE_RPC_PROTO = "https";
|
2022-06-23 10:43:32 +00:00
|
|
|
DRONE_RUNNER_MAX_PROCS = toString config.nix.settings.cores;
|
2022-06-23 10:41:43 +00:00
|
|
|
DRONE_RUNNER_NAME = "${config.networking.hostName}.int.chir.rs";
|
|
|
|
};
|
|
|
|
serviceConfig = {
|
|
|
|
Type = "simple";
|
|
|
|
User = "drone-runner-docker";
|
|
|
|
Group = "docker";
|
|
|
|
ExecStart = "${nix-packages.packages.${system}.drone-runner-docker}/bin/drone-runner-docker";
|
|
|
|
Restart = "always";
|
|
|
|
EnvironmentFile = config.sops.secrets."services/drone".path;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
users.users.drone-runner-docker = {
|
|
|
|
description = "Drone Docker Runner Service";
|
|
|
|
home = "/run/drone";
|
|
|
|
useDefaultShell = true;
|
|
|
|
group = "docker";
|
|
|
|
isSystemUser = true;
|
|
|
|
};
|
|
|
|
sops.secrets."services/drone" = {};
|
|
|
|
}
|