NixOS/modules/servers/gitea.nix
2025-09-19 11:15:26 -06:00

37 lines
847 B
Nix

{
lib,
config,
pkgs,
...
}:
let
cfg = config.my.servers.gitea;
setup = import ./setup.nix { inherit lib config; };
in
{
options.my.servers.gitea = setup.mkOptions "gitea" "git" 9083;
config.services = {
gitea = lib.mkIf cfg.enable {
enable = true;
domain = cfg.host;
rootUrl = cfg.url;
settings = {
session.COOKIE_SECURE = true;
server.HTTP_PORT = cfg.port;
mailer = {
ENABLED = true;
MAILER_TYPE = "sendmail";
FROM = config.my.smtpemail;
SENDMAIL_PATH = "${pkgs.msmtp}/bin/msmtp";
};
};
database = {
socket = config.my.postgresSocket;
type = "postgres";
createDatabase = false;
};
};
nginx.virtualHosts."${cfg.host}" = lib.mkIf cfg.enableProxy (setup.proxyReverseFix cfg);
};
}