summary refs log tree commit diff
path: root/nixos/modules/services/monitoring/monit.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/modules/services/monitoring/monit.nix')
-rw-r--r--nixos/modules/services/monitoring/monit.nix16
1 files changed, 5 insertions, 11 deletions
diff --git a/nixos/modules/services/monitoring/monit.nix b/nixos/modules/services/monitoring/monit.nix
index 642fac3b3a01..704693969a35 100644
--- a/nixos/modules/services/monitoring/monit.nix
+++ b/nixos/modules/services/monitoring/monit.nix
@@ -19,10 +19,6 @@ in
         default = "";
         description = "monit.conf content";
       };
-      startOn = mkOption {
-        default = "started network-interfaces";
-        description = "What Monit supposes to be already present";
-      };
     };
   };
 
@@ -39,14 +35,12 @@ in
       }
     ];
 
-    jobs.monit = {
+    systemd.services.monit = {
       description = "Monit system watcher";
-
-      startOn = config.services.monit.startOn;
-
-      exec = "${pkgs.monit}/bin/monit -I -c /etc/monit.conf";
-
-      respawn = true;
+      after = [ "network-interfaces.target" ];
+      wantedBy = [ "multi-user.target" ];
+      script = "${pkgs.monit}/bin/monit -I -c /etc/monit.conf";
+      serviceConfig.Restart = "always";
     };
   };
 }