all repos — nixfiles @ b54735d05c8b3a2951c0789e6b8b0c26595656d8

System and user configuration, managed by nix and home-manager

extract ntfy configuration to push-notifications role

Alin
commit

b54735d05c8b3a2951c0789e6b8b0c26595656d8

parent

9833cfc9c086f925a25793fad0b0136370943401

1 file changed, 28 insertions(+), 0 deletions(-)

changed files
A system/roles/push-notifications.nix
@@ -0,0 +1,28 @@
+{ + config, + ... +}: +{ + age.secrets.ntfy.file = ../../secrets/ntfy.age; + + services.ntfy-sh = { + enable = true; + settings = { + base-url = "https://ntfy.alin.ovh"; + behind-proxy = true; + upstream-base-url = "https://ntfy.sh"; + auth-default-access = "deny"; + enable-login = true; + require-login = true; + }; + environmentFile = config.age.secrets.ntfy.path; + }; + + services.caddy.virtualHosts = { + "ntfy.${config.networking.domain}" = { + extraConfig = '' + reverse_proxy ${config.services.ntfy-sh.settings.listen-http} + ''; + }; + }; +}