2021-02-01 19:27:19 +01:00
|
|
|
# A docker-based CI/CD system
|
|
|
|
#
|
|
|
|
# Inspired by [1]
|
|
|
|
# [1]: https://github.com/Mic92/dotfiles/blob/master/nixos/eve/modules/drone.nix
|
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
{
|
2021-09-25 15:22:52 +02:00
|
|
|
imports = [
|
|
|
|
./runner-docker
|
|
|
|
./runner-exec
|
|
|
|
./server
|
|
|
|
];
|
|
|
|
|
2021-02-01 19:27:19 +01:00
|
|
|
options.my.services.drone = with lib; {
|
|
|
|
enable = mkEnableOption "Drone CI";
|
|
|
|
runners = mkOption {
|
2021-02-08 15:53:27 +01:00
|
|
|
type = with types; listOf (enum [ "exec" "docker" ]);
|
2021-02-01 19:27:19 +01:00
|
|
|
default = [ ];
|
|
|
|
example = [ "exec" "docker" ];
|
|
|
|
description = "Types of runners to enable";
|
|
|
|
};
|
|
|
|
admin = mkOption {
|
|
|
|
type = types.str;
|
|
|
|
default = "ambroisie";
|
|
|
|
example = "admin";
|
|
|
|
description = "Name of the admin user";
|
|
|
|
};
|
|
|
|
port = mkOption {
|
|
|
|
type = types.port;
|
|
|
|
default = 3030;
|
|
|
|
example = 8080;
|
|
|
|
description = "Internal port of the Drone UI";
|
|
|
|
};
|
|
|
|
secretFile = mkOption {
|
|
|
|
type = types.str;
|
|
|
|
example = "/run/secrets/drone-gitea.env";
|
|
|
|
description = "Secrets to inject into Drone server";
|
|
|
|
};
|
|
|
|
sharedSecretFile = mkOption {
|
|
|
|
type = types.str;
|
|
|
|
example = "/run/secrets/drone-rpc.env";
|
|
|
|
description = "Shared RPC secret to inject into server and runners";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|