diff options
Diffstat (limited to 'flora/services')
-rw-r--r-- | flora/services/ntfy.nix | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/flora/services/ntfy.nix b/flora/services/ntfy.nix new file mode 100644 index 0000000..cda212d --- /dev/null +++ b/flora/services/ntfy.nix @@ -0,0 +1,35 @@ +{ config, ... }: + +{ + services.ntfy-sh = { + enable = true; + settings = { + base-url = "https://ping.stuebinm.eu"; + behind-proxy = true; + listen-http = ""; + listen-unix = "/run/ntfy-sh/ntfy.sock"; + listen-unix-mode = 511; ## lossy nix->yaml conversion eats octal literals (equal to 0777) + + auth-file = "/var/lib/ntfy-sh/user.db"; + auth-default-access = "deny-all"; + + enable-signup = false; + visitor-email-limit-burst = 0; + }; + }; + + services.nginx.virtualHosts."ping.stuebinm.eu" = { + enableACME = true; + forceSSL = true; + locations."/" = { + proxyPass = "http://unix:/run/ntfy-sh/ntfy.sock"; + proxyWebsockets = true; + }; + }; + + systemd.services.ntfy-sh = { + serviceConfig = { + RuntimeDirectory = [ "ntfy-sh" ]; + }; + }; +} |