2021-12-10 20:11:36 +01:00
|
|
|
{
|
2022-03-01 22:19:03 +01:00
|
|
|
pkgs,
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
with lib; let
|
|
|
|
cfg = config.eboskma.drone;
|
|
|
|
in {
|
2021-12-10 20:11:36 +01:00
|
|
|
options.eboskma.drone = {
|
|
|
|
enable = mkEnableOption "activate drone CI";
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
eboskma.docker.enable = true;
|
|
|
|
|
|
|
|
virtualisation.oci-containers.containers = {
|
|
|
|
drone = {
|
|
|
|
autoStart = true;
|
|
|
|
image = "drone/drone:2";
|
2022-03-01 22:19:03 +01:00
|
|
|
ports = ["8100:80"];
|
|
|
|
volumes = ["drone_data:/data"];
|
2021-12-10 20:11:36 +01:00
|
|
|
environmentFiles = [
|
|
|
|
/var/run/secrets/drone
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
drone-runner-docker = {
|
|
|
|
autoStart = true;
|
|
|
|
image = "drone/drone-runner-docker:1";
|
2022-03-01 22:19:03 +01:00
|
|
|
ports = ["3000:3000"];
|
2021-12-10 20:11:36 +01:00
|
|
|
volumes = [
|
|
|
|
"/var/run/docker.sock:/var/run/docker.sock"
|
|
|
|
];
|
|
|
|
environmentFiles = [
|
|
|
|
/var/run/secrets/drone-runner
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|