server: install woodpecker

This commit is contained in:
Kabbone 2023-03-14 17:30:03 +01:00
parent 0269b0ff86
commit 987ecdc1ab
Signed by: Kabbone
SSH Key Fingerprint: SHA256:A5zPB5I6u5V78V51c362BBdCwhDhfDUVbt7NfKdjWBY
2 changed files with 88 additions and 0 deletions

View File

@ -13,6 +13,7 @@
[
./postgresql.nix
./gitea.nix
./woodpecker.nix
./nextcloud.nix
./matrix.nix
./coturn.nix

View File

@ -0,0 +1,87 @@
#
# CI/CD Woodpecker
#
{ config, lib, pkgs, ... }:
{
environment.systemPackages = with pkgs; [ # Default packages install system-wide
woodpecker-server
woodpecker-cli
];
users = {
users = {
woodpecker = {
uid = 3005;
group = "woodpecker";
isSystemUser = true;
};
};
groups = {
woodpecker = {
gid = 3005;
};
};
};
woodpecker-server = {
description = "CI/CD Pipeline Server";
wantedBy = [ "multi-user.target" ];
after = [ "network.target" "postgresql.service" ];
requires = [ "postgresql.service" ];
script = "${pkgs.woodpecker-server}/bin/woodpecker-server --server-host https://woodpecker.kabtop.de --server-addr localhost:8000 ";
# --environment ${config.age.secrets."services/woodpecker/environment.yml".path}";
serviceConfig = {
User = "woodpecker";
Group = "woodpecker";
Environment = "HOME=/var/lib/woodpecker";
ReadWritePaths="/var/log/woodpecker";
NoNewPrivileges=true;
MemoryDenyWriteExecute=true;
PrivateDevices=true;
PrivateTmp=true;
ProtectHome=true;
ProtectSystem="strict";
ProtectControlGroups=true;
RestrictSUIDSGID=true;
RestrictRealtime=true;
LockPersonality=true;
ProtectKernelLogs=true;
ProtectKernelTunables=true;
ProtectHostname=true;
ProtectKernelModules=true;
PrivateUsers=true;
ProtectClock=true;
SystemCallArchitectures="native";
SystemCallErrorNumber="EPERM";
SystemCallFilter="@system-service";
};
};
systemd.tmpfiles.rules = [
"d /var/log/woodpecker - woodpecker woodpecker"
];
services.nginx = {
enable = true;
recommendedTlsSettings = true;
recommendedOptimisation = true;
recommendedGzipSettings = true;
recommendedProxySettings = true;
virtualHosts = {
"woodpecker.kabtop.de" = {
enableACME = true;
forceSSL = true;
locations."/".proxyPass = "http://localhost:8000";
};
};
};
# age.secrets."services/woodpecker/dbpassFile" = {
# file = ../../../secrets/services/nextcloud/dbpassFile.age;
# owner = "nextcloud";
# };
}