diff --git a/configuration.nix b/configuration.nix index 1d0d724..2b0bbb0 100644 --- a/configuration.nix +++ b/configuration.nix @@ -90,6 +90,7 @@ ./modules/networking.nix ./modules/datasync.nix ./modules/virtualization.nix + ./modules/monitoring.nix ]; } diff --git a/modules/monitoring.nix b/modules/monitoring.nix new file mode 100644 index 0000000..06c9cbf --- /dev/null +++ b/modules/monitoring.nix @@ -0,0 +1,23 @@ +{ config, lib, pkgs, ... }: + +{ + # Notify when a disk starts going haywire + services.smartd = { + enable = true; + 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"; + }; +}