NixOS/modules/servers/gitea.nix
2025-10-01 13:40:05 -06:00

43 lines
997 B
Nix

{
lib,
config,
pkgs,
...
}:
let
cfg = config.my.servers.gitea;
setup = import ../factories/mkserver.nix { inherit lib config; };
in
{
imports = [
../nix/gitea-actions-runners/ryujinx.nix
../nix/gitea-actions-runners/nixos.nix
];
options.my.servers.gitea = setup.mkOptions "gitea" "git" 9083;
config = lib.mkIf (cfg.enable && config.my.secureHost) {
sops.secrets.gitea.sopsFile = ../../secrets/env.yaml;
services.gitea = {
inherit (cfg) enable;
settings = {
session.COOKIE_SECURE = true;
server = {
DOMAIN = cfg.host;
ROOT_URL = cfg.url;
HTTP_PORT = cfg.port;
};
mailer = {
ENABLED = true;
PROTOCOL = "sendmail";
FROM = config.my.smtpemail;
SENDMAIL_PATH = "${pkgs.msmtp}/bin/msmtp";
};
};
database = {
socket = config.my.postgresSocket;
type = "postgres";
createDatabase = false;
};
};
};
}