diff --git a/modules/module-list.nix b/modules/module-list.nix index ffc42eb0278..6bb0c916189 100644 --- a/modules/module-list.nix +++ b/modules/module-list.nix @@ -15,7 +15,7 @@ ./hardware/network/intel-2100bg.nix ./hardware/network/intel-2200bg.nix ./hardware/network/intel-3945abg.nix - ./hardware/network/rt73.nix + ./hardware/network/rt73.nix ./hardware/pcmcia.nix ./installer/generations-dir/generations-dir.nix ./installer/grub/grub.nix @@ -83,6 +83,7 @@ ./services/misc/virtualbox.nix ./services/monitoring/monit.nix ./services/monitoring/nagios/default.nix + ./services/monitoring/smartd.nix ./services/monitoring/systemhealth.nix ./services/monitoring/zabbix-agent.nix ./services/monitoring/zabbix-server.nix diff --git a/modules/services/monitoring/smartd.nix b/modules/services/monitoring/smartd.nix new file mode 100644 index 00000000000..bf523d4f3f8 --- /dev/null +++ b/modules/services/monitoring/smartd.nix @@ -0,0 +1,48 @@ +{ config, pkgs, ... }: + +with pkgs.lib; + +let + + cfg = config.services.smartd; + +in + +{ + ###### interface + + options = { + + services.smartd = { + + enable = mkOption { + default = false; + type = types.bool; + example = "true"; + description = '' + Run smartd from the smartmontools package. + ''; + }; + + }; + + }; + + + ###### implementation + + config = mkIf cfg.enable { + + jobs.smartd = + { description = "S.M.A.R.T. Daemon"; + + startOn = "started syslogd"; + + daemonType = "daemon"; + + exec = "${pkgs.smartmontools}/sbin/smartd"; + }; + + }; + +}