diff --git a/hosts/lab/default.nix b/hosts/lab/default.nix index 559b0a8..b68bcae 100644 --- a/hosts/lab/default.nix +++ b/hosts/lab/default.nix @@ -12,6 +12,7 @@ ./uptime-kuma.nix ./tinyauth.nix ./shlink.nix + ./ntfy.nix ]; networking.hostName = "lab"; diff --git a/hosts/lab/ntfy.nix b/hosts/lab/ntfy.nix new file mode 100644 index 0000000..fb664db --- /dev/null +++ b/hosts/lab/ntfy.nix @@ -0,0 +1,31 @@ +{ ... }: +{ + services.caddy.virtualHosts."ntfy.ily.rs" = { + extraConfig = '' + reverse_proxy localhost:8082 + encode zstd gzip + ''; + }; + + virtualisation.oci-containers.containers.ntfy = { + image = "binwiederhier/ntfy:v2.13.0"; + podman.user = "podman"; + cmd = [ "serve" ]; + ports = [ "127.0.0.1:8082:80" ]; + volumes = [ + "/srv/ntfy/cache:/var/cache/ntfy" + ]; + environment = { + NTFY_BASE_URL = "https://ntfy.ily.rs"; + NTFY_CACHE_FILE = "/var/cache/ntfy/cache.db"; + NTFY_BEHIND_PROXY = "true"; + }; + }; + + systemd.tmpfiles.rules = [ + "d /srv/ntfy/cache 0750 podman podman -" + ]; + + # Workaround for NixOS/nixpkgs#410857 until backport of #475089 lands + systemd.services.podman-ntfy.serviceConfig.Delegate = true; +}