clan-infra/modules/web01/gitea/default.nix

58 lines
1.4 KiB
Nix
Raw Normal View History

2024-04-13 13:38:30 +00:00
{ config, pkgs, lib, publog, self, ... }:
2024-04-12 15:35:56 +00:00
2024-04-13 13:38:30 +00:00
let
# make the logs for this host "public" so that they show up in e.g. metrics
publog = vhost: lib.attrsets.unionOfDisjoint vhost {
extraConfig = (vhost.extraConfig or "") + ''
access_log /var/log/nginx/public.log vcombined;
2024-04-13 13:38:30 +00:00
'';
};
in
2024-04-12 15:35:56 +00:00
{
2023-07-04 17:56:58 +00:00
2023-07-13 09:05:07 +00:00
imports = [
./postgresql.nix
./actions-runner.nix
];
2023-07-04 17:56:58 +00:00
services.gitea = {
enable = true;
database = {
type = "postgres";
host = "/run/postgresql";
port = 5432;
};
2024-03-18 16:34:37 +00:00
lfs.enable = true;
2023-07-13 09:05:07 +00:00
package = self.packages.${pkgs.hostPlatform.system}.gitea;
settings.actions.ENABLED = true;
2023-07-04 17:56:58 +00:00
settings.mailer = {
ENABLED = true;
FROM = "gitea@clan.lol";
2024-04-30 11:18:26 +00:00
SMTP_ADDR = "localhost";
SMTP_PORT = 25;
PROTOCOL = "smtps";
2023-07-04 17:56:58 +00:00
};
settings.log.LEVEL = "Error";
2023-07-05 13:22:57 +00:00
settings.service.DISABLE_REGISTRATION = false;
2023-07-04 17:56:58 +00:00
settings.metrics.ENABLED = true;
settings.server = {
2023-07-13 09:17:56 +00:00
APP_DATA_PATH = "/var/lib/gitea/data";
2023-07-04 17:56:58 +00:00
DISABLE_ROUTER_LOG = true;
ROOT_URL = "https://git.clan.lol";
HTTP_PORT = 3002;
DOMAIN = "git.clan.lol";
2023-10-24 16:13:48 +00:00
LANDING_PAGE = "explore";
2023-07-04 17:56:58 +00:00
};
2024-03-18 09:15:47 +00:00
settings.session.COOKIE_SECURE = true;
2023-07-04 17:56:58 +00:00
};
2024-04-13 13:38:30 +00:00
services.nginx.virtualHosts."git.clan.lol" = publog {
2023-07-04 17:56:58 +00:00
forceSSL = true;
enableACME = true;
locations."/".extraConfig = ''
proxy_pass http://localhost:3002;
'';
};
}