From 3401e1d05a7d9e8beca230018b6333fbe96234fd Mon Sep 17 00:00:00 2001 From: Ahwx Date: Mon, 28 Jul 2025 00:57:04 +0200 Subject: [PATCH] feat: enable `scrutiny` on dandelion, disable otherwise; enable `smartd` with system mailer --- modules/services/smart-monitoring.nix | 38 +++++++++++++++++---------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/modules/services/smart-monitoring.nix b/modules/services/smart-monitoring.nix index 0b4e63c..055b0ae 100644 --- a/modules/services/smart-monitoring.nix +++ b/modules/services/smart-monitoring.nix @@ -1,7 +1,15 @@ -{ config, ... }: +{ config, host, ... }: { + imports = [ ./email.nix ]; services.scrutiny = { - enable = true; + # Enable based on name of host + enable = + if (host == "dandelion") then + true + else if (host == "lily") then + true + else + false; collector.enable = true; settings.web.listen.port = 8181; settings.notify.urls = [ @@ -10,18 +18,20 @@ ]; }; - # services.smartd = { - # enable = true; - # autodetect = true; - # notifications = { - # mail = { - # enable = true; - # # mailer = "/path/to/mailer/binary"; # Need to get system emails working first - # sender = "${config.liv.variables.fromEmail}"; - # recipient = "${config.liv.variables.toEmail}"; - # }; - # }; - # }; + services.smartd = { + enable = true; + autodetect = true; + notifications = { + wall = { + enable = true; + }; + mail = { + enable = true; + sender = config.liv.variables.senderEmail; + recipient = config.liv.variables.email; + }; + }; + }; # services.nginx.virtualHosts."" = { # locations."/" = {