{ lib, config, inputs, pkgs, ... }: let cfg = config.my.servers.gitea; in { imports = [ ../nix/gitea-actions-runners/ryujinx.nix ../nix/gitea-actions-runners/nixos.nix ]; options.my.servers.gitea = inputs.self.lib.mkServerOptions "gitea" "git" 9083 lib; 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; }; }; }; }