53 lines
1.3 KiB
Nix
53 lines
1.3 KiB
Nix
|
{
|
||
|
users.users.woodpecker = {
|
||
|
group = woodpecker;
|
||
|
description = "woodpecker user";
|
||
|
home = "/var/lib/woodpecker";
|
||
|
createHome = true;
|
||
|
};
|
||
|
|
||
|
users.groups.woodpecker = { };
|
||
|
|
||
|
services.nginx.virtualHosts."ci.sealight.xyz" = {
|
||
|
enableACME = true;
|
||
|
forceSSL = true;
|
||
|
locations."/".proxyPass = "http://localhost:3030/";
|
||
|
};
|
||
|
|
||
|
services.postgresql = {
|
||
|
ensureDatabases = [ "woodpecker" ];
|
||
|
ensureUsers = [{
|
||
|
name = "woodpecker";
|
||
|
ensurePermissions = {
|
||
|
"DATABASE woodpecker" = "ALL PRIVILEGES";
|
||
|
};
|
||
|
}];
|
||
|
};
|
||
|
|
||
|
systemd.services.woodpecker-server = {
|
||
|
wantedBy = [ "multi-user.target" ];
|
||
|
serviceConfig = {
|
||
|
EnvironmentFile = [
|
||
|
# GITEA_CLIENT_SECRET etc
|
||
|
# /run/agenix/woodpecker
|
||
|
];
|
||
|
Environment = [
|
||
|
"WOODPECKER_OPEN=true"
|
||
|
"WOODPECKER_AGENT_SECRET=${WOODPECKER_AGENT_SECRET}"
|
||
|
|
||
|
"WOODPECKER_GITEA=true"
|
||
|
"WOODPECKER_GITEA_URL=https://git.sealight.xyz"
|
||
|
|
||
|
"WOODPECKER_DATABASE_DATASOURCE=postgres:///woodpecker?host=/run/postgresql"
|
||
|
"WOODPECKER_DATABASE_DRIVER=postgres"
|
||
|
"WOODPECKER_SERVER_PORT=:3030"
|
||
|
"WOODPECKER_USER_CREATE=username:aynish,admin:true" # set your admin username
|
||
|
];
|
||
|
ExecStart = "${pkgs.woodpecker-server}/bin/woodpecker-server";
|
||
|
User = woodpecker;
|
||
|
Group = woodpecker;
|
||
|
};
|
||
|
};
|
||
|
|
||
|
}
|