From 04dcdc2003b1b721a538b6f3b3eb4f6c87e85ffe Mon Sep 17 00:00:00 2001 From: cy Date: Tue, 31 Dec 2024 12:20:32 -0500 Subject: [PATCH] backup: add emoji tag to ntfy message --- modules/backup.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/backup.nix b/modules/backup.nix index 90f2f2d..fbd98dc 100644 --- a/modules/backup.nix +++ b/modules/backup.nix @@ -110,8 +110,15 @@ in title="${hostname}: backup completed with exit code: $exitStatus" msg=$(journalctl -o cat _SYSTEMD_INVOCATION_ID=$invocationId) + if [ "$exitStatus" -eq 0 ]; then + tag="v" + else + tag="rotating_light" + fi + ${pkgs.curl}/bin/curl -sL -u $(cat ${config.sops.secrets."services/ntfy".path}) \ -H "Title: $title" \ + -H "Tags: $tag" \ -d "$msg" \ https://ntfy.cything.io/backups > /dev/null '';