(address . guix-patches@gnu.org)
From d15947bcbfd16b1509df555a2b05a5639dec923a Mon Sep 17 00:00:00 2001
From: Declan Tsien <declantsien@riseup.net>
Date: Thu, 12 Jan 2023 18:37:51 +0800
Subject: [PATCH] services: connman: Add iwd backend support.
* gnu/services/networking.scm (connman-configuration)[iwd?]: New
field.
(connman-shepherd-service): Applied iwd? logic.
* doc/guix.texi: Add information about connman-configuration iwd? option.
---
doc/guix.texi | 3 +++
gnu/services/networking.scm | 13 +++++++++----
2 files changed, 12 insertions(+), 4 deletions(-)
Toggle diff (63 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index 751d0957d8..ac483dacb9 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -19726,6 +19726,9 @@ The connman package to use.
@item @code{disable-vpn?} (default: @code{#f})
When true, disable connman's vpn plugin.
+
+@item @code{iwd?} (default: @code{#f})
+When true, ConnMan uses iwd to connect to wireless networks.
@end table
@end deftp
diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm
index 702404bc6c..f24c8f7063 100644
--- a/gnu/services/networking.scm
+++ b/gnu/services/networking.scm
@@ -19,6 +19,7 @@
;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
;;; Copyright © 2021 Guillaume Le Vaillant <glv@posteo.net>
;;; Copyright © 2022 Andrew Tropin <andrew@trop.in>
+;;; Copyright © 2022 Declan Tsien <declantsien@riseup.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -1265,7 +1266,8 @@ (define-record-type* <connman-configuration>
(connman connman-configuration-connman
(default connman))
(disable-vpn? connman-configuration-disable-vpn?
- (default #f)))
+ (default #f))
+ (iwd? connman-configuration-iwd? (default #f)))
(define (connman-activation config)
(let ((disable-vpn? (connman-configuration-disable-vpn? config)))
@@ -1281,18 +1283,21 @@ (define (connman-shepherd-service config)
(and
(connman-configuration? config)
(let ((connman (connman-configuration-connman config))
- (disable-vpn? (connman-configuration-disable-vpn? config)))
+ (disable-vpn? (connman-configuration-disable-vpn? config))
+ (iwd? (connman-configuration-iwd? config)))
(list (shepherd-service
(documentation "Run Connman")
(provision '(networking))
(requirement
- '(user-processes dbus-system loopback wpa-supplicant))
+ (append '(user-processes dbus-system loopback)
+ (if iwd? '(iwd) '(wpa-supplicant))))
(start #~(make-forkexec-constructor
(list (string-append #$connman
"/sbin/connmand")
"--nodaemon"
"--nodnsproxy"
- #$@(if disable-vpn? '("--noplugin=vpn") '()))
+ #$@(if disable-vpn? '("--noplugin=vpn") '())
+ #$@(if iwd? '("--wifi=iwd_agent") '()))
;; As connman(8) notes, when passing '-n', connman
;; "directs log output to the controlling terminal in
--
2.38.1
-----BEGIN PGP SIGNATURE-----
iQHLBAEBCAA1FiEE9pXznsYl4IEztXWfD8aHA3Xv4vUFAmPAA5sXHGRlY2xhbnRz
aWVuQHJpc2V1cC5uZXQACgkQD8aHA3Xv4vViYwwAmolZNLg7R6PNeTP+9c6Hanc+
tK3MceBKWhhdw8uoW8mcSjQ48tQOTz1ekxuaw1fFKhPLse2Nt7aUyMmkwBSOTqKF
Yl8YZy+Ykx3n1BhE9OyFnXnel5fXe1sZkfzU+jlqJsTPkrhGfenLepGSQ8XwsfLJ
pxfIezb29+YYcb/CyuVFmfjpNcmRUGu86bEWSORD6D1MJhXPOysKOQWw8YyTiDV/
JueE+kSJhn4odeYBUgpMfKwzWo27DgrKTO8SIpv+4lLecep0CSav7Brpao/15mrw
OzbyoBNv4kg4NL8aoejYVL1tnN77tCDNo2sw1aSWgwuBX5+YDuqBBhbOgi3/9Kjg
q5cvk7ohEuakeAvFILNJnGi7agEFMGs1Jwf6+SGRcQGRqdbXoeN8N5UCcHGg+74u
r4//TfTbyY774Fb1bGedkaLy9cgcIOJanTXo8oj+w3NxZD5qtYmRDwX7NM+OnTRa
t/4JxcnOa8d/AFXMSs2COte8WFr6oQgYLiNDfQmu
=sfc0
-----END PGP SIGNATURE-----