From 519fb5c078cc63235ac1b10baafa1d9170fa90ee Mon Sep 17 00:00:00 2001 From: Tigor Hutasuhut Date: Fri, 11 Oct 2024 10:01:12 +0700 Subject: [PATCH] valheim: added ntfy-sh notification --- system/podman/valheim.nix | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/system/podman/valheim.nix b/system/podman/valheim.nix index 0093b65..440fa5c 100644 --- a/system/podman/valheim.nix +++ b/system/podman/valheim.nix @@ -11,8 +11,8 @@ let gid = toString user.gid; base_dir = "/var/lib/${name}"; in -{ - config = mkIf (podman.enable && podman.${name}.enable) { +lib.mkMerge [ + (mkIf (podman.${name}.enable) { services.caddy.virtualHosts.${domain}.extraConfig = '' reverse_proxy ${ip}:80 ''; @@ -78,5 +78,13 @@ in "io.containers.autoupdate" = "registry"; }; }; - }; -} + }) + { + profile.services.ntfy-sh.client.settings.subscribe = [ + { + topic = "valheim"; + command = ''${pkgs.libnotify}/bin/notify-send --category=im.received --urgency=normal "$title" "$message"''; + } + ]; + } +]