nixos/hosts/modules/server/ntfy-sh.nix
2024-06-19 23:51:36 +02:00

24 lines
654 B
Nix

# Push Notification Server
# https://mynixos.com/nixpkgs/options/services.ntfy-sh
let
hostname = "ntfy.anotherhadi.com";
port = 8082;
url = "https://" + hostname + ":" + port;
in {
services.ntfy-sh = {
enable = true;
settings = {
base-url = url;
listen-http = "${toString port}";
# auth-file = "/etc/ntfy-sh/authfile"
auth-default-access = "deny-all";
behind-proxy = true;
};
};
services.nginx.virtualHosts.${hostname} = {
enableACME = true;
locations."/" = { proxyPass = "http://127.0.0.1:${toString port}"; };
};
networking.firewall.allowedTCPPorts = [ port ];
}