Author: simons
Date: Wed Jul 13 17:47:34 2011
New Revision: 27767
URL: https://svn.nixos.org/websvn/nix/?rev=27767&sc=1

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

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

Added:
   nixos/trunk/modules/services/monitoring/smartd.nix
Modified:
   nixos/trunk/modules/module-list.nix

Modified: nixos/trunk/modules/module-list.nix
==============================================================================
--- nixos/trunk/modules/module-list.nix Wed Jul 13 16:49:33 2011        (r27766)
+++ nixos/trunk/modules/module-list.nix Wed Jul 13 17:47:34 2011        (r27767)
@@ -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

Added: nixos/trunk/modules/services/monitoring/smartd.nix
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ nixos/trunk/modules/services/monitoring/smartd.nix  Wed Jul 13 17:47:34 
2011        (r27767)
@@ -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";
+      };
+
+  };
+
+}
_______________________________________________
nix-commits mailing list
[email protected]
http://mail.cs.uu.nl/mailman/listinfo/nix-commits

Reply via email to