mirror of
https://github.com/tomasriveral/nixos.git
synced 2026-08-12 02:28:37 +02:00
setup agenix and migrate from matrix-commander-rs to ntfy for phone notifications
This commit is contained in:
@@ -289,7 +289,6 @@
|
||||
"custom-checkKdrive && custom-mountkdrive" # checks if the remote works and mount it
|
||||
#"waybar"
|
||||
"custom-gitnotify"
|
||||
"custom-checkMatrix" # checks if matrix-commander-rs is connected which is important for other stuff
|
||||
#"custom-obsidianbackup" # backups the obsidian notes to kdrive and to a timed hidden dir (~/.Notes.backup/)
|
||||
#"QS-notifycache" # builds the cache that will be used for the notification history
|
||||
"sleep 4 & caelestia-shell" #works better if it sleeps a bit before
|
||||
|
||||
@@ -48,11 +48,12 @@
|
||||
name = "custom-checkKdrive";
|
||||
runtimeInputs = with pkgs; [
|
||||
rclone
|
||||
matrix-commander-rs
|
||||
curl
|
||||
libnotify
|
||||
];
|
||||
text = ''
|
||||
|
||||
# shellcheck disable=SC1091
|
||||
source /run/agenix/ntfy
|
||||
# waits for an internet connection. It pings both Google DNS and Cloudfare dns in case one of them is down
|
||||
until ping -c1 -W1 1.1.1.1 >/dev/null 2>&1 || \
|
||||
ping -c1 -W1 8.8.8.8 >/dev/null 2>&1
|
||||
@@ -72,9 +73,11 @@
|
||||
else
|
||||
echo "kdrive rclone failed with error: $output"
|
||||
notify-send "rclone kdrive failed" "$output"
|
||||
matrix-commander-rs --verbose -m "rclone kdrive failed.<br>Error: <pre>$output</pre><br><a href=\"https://matrix.to/#/@notificationbot_0000:matrix.org\">@notificationbot_0000</a>" \
|
||||
--html \
|
||||
-r "\!BXRRokBmEdNOyYdfOF:matrix.org"
|
||||
curl \
|
||||
-u ":$NTFY_TOKEN" \
|
||||
-d "Rclone couldnt access kdrive (rclone lsd kdrive). Error: $output" \
|
||||
-H "Title: Rclone kdrive" \
|
||||
"$NTFY_SERVER/Alerts"
|
||||
fi
|
||||
'';
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user