add comments for notifications

This commit is contained in:
Noah Masur 2023-07-29 08:23:17 -04:00
parent 1f0b04b89b
commit 9f561c822c

View File

@ -28,6 +28,8 @@
upper = "06:00"; upper = "06:00";
}; };
}; };
# Create an email notification service for failed jobs
systemd.services."notify-email@" = systemd.services."notify-email@" =
let address = "system@${config.mail.server}"; let address = "system@${config.mail.server}";
in { in {
@ -48,6 +50,8 @@
${address} < $TEMPFILE ${address} < $TEMPFILE
''; '';
}; };
# Send an email whenever auto upgrade fails
systemd.services.nixos-upgrade.onFailure = systemd.services.nixos-upgrade.onFailure =
lib.mkIf config.systemd.services."notify-email@".enable lib.mkIf config.systemd.services."notify-email@".enable
[ "notify-email@%i.service" ]; [ "notify-email@%i.service" ];