modules/services/monitoring/smartd.nix: added support for running smart daemon

Set "services.smartd.enable = true" to enable the service.

svn path=/nixos/trunk/; revision=27767
This commit is contained in:
Peter Simons 2011-07-13 17:47:34 +00:00
parent e056880dc4
commit fb1b0c0372
2 changed files with 50 additions and 1 deletions

View File

@ -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

View File

@ -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";
};
};
}