guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/03: services: Add wpa-supplicant-service.


From: Tomas Cech
Subject: 02/03: services: Add wpa-supplicant-service.
Date: Mon, 14 Nov 2016 23:20:46 +0000 (UTC)

sleep_walker pushed a commit to branch master
in repository guix.

commit 2cccbc2af25c6e65167fb471560c5384cb9c2fe2
Author: Tomáš Čech <address@hidden>
Date:   Wed Nov 9 21:38:38 2016 +0100

    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.
---
 doc/guix.texi               |    9 +++++++++
 gnu/services/networking.scm |   31 ++++++++++++++++++++++++++++++-
 2 files changed, 39 insertions(+), 1 deletion(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 9a95e18..a3eba58 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -8397,6 +8397,15 @@ several the @command{connmanctl} command to interact 
with the daemon and
 configure networking."
 @end deffn
 
address@hidden WPA Supplicant
address@hidden {Scheme Procedure} wpa-supplicant-service @
+       [#:wpa-supplicant @var{wpa-supplicant}]
+Return a service that runs @url{https://w1.fi/wpa_supplicant/,WPA
+supplicant}, an authentication daemon required to authenticate against
+encrypted WiFi or ethernet networks. Service is started to listen for
+requests on D-Bus.
address@hidden deffn
+
 @cindex NTP
 @cindex real time clock
 @deffn {Scheme Procedure} ntp-service [#:ntp @var{ntp}] @
diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm
index df609da..5ec29af 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]