services/ntfy: init

This commit is contained in:
Lu Wang 2024-12-15 01:20:55 +08:00
parent 0bf3fa4a50
commit 7db8aae188
Signed by: rebmit
SSH key fingerprint: SHA256:3px8QV1zEerIrEWHaqtH5rR9kjetyRST5EipOPrd+bU
3 changed files with 31 additions and 0 deletions

View file

@ -9,6 +9,7 @@
suites.server
++ (with profiles; [
services.caddy
services.ntfy
services.postgresql
])
++ (mylib.path.scanPaths ./. "default.nix");

View file

@ -16,6 +16,7 @@ in
# local ports
enthalpy-gost = 3000;
ntfy = 4000;
# public ports
enthalpy-ipsec = 13000;

View file

@ -0,0 +1,29 @@
{
config,
lib,
mylib,
...
}:
{
services.ntfy-sh = {
enable = true;
settings = {
base-url = "https://ntfy.rebmit.moe";
listen-http = "[::1]:${toString config.networking.ports.ntfy}";
auth-default-access = "deny-all";
behind-proxy = true;
};
};
systemd.services.ntfy-sh.serviceConfig = mylib.misc.serviceHardened // {
DynamicUser = lib.mkForce false;
};
services.caddy.virtualHosts."ntfy.rebmit.moe" = {
extraConfig = ''
reverse_proxy ${config.services.ntfy-sh.settings.listen-http}
'';
};
services.restic.backups.b2.paths = [ "/var/lib/ntfy-sh" ];
}