1
0
Fork 0

Services: enable email for smartd

This commit is contained in:
Aires 2024-11-22 12:47:18 -05:00
parent 5394097670
commit 58d4b5a1e5
2 changed files with 31 additions and 13 deletions

View file

@ -36,8 +36,9 @@ in
###*** Configure your system below this line. ***### ###*** Configure your system below this line. ***###
services = {
# Enable dynamic DNS with Porkbun # Enable dynamic DNS with Porkbun
services.ddclient = { ddclient = {
enable = true; enable = true;
configFile = pkgs.writeText "ddclient.conf" '' configFile = pkgs.writeText "ddclient.conf" ''
use=web, web=checkip.dyndns.com/, web-skip='IP Address' use=web, web=checkip.dyndns.com/, web-skip='IP Address'
@ -50,6 +51,15 @@ in
''; '';
}; };
# Monitor RAID drives using SMART
smartd.devices = [
{ device = "/dev/sda"; }
{ device = "/dev/sdb"; }
{ device = "/dev/sdc"; }
{ device = "/dev/sdd"; }
];
};
# Configure the system. # Configure the system.
aux.system = { aux.system = {
# Enable to allow unfree (e.g. closed source) packages. # Enable to allow unfree (e.g. closed source) packages.

View file

@ -58,7 +58,15 @@ in
smartd = { smartd = {
enable = true; enable = true;
autodetect = true; autodetect = true;
notifications.wall.enable = true; notifications = {
wall.enable = true;
mail = lib.mkIf config.aux.system.services.msmtp.enable {
enable = true;
mailer = "/run/wrappers/bin/sendmail";
sender = "${config.networking.hostName}@${config.secrets.networking.domains.primary}";
recipient = config.secrets.users.aires.email;
};
};
}; };
}; };