nixos-config/modules/drone/default.nix

41 lines
831 B
Nix

{ pkgs
, config
, lib
, ...
}:
with lib; let
cfg = config.eboskma.drone;
in
{
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";
ports = [ "8100:80" ];
volumes = [ "drone_data:/data" ];
environmentFiles = [
/var/run/secrets/drone
];
};
drone-runner-docker = {
autoStart = true;
image = "drone/drone-runner-docker:1";
ports = [ "3000:3000" ];
volumes = [
"/var/run/docker.sock:/var/run/docker.sock"
];
environmentFiles = [
/var/run/secrets/drone-runner
];
};
};
};
}