From d5b6456f40fd5f387390295598ee5838e8def00c Mon Sep 17 00:00:00 2001 From: Jack Cummings Date: Sun, 24 Feb 2013 03:11:45 -0800 Subject: [PATCH 1/2] proper hostapd dependencies --- modules/services/networking/hostapd.nix | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/modules/services/networking/hostapd.nix b/modules/services/networking/hostapd.nix index 42779494b4b..ca17c92ddc0 100644 --- a/modules/services/networking/hostapd.nix +++ b/modules/services/networking/hostapd.nix @@ -146,10 +146,17 @@ 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 ]; + + after = [ "${cfg.interface}-cfg.service" "nat.service" "bind.service" "dhcpd.service"]; + + serviceConfig = + { ExecStart = "${pkgs.hostapd}/bin/hostapd ${configFile}"; + Restart = "always"; + }; }; }; } From edc12de8c9de9a9ba425d86a9aeea034acd2390e Mon Sep 17 00:00:00 2001 From: Jack Cummings Date: Fri, 12 Apr 2013 23:25:32 -0700 Subject: [PATCH 2/2] add wantedBy network.target so that hostapd starts by default --- modules/services/networking/hostapd.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/services/networking/hostapd.nix b/modules/services/networking/hostapd.nix index ca17c92ddc0..4edea12b6be 100644 --- a/modules/services/networking/hostapd.nix +++ b/modules/services/networking/hostapd.nix @@ -150,6 +150,7 @@ in { description = "hostapd wireless AP"; path = [ pkgs.hostapd ]; + wantedBy = [ "network.target" ]; after = [ "${cfg.interface}-cfg.service" "nat.service" "bind.service" "dhcpd.service"];