nixos-config/modules/services/ntfy.nix

40 lines
975 B
Nix
Raw Normal View History

2024-09-26 13:17:48 +02:00
let
hostname = "notify.liv.town";
port = 2586;
url = "https://" + hostname;
2025-05-23 03:09:40 +02:00
in
{
2024-09-26 13:17:48 +02:00
services = {
ntfy-sh = {
enable = true;
settings = {
base-url = url;
listen-http = "127.0.0.1:${toString port}";
behind-proxy = true;
2025-02-08 11:43:13 +01:00
visitor-attachment-daily-bandwidth-limit = "10M";
visitor-request-limit-burst = 15;
2025-02-08 11:43:13 +01:00
visitor-request-limit-replenish = "15s";
2024-09-26 13:17:48 +02:00
};
};
nginx.virtualHosts.${hostname} = {
forceSSL = true;
2025-05-23 03:09:40 +02:00
sslCertificate = "/var/lib/acme/liv.town/cert.pem";
sslCertificateKey = "/var/lib/acme/liv.town/key.pem";
2024-12-19 18:22:06 +01:00
locations."/" = {
proxyPass = "http://127.0.0.1:${toString port}";
proxyWebsockets = true;
};
2024-09-26 13:17:48 +02:00
};
frp.settings.proxies = [
{
name = "http";
type = "tcp";
localIP = "localhost";
localPort = port;
remotePort = port;
}
];
};
networking.firewall.allowedTCPPorts = [ port ];
}