summary refs log tree commit diff
path: root/nixos/modules/services/networking/ifplugd.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/modules/services/networking/ifplugd.nix')
-rw-r--r--nixos/modules/services/networking/ifplugd.nix26
1 files changed, 10 insertions, 16 deletions
diff --git a/nixos/modules/services/networking/ifplugd.nix b/nixos/modules/services/networking/ifplugd.nix
index 20bfca8f872..00b94fe2284 100644
--- a/nixos/modules/services/networking/ifplugd.nix
+++ b/nixos/modules/services/networking/ifplugd.nix
@@ -66,23 +66,17 @@ in
   ###### implementation
 
   config = mkIf cfg.enable {
-
-    jobs.ifplugd =
-      { description = "Network interface connectivity monitor";
-
-        startOn = "started network-interfaces";
-        stopOn = "stopping network-interfaces";
-
-        exec =
-          ''
-            ${ifplugd}/sbin/ifplugd --no-daemon --no-startup --no-shutdown \
-              ${if config.networking.interfaceMonitor.beep then "" else "--no-beep"} \
-              --run ${plugScript}
-          '';
-      };
+    systemd.services.ifplugd = {
+      description = "Network interface connectivity monitor";
+      after = [ "network-interfaces.target" ];
+      wantedBy = [ "multi-user.target" ];
+      script = ''
+        ${ifplugd}/sbin/ifplugd --no-daemon --no-startup --no-shutdown \
+          ${if config.networking.interfaceMonitor.beep then "" else "--no-beep"} \
+          --run ${plugScript}
+      '';
+    };
 
     environment.systemPackages = [ ifplugd ];
-
   };
-
 }