nixcfg/systems/x86_64-linux/mx/ntfy.nix
Harald Hoyer 7df551d46f feat: extend systemd-email-notify module with optional ntfy support
Add configurable ntfy options (tokenFile, url, topic) to the shared
emailOnFailure module. When tokenFile is set, a ntfy-failure@ template
service is added alongside the existing email notifications. Systems
without ntfy configured are unaffected.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:38:14 +01:00

27 lines
581 B
Nix

{ config, ... }:
{
services.ntfy-sh = {
enable = true;
settings = {
base-url = "https://ntfy.hoyer.xyz";
behind-proxy = true;
auth-default-access = "deny-all";
};
};
services.nginx.virtualHosts."ntfy.hoyer.xyz" = {
useACMEHost = "hoyer.xyz";
enableACME = false;
forceSSL = true;
locations."/" = {
proxyPass = "http://127.0.0.1:2586";
proxyWebsockets = true;
};
};
metacfg.emailOnFailure.ntfy = {
tokenFile = config.sops.secrets.ntfy.path;
url = "http://127.0.0.1:2586";
topic = "alerts";
};
}