unit/modules/monitoring.nix

26 lines
586 B
Nix

{ config, lib, pkgs, ... }:
{
# Notify when a disk starts going haywire
services.smartd = {
enable = true;
autodetect = false;
devices = [ { device = "/dev/sda"; } { device = "/dev/sdb"; } ];
notifications.mail = {
enable = true;
recipient = "akasroua@gmail.com";
};
};
# Enable trivial MTA for smartd notifications
services.ssmtp = {
enable = true;
useTLS = true;
useSTARTTLS = true;
domain = "gmail.com";
hostName = "smtp.gmail.com:587";
authUser = "akasroua@gmail.com";
authPassFile = "/var/keys/ssmtp";
};
}