summary refs log tree commit diff
path: root/modules/services/networking/hostapd.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/services/networking/hostapd.nix')
-rw-r--r--modules/services/networking/hostapd.nix16
1 files changed, 12 insertions, 4 deletions
diff --git a/modules/services/networking/hostapd.nix b/modules/services/networking/hostapd.nix
index 42779494b4b8..4edea12b6be8 100644
--- a/modules/services/networking/hostapd.nix
+++ b/modules/services/networking/hostapd.nix
@@ -146,10 +146,18 @@ in
 
     environment.systemPackages =  [ pkgs.hostapd ];
 
-    jobs.hostapd =
-      { startOn = "started network-interfaces";
-        stopOn = "stopping network-interfaces";
-        exec = "${pkgs.hostapd}/bin/hostapd ${configFile}";
+    systemd.services.hostapd =
+      { description = "hostapd wireless AP";
+
+        path = [ pkgs.hostapd ]; 
+        wantedBy = [ "network.target" ];
+
+        after = [ "${cfg.interface}-cfg.service" "nat.service" "bind.service" "dhcpd.service"];
+
+        serviceConfig = 
+          { ExecStart = "${pkgs.hostapd}/bin/hostapd ${configFile}";
+            Restart = "always";
+          };
       };
   };
 }