Files
tuxcord.nix/nixos/modules/nginx.nix
T
javalsai c1748e7124
Check / Nix flake (push) Has been cancelled
Lint / Nix expressions (push) Has been cancelled
nixos/services: add gitea server
2026-05-03 00:12:31 +02:00

37 lines
707 B
Nix

{ config, lib, ... }:
let
fqdn = config.networking.fqdn;
mkVhost =
attrs:
{
forceSSL = false; # TODO: tweak per host
}
// attrs;
mkProxy = port: {
proxyPass = "http://127.0.0.1:${toString port}/";
};
in
{
services.nginx = {
enable = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
recommendedGzipSettings = true;
recommendedOptimisation = true;
# services.nginx.virtualHosts."${fqdn}" = {
# addSSL = true;
# root = "/var/www/myhost.org";
# default = true;
# };
virtualHosts."git.${fqdn}" = mkVhost {
locations."/" = mkProxy config.services.gitea.settings.server.HTTP_PORT;
};
};
}