helm/hosts/profiles/woodpecker-server/default.nix

62 lines
1.7 KiB
Nix
Raw Permalink Normal View History

2022-12-22 22:16:19 -08:00
{ self, pkgs, config, ... }:
{
2022-12-21 04:33:39 -08:00
age.secrets.woodpecker-server-secrets.owner = "woodpecker";
age.secrets.woodpecker-server-secrets.file = "${self}/secrets/woodpecker-server-secrets.age";
age.secrets.woodpecker-agent-secret.owner = "woodpecker";
age.secrets.woodpecker-agent-secret.file = "${self}/secrets/woodpecker-agent-secret.age";
users.users.woodpecker = {
2022-12-21 04:33:39 -08:00
group = "woodpecker";
description = "woodpecker user";
home = "/var/lib/woodpecker";
createHome = true;
2022-12-22 22:16:19 -08:00
isNormalUser = true;
};
users.groups.woodpecker = { };
services.nginx.virtualHosts."ci.sealight.xyz" = {
enableACME = true;
forceSSL = true;
2022-12-22 22:16:19 -08:00
locations."/".proxyPass = "http://localhost:38125";
};
2022-12-22 22:16:19 -08:00
networking.firewall.allowedTCPPorts = [ 80 443 22 ];
services.postgresql = {
ensureDatabases = [ "woodpecker" ];
ensureUsers = [{
name = "woodpecker";
2024-01-05 23:44:08 -08:00
ensureDBOwnership = true;
}];
};
systemd.services.woodpecker-server = {
2023-05-12 03:50:51 -07:00
after = [ "postgresql.service" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
2022-12-22 22:16:19 -08:00
WorkingDirectory = "/var/lib/woodpecker";
EnvironmentFile = [
2022-12-21 04:33:39 -08:00
/run/agenix/woodpecker-server-secrets
/run/agenix/woodpecker-agent-secret
];
Environment = [
2022-12-22 22:16:19 -08:00
"WOODPECKER_OPEN=false"
"WOODPECKER_HOST=https://ci.sealight.xyz"
"WOODPECKER_SERVER_ADDR=:38125"
"WOODPECKER_GITEA=true"
"WOODPECKER_GITEA_URL=https://git.sealight.xyz"
"WOODPECKER_DATABASE_DATASOURCE=postgres:///woodpecker?host=/run/postgresql"
"WOODPECKER_DATABASE_DRIVER=postgres"
2023-05-30 05:23:05 -07:00
"WOODPECKER_ADMIN=aynish"
];
ExecStart = "${pkgs.woodpecker-server}/bin/woodpecker-server";
2022-12-22 22:16:19 -08:00
User = "woodpecker";
Group = "woodpecker";
};
};
}