mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-10-24 12:10:33 -04:00
49 lines
620 B
Nix
49 lines
620 B
Nix
|
{ 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";
|
||
|
};
|
||
|
|
||
|
};
|
||
|
|
||
|
}
|