Commit 8a51bf3aaf71
Changed files (1)
home
common
services
home/common/services/mail-monitor.nix
@@ -186,10 +186,13 @@ let
# Send ntfy notification if token is available
if TOKEN=$(${pkgs.passage}/bin/passage show ntfy/token 2>/dev/null); then
- ${pkgs.ntfy-sh}/bin/ntfy publish \
- --token "$TOKEN" \
- infrastructure.sbr.pm \
- "⚠️ Mail service $SERVICE_NAME failed" || true
+ ${pkgs.curl}/bin/curl -s \
+ -H "Authorization: Bearer $TOKEN" \
+ -H "Title: ⚠️ Mail Service Failed: $SERVICE_NAME" \
+ -H "Priority: high" \
+ -H "Tags: warning,mail,envelope" \
+ -d "Mail service $SERVICE_NAME failed. Check logs: journalctl --user -u $SERVICE_NAME" \
+ "https://ntfy.sbr.pm/homelab" || true
fi
'';
in
@@ -214,7 +217,7 @@ in
Service = {
Type = "oneshot";
Environment = [
- "PATH=${pkgs.bash}/bin:${pkgs.coreutils}/bin:${pkgs.ntfy-sh}/bin:${pkgs.passage}/bin"
+ "PATH=${pkgs.bash}/bin:${pkgs.coreutils}/bin:${pkgs.curl}/bin:${pkgs.passage}/bin"
"PASSAGE_DIR=/home/vincent/.local/share/passage"
"PASSAGE_IDENTITIES_FILE=/home/vincent/.local/share/passage/identities"
];