Cleanup Monica and git services
This commit is contained in:
@@ -8,7 +8,6 @@
|
||||
./nextcloud.nix
|
||||
./nginx.nix
|
||||
./postgres.nix
|
||||
./rei.nix
|
||||
./synapse.nix
|
||||
];
|
||||
greg.home = false;
|
||||
|
||||
@@ -133,99 +133,10 @@ in {
|
||||
# CI SERVICES
|
||||
##########
|
||||
##########################################################################################
|
||||
|
||||
# Service user
|
||||
users.users.drone = {
|
||||
isSystemUser = true;
|
||||
group = "drone";
|
||||
home = droneDir;
|
||||
};
|
||||
users.groups.drone = {};
|
||||
|
||||
# Environment secrets
|
||||
age.secrets.drone = {
|
||||
file = ../../secrets/drone.age;
|
||||
owner = "root";
|
||||
};
|
||||
|
||||
virtualisation.oci-containers = {
|
||||
backend = "podman";
|
||||
containers = {
|
||||
"drone" = {
|
||||
environment = {
|
||||
DRONE_GITEA_SERVER = "https://${srcDomain}";
|
||||
DRONE_LOGS_DEBUG = "true";
|
||||
DRONE_SERVER_HOST = ciDomain;
|
||||
DRONE_SERVER_PROTO = "https";
|
||||
DRONE_SERVER_PROXY_HOST = ciDomain;
|
||||
DRONE_SERVER_PROXY_PROTO = "https";
|
||||
DRONE_TLS_AUTOCERT = "false"; # Suppress it generating SSL certificates, as our proxy handles that
|
||||
};
|
||||
environmentFiles = [
|
||||
"/run/agenix/drone"
|
||||
];
|
||||
extraOptions = [ "--pull=newer" ];
|
||||
image = "drone/drone:2.17";
|
||||
ports = [ "${ciPort}:80" ];
|
||||
volumes = [ "${droneDir}:/data" ];
|
||||
};
|
||||
|
||||
"drone-docker" = {
|
||||
environment = droneWorkerEnvironment;
|
||||
environmentFiles = [
|
||||
"/run/agenix/drone"
|
||||
];
|
||||
extraOptions = [ "--pull=newer" ];
|
||||
image = "drone/drone-runner-docker:1.8";
|
||||
volumes = [ "/run/podman/podman.sock:/var/run/docker.sock" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services = {
|
||||
"podman-drone".serviceConfig = {
|
||||
StateDirectory = "drone";
|
||||
StateDirectoryMode = pkgs.lib.mkForce "0777";
|
||||
WorkingDirectory = droneDir;
|
||||
};
|
||||
|
||||
"drone-exec-runner" = {
|
||||
environment = droneWorkerEnvironment;
|
||||
description = "Drone pipeline runner that executes locally";
|
||||
after = [ "network.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
path = with pkgs; [
|
||||
bash
|
||||
drone-runner-exec
|
||||
git
|
||||
podman
|
||||
];
|
||||
|
||||
preStart = ''
|
||||
mkdir -p ${execWorkDir}
|
||||
cat /run/agenix/drone > ${execWorkDir}/conf.env
|
||||
echo "" >> ${execWorkDir}/conf.env
|
||||
'';
|
||||
script = "exec ${pkgs.drone-runner-exec}/bin/drone-runner-exec daemon ${execWorkDir}/conf.env";
|
||||
|
||||
serviceConfig = {
|
||||
StateDirectory = "drone-exec";
|
||||
StateDirectoryMode = pkgs.lib.mkForce "0777";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
greg.proxies."${ciDomain}" = {
|
||||
target = "http://localhost:${ciPort}";
|
||||
ssl = true;
|
||||
genAliases = false;
|
||||
};
|
||||
|
||||
##########################################################################################
|
||||
###########
|
||||
# CI WORKERS
|
||||
##########
|
||||
##########################################################################################
|
||||
virtualisation.podman = {
|
||||
enable = true;
|
||||
dockerCompat = true;
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
{ config, ... }:
|
||||
{
|
||||
services.monica = {
|
||||
enable = true;
|
||||
appKeyFile = config.age.secrets.monica.path;
|
||||
appURL = "https://people.thehellings.com";
|
||||
database = {
|
||||
port = 5432;
|
||||
};
|
||||
nginx = {
|
||||
addSSL = true;
|
||||
enableACME = true;
|
||||
serverAliases = [ "people.thehellings.com" ];
|
||||
};
|
||||
};
|
||||
|
||||
age.secrets.monica = {
|
||||
file = ../../secrets/monica.age;
|
||||
owner = "monica";
|
||||
};
|
||||
|
||||
greg.backup.jobs.monica = {
|
||||
src = "/var/lib/monica";
|
||||
dest = "monica";
|
||||
user = "monica";
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user