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

2 files changed, 29 insertions(+), 20 deletions(-)

changed files
M system/hosts/linde.nix → system/hosts/linde.nix
@@ -37,6 +37,7 @@ ../roles/binary-cache.nix
../roles/forgejo-runner.nix ../roles/goatcounter.nix ../roles/mailer.nix + ../roles/push-notifications.nix ../roles/readeck.nix ../roles/searchix.nix ../roles/sso.nix
@@ -45,7 +46,6 @@ ../settings/services/git-server.nix
]; age.secrets = { redis-website.file = ../../secrets/redis-website.age; - ntfy.file = ../../secrets/ntfy.age; }; boot.loader.efi.efiSysMountPoint = "/boot/efi";
@@ -355,11 +355,6 @@ extraConfig = ''
redir https://{labels.2}.${domain}{uri} ''; }; - "ntfy.${domain}" = { - extraConfig = '' - reverse_proxy ${config.services.ntfy-sh.settings.listen-http} - ''; - }; }; }; networking.nat = {
@@ -389,18 +384,4 @@ };
}; }; }; - - 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; - }; - }
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} + ''; + }; + }; +}