Loading nixos/modules/services/monitoring/scrutiny.nix +38 −38 Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ let inherit (lib) maintainers; inherit (lib.meta) getExe; inherit (lib.modules) mkIf; inherit (lib.modules) mkIf mkMerge; inherit (lib.options) literalExpression mkEnableOption mkOption mkPackageOption; inherit (lib.types) bool enum nullOr port str submodule; Loading Loading @@ -156,27 +156,19 @@ in }; }; config = mkIf (cfg.enable || cfg.collector.enable) { config = mkMerge [ (mkIf cfg.enable { services.influxdb2.enable = cfg.influxdb.enable; networking.firewall = mkIf cfg.openFirewall { allowedTCPPorts = [ cfg.settings.web.listen.port ]; }; services.smartd = mkIf cfg.collector.enable { enable = true; extraOptions = [ "-A /var/log/smartd/" "--interval=600" ]; }; systemd = { services = { scrutiny = mkIf cfg.enable { systemd.services.scrutiny = { description = "Hard Drive S.M.A.R.T Monitoring, Historical Trends & Real World Failure Thresholds"; wantedBy = [ "multi-user.target" ]; after = [ "network.target" ]; after = [ "network.target" ] ++ lib.optional cfg.influxdb.enable "influxdb2.service"; wants = lib.optional cfg.influxdb.enable "influxdb2.service"; environment = { SCRUTINY_VERSION = "1"; SCRUTINY_WEB_DATABASE_LOCATION = "/var/lib/scrutiny/scrutiny.db"; Loading @@ -190,8 +182,18 @@ in StateDirectoryMode = "0750"; }; }; }) (mkIf cfg.collector.enable { services.smartd = { enable = true; extraOptions = [ "-A /var/log/smartd/" "--interval=600" ]; }; scrutiny-collector = mkIf cfg.collector.enable { systemd = { services.scrutiny-collector = { description = "Scrutiny Collector Service"; environment = { COLLECTOR_VERSION = "1"; Loading @@ -203,13 +205,11 @@ in }; startAt = cfg.collector.schedule; }; }; timers = mkIf cfg.collector.enable { scrutiny-collector.timerConfig.Persistent = true; }; }; timers.scrutiny-collector.timerConfig.Persistent = true; }; }) ]; meta.maintainers = [ maintainers.jnsgruk ]; } Loading
nixos/modules/services/monitoring/scrutiny.nix +38 −38 Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ let inherit (lib) maintainers; inherit (lib.meta) getExe; inherit (lib.modules) mkIf; inherit (lib.modules) mkIf mkMerge; inherit (lib.options) literalExpression mkEnableOption mkOption mkPackageOption; inherit (lib.types) bool enum nullOr port str submodule; Loading Loading @@ -156,27 +156,19 @@ in }; }; config = mkIf (cfg.enable || cfg.collector.enable) { config = mkMerge [ (mkIf cfg.enable { services.influxdb2.enable = cfg.influxdb.enable; networking.firewall = mkIf cfg.openFirewall { allowedTCPPorts = [ cfg.settings.web.listen.port ]; }; services.smartd = mkIf cfg.collector.enable { enable = true; extraOptions = [ "-A /var/log/smartd/" "--interval=600" ]; }; systemd = { services = { scrutiny = mkIf cfg.enable { systemd.services.scrutiny = { description = "Hard Drive S.M.A.R.T Monitoring, Historical Trends & Real World Failure Thresholds"; wantedBy = [ "multi-user.target" ]; after = [ "network.target" ]; after = [ "network.target" ] ++ lib.optional cfg.influxdb.enable "influxdb2.service"; wants = lib.optional cfg.influxdb.enable "influxdb2.service"; environment = { SCRUTINY_VERSION = "1"; SCRUTINY_WEB_DATABASE_LOCATION = "/var/lib/scrutiny/scrutiny.db"; Loading @@ -190,8 +182,18 @@ in StateDirectoryMode = "0750"; }; }; }) (mkIf cfg.collector.enable { services.smartd = { enable = true; extraOptions = [ "-A /var/log/smartd/" "--interval=600" ]; }; scrutiny-collector = mkIf cfg.collector.enable { systemd = { services.scrutiny-collector = { description = "Scrutiny Collector Service"; environment = { COLLECTOR_VERSION = "1"; Loading @@ -203,13 +205,11 @@ in }; startAt = cfg.collector.schedule; }; }; timers = mkIf cfg.collector.enable { scrutiny-collector.timerConfig.Persistent = true; }; }; timers.scrutiny-collector.timerConfig.Persistent = true; }; }) ]; meta.maintainers = [ maintainers.jnsgruk ]; }