setup agenix and migrate from matrix-commander-rs to ntfy for phone notifications

This commit is contained in:
2026-07-26 15:53:57 +02:00
parent 2107d23209
commit 5db8135dd5
6 changed files with 99 additions and 62 deletions
+25 -12
View File
@@ -103,6 +103,8 @@
];
text = ''
# shellcheck disable=SC1090
source "$NTFY_SECRET"
set -e
FLAKE_DIR="/home/tomasr/nixos"
@@ -128,9 +130,11 @@
notify-send "Flake autoupdate" "Rebuild OK"
matrix-commander-rs --verbose -m "Flake rebuild succesfull.<br><a href=\"https://matrix.to/#/@notificationbot_0000:matrix.org\">@notificationbot_0000</a>" \
--html \
-r "\!BXRRokBmEdNOyYdfOF:matrix.org"
curl \
-u ":$NTFY_TOKEN" \
-d "Laptop Flake rebuild successful" \
-H "Title: Flake autoupdate" \
"$NTFY_SERVER/Alerts"
else
notify-send "Flake autoupdate" "No changes"
git -C "$FLAKE_DIR" push
@@ -141,9 +145,12 @@
notify-send -u critical "Flake autoupdate" "FAILED"
matrix-commander-rs --verbose -m "Flake rebuild failed.<br>Error: <pre>$ERROR_MSG</pre><br><a href=\"https://matrix.to/#/@notificationbot_0000:matrix.org\">@notificationbot_0000</a>" \
--html \
-r "\!BXRRokBmEdNOyYdfOF:matrix.org"
curl \
-u ":$NTFY_TOKEN" \
-d "Laptop Flake rebuild failed. Error: $ERROR_MSG" \
-H "Title: Flake autoupdate FAILED" \
-H "Priority: urgent" \
"$NTFY_SERVER/Alerts"
git -C "$FLAKE_DIR" reset --hard "pre-autoupdate-$TIME"
fi
@@ -189,9 +196,12 @@
notify-send "Flake autoupdate" "Rebuild OK"
matrix-commander-rs --verbose -m "Flake rebuild succesfull.<br><a href=\"https://matrix.to/#/@notificationbot_0000:matrix.org\">@notificationbot_0000</a>" \
--html \
-r "\!BXRRokBmEdNOyYdfOF:matrix.org"
curl \
-u ":$NTFY_TOKEN" \
-d "Flake rebuild successful" \
-H "Title: Desktop Flake autoupdate" \
"$NTFY_SERVER/Alerts"
else
notify-send "Flake autoupdate" "No changes"
git -C "$FLAKE_DIR" push
@@ -202,9 +212,12 @@
notify-send -u critical "Flake autoupdate" "FAILED"
matrix-commander-rs --verbose -m "Flake rebuild failed.<br>Error: <pre>$ERROR_MSG</pre><br><a href=\"https://matrix.to/#/@notificationbot_0000:matrix.org\">@notificationbot_0000</a>" \
--html \
-r "\!BXRRokBmEdNOyYdfOF:matrix.org"
curl \
-u ":$NTFY_TOKEN" \
-d "Flake rebuild failed. Error: $ERROR_MSG" \
-H "Title: Desktop Flake autoupdate FAILED" \
-H "Priority: urgent" \
"$NTFY_SERVER/Alerts"
git -C "$FLAKE_DIR" reset --hard "pre-autoupdate-$TIME"
fi