mirror of
https://github.com/nmasur/dotfiles
synced 2025-07-05 15:00:14 +00:00
add ntfy push notifications
This commit is contained in:
@ -129,6 +129,10 @@
|
||||
type = lib.types.str;
|
||||
description = "Hostname for n8n automation.";
|
||||
};
|
||||
notifications = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Hostname for push notification services (ntfy).";
|
||||
};
|
||||
transmission = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Hostname for peer2peer downloads (Transmission).";
|
||||
|
@ -26,6 +26,7 @@
|
||||
./n8n.nix
|
||||
./netdata.nix
|
||||
./nextcloud.nix
|
||||
./ntfy.nix
|
||||
./paperless.nix
|
||||
./postgresql.nix
|
||||
./prometheus.nix
|
||||
|
33
modules/nixos/services/ntfy.nix
Normal file
33
modules/nixos/services/ntfy.nix
Normal file
@ -0,0 +1,33 @@
|
||||
{ config, lib, ... }:
|
||||
|
||||
{
|
||||
|
||||
config = lib.mkIf config.services.ntfy-sh.enable {
|
||||
services.ntfy-sh = {
|
||||
settings = rec {
|
||||
base-url = "https://${config.hostnames.notifications}";
|
||||
upstream-base-url = "https://ntfy.sh";
|
||||
listen-http = ":8333";
|
||||
behind-proxy = true;
|
||||
auth-default-access = "deny-all";
|
||||
auth-file = "/var/lib/ntfy-sh/user.db";
|
||||
};
|
||||
};
|
||||
|
||||
caddy.routes = [
|
||||
{
|
||||
match = [ { host = [ config.hostnames.notifications ]; } ];
|
||||
handle = [
|
||||
{
|
||||
handler = "reverse_proxy";
|
||||
upstreams = [ { dial = "localhost${config.services.ntfy-sh.settings.listen-http}"; } ];
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
|
||||
# Configure Cloudflare DNS to point to this machine
|
||||
services.cloudflare-dyndns.domains = [ config.hostnames.notifications ];
|
||||
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user