summary refs log tree commit diff
path: root/gnu/services/networking.scm
diff options
context:
space:
mode:
authorTomáš Čech <sleep_walker@gnu.org>2016-11-09 21:38:38 +0100
committerTomáš Čech <sleep_walker@gnu.org>2016-11-15 00:19:17 +0100
commit2cccbc2af25c6e65167fb471560c5384cb9c2fe2 (patch)
treefcb09234100808c2f84253e23600141db6bfe382 /gnu/services/networking.scm
parent028bf3c0b266e47912187448ef43cdc08633649f (diff)
downloadguix-2cccbc2af25c6e65167fb471560c5384cb9c2fe2.tar.gz
services: Add wpa-supplicant-service.
* gnu/services/networking.scm (wpa-supplicant-service): New procedure.
(wpa-supplicant-service-type): New variable.
* doc/guix.texi (Networking Services): Document it.
Diffstat (limited to 'gnu/services/networking.scm')
-rw-r--r--gnu/services/networking.scm31
1 files changed, 30 insertions, 1 deletions
diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm
index df609da0de..5ec29af4bf 100644
--- a/gnu/services/networking.scm
+++ b/gnu/services/networking.scm
@@ -64,7 +64,8 @@
 
             wicd-service
             network-manager-service
-            connman-service))
+            connman-service
+            wpa-supplicant-service-type))
 
 ;;; Commentary:
 ;;;
@@ -740,4 +741,32 @@ several the @command{connmanctl} command to interact with the daemon and
 configure networking."
   (service connman-service-type connman))
 
+
+
+;;;
+;;; WPA supplicant
+;;;
+
+
+(define (wpa-supplicant-shepherd-service wpa-supplicant)
+  "Return a shepherd service for wpa_supplicant"
+  (list (shepherd-service
+         (documentation "Run WPA supplicant with dbus interface")
+         (provision '(wpa-supplicant))
+         (requirement '(user-processes dbus-system loopback))
+         (start #~(make-forkexec-constructor
+                   (list (string-append #$wpa-supplicant
+                                        "/sbin/wpa_supplicant")
+                         "-u" "-B" "-P/var/run/wpa_supplicant.pid")
+                   #:pid-file "/var/run/wpa_supplicant.pid"))
+         (stop #~(make-kill-destructor)))))
+
+(define wpa-supplicant-service-type
+  (service-type (name 'wpa-supplicant)
+                (extensions
+                 (list (service-extension shepherd-root-service-type
+                                          wpa-supplicant-shepherd-service)
+                       (service-extension dbus-root-service-type list)
+                       (service-extension profile-service-type list)))))
+
 ;;; networking.scm ends here