nixos/smartd: allow extra cli options for daemon

This enables further customization of smartd.

authored by Kevin Hanselman and committed by Bjørn Forsman 65fb15aa 58fd7719

+15 -3
+15 -3
nixos/modules/services/monitoring/smartd.nix
··· 64 "DEVICESCAN ${notifyOpts}${cfg.defaults.autodetected}"} 65 ''; 66 67 - smartdOpts = { name, ... }: { 68 69 options = { 70 ··· 105 106 Set to false to monitor the devices listed in 107 <option>services.smartd.devices</option> only. 108 ''; 109 }; 110 ··· 197 devices = mkOption { 198 default = []; 199 example = [ { device = "/dev/sda"; } { device = "/dev/sdb"; options = "-d sat"; } ]; 200 - type = with types; listOf (submodule smartdOpts); 201 description = "List of devices to monitor."; 202 }; 203 ··· 222 223 path = [ pkgs.nettools ]; # for hostname and dnsdomanname calls in smartd 224 225 - serviceConfig.ExecStart = "${pkgs.smartmontools}/sbin/smartd --no-fork --configfile=${smartdConf}"; 226 }; 227 228 };
··· 64 "DEVICESCAN ${notifyOpts}${cfg.defaults.autodetected}"} 65 ''; 66 67 + smartdDeviceOpts = { name, ... }: { 68 69 options = { 70 ··· 105 106 Set to false to monitor the devices listed in 107 <option>services.smartd.devices</option> only. 108 + ''; 109 + }; 110 + 111 + extraOptions = mkOption { 112 + default = []; 113 + type = types.listOf types.str; 114 + example = ["-A /var/log/smartd/" "--interval=3600"]; 115 + description = '' 116 + Extra command-line options passed to the <literal>smartd</literal> 117 + daemon on startup. 118 + 119 + (See <literal>man 8 smartd</literal>.) 120 ''; 121 }; 122 ··· 209 devices = mkOption { 210 default = []; 211 example = [ { device = "/dev/sda"; } { device = "/dev/sdb"; options = "-d sat"; } ]; 212 + type = with types; listOf (submodule smartdDeviceOpts); 213 description = "List of devices to monitor."; 214 }; 215 ··· 234 235 path = [ pkgs.nettools ]; # for hostname and dnsdomanname calls in smartd 236 237 + serviceConfig.ExecStart = "${pkgs.smartmontools}/sbin/smartd ${lib.concatStringsSep " " cfg.extraOptions} --no-fork --configfile=${smartdConf}"; 238 }; 239 240 };