(address . guix-patches@gnu.org)(name . Bruno Victal)(address . mirai@makinata.eu)
I am starting a new thread and will close the old one, since the subject
changed. Not sure this is the right way.
This is a follow-up of https://issues.guix.gnu.org/60752
As Bruno Victal <mirai@makinata.eu> writes:
Toggle quote (10 lines)
> Hi,
>
> Does connman absolutely require a wireless adapter backend?
> IMO if that's not the case, neither iwd nor wpa-supplicant backends should be pulled by connman. (or at least they should be required only if they are present among the services field)
> This is because not every machine comes or wants to use a wireless adapter.
>
>
> Cheers,
> Bruno
This patch allows users to disable wireless adapters or hook in a another
implementation like iwd, without breaking existing installations.
From 379d4afac343101a2351bab4f314496395828d8d Mon Sep 17 00:00:00 2001
From: Declan Tsien <declantsien@riseup.net>
Date: Sat, 14 Jan 2023 08:57:02 +0800
Subject: [PATCH] services: connman: Add option to disable wpa-supplicant.
* gnu/services/networking.scm
(connman-configuration)[disable-wpa-supplicant?]: New field.
(connman-shepherd-service): Applied disable-wpa-supplicant? logic.
* doc/guix.texi: Add information about connman-configuration
disable-wpa-supplicant? option.
---
doc/guix.texi | 4 ++++
gnu/services/networking.scm | 20 ++++++++++++--------
2 files changed, 16 insertions(+), 8 deletions(-)
Toggle diff (65 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index 751d0957d8..29be830bd4 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -19726,6 +19726,10 @@ The connman package to use.
@item @code{disable-vpn?} (default: @code{#f})
When true, disable connman's vpn plugin.
+
+@item @code{disable-wpa-supplicant?} (default: @code{#f})
+When true, remove @code{wpa-supplicant} requirement. Let users disable
+wireless adapters or hook in a another implementation like @code{iwd}.
@end table
@end deftp
diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm
index 702404bc6c..39162fe822 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 © 2023 Declan Tsien <declantsien@riseup.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -1262,10 +1263,12 @@ (define network-manager-service-type
(define-record-type* <connman-configuration>
connman-configuration make-connman-configuration
connman-configuration?
- (connman connman-configuration-connman
- (default connman))
- (disable-vpn? connman-configuration-disable-vpn?
- (default #f)))
+ (connman connman-configuration-connman
+ (default connman))
+ (disable-vpn? connman-configuration-disable-vpn?
+ (default #f))
+ (disable-wpa-supplicant? connman-configuration-disable-wpa-supplicant?
+ (default #f)))
(define (connman-activation config)
(let ((disable-vpn? (connman-configuration-disable-vpn? config)))
@@ -1280,13 +1283,14 @@ (define (connman-shepherd-service config)
"Return a shepherd service for Connman"
(and
(connman-configuration? config)
- (let ((connman (connman-configuration-connman config))
- (disable-vpn? (connman-configuration-disable-vpn? config)))
+ (let ((connman (connman-configuration-connman config))
+ (disable-vpn? (connman-configuration-disable-vpn? config))
+ (disable-wpa-supplicant? (connman-configuration-disable-wpa-supplicant? config)))
(list (shepherd-service
(documentation "Run Connman")
(provision '(networking))
- (requirement
- '(user-processes dbus-system loopback wpa-supplicant))
+ (requirement (append '(user-processes dbus-system loopback)
+ (if disable-wpa-supplicant? '() '(wpa-supplicant))))
(start #~(make-forkexec-constructor
(list (string-append #$connman
"/sbin/connmand")
--
2.38.1
-----BEGIN PGP SIGNATURE-----
iQHLBAEBCAA1FiEE9pXznsYl4IEztXWfD8aHA3Xv4vUFAmPCCaoXHGRlY2xhbnRz
aWVuQHJpc2V1cC5uZXQACgkQD8aHA3Xv4vWhGAv/aOc7eFPX2VdNgq4+KycnaunF
Vbn/Fk5Ms99ya4s4UDSOk7eBF1rc0ooIfXZI4MplLit4KIJYy+Voe1a41m7U5PZx
Slsdhr19OSSkqLGaqsaubeUQJT+JgXT/WWvA7c7bU1xjJxdOrxaugY5l72GxY1Jo
f3NL9DxJaEL5AGypB+F2IX5e1bt6PD+z8EhFNaCYi+gVtnf0yvMPZ9t7wbqwKkiS
PcwB6/jPa2KREuaECw7WuoSOvqqzoU/+6TM8g6OAD3W4Kc8xQCdWgICE4G9gzhXV
LpjrK9Pox9ZJ7SBEJXIPWR3KXQHeTEN5I1Oc25u9BY6PVJjpPLfMjQ0uw7SME5It
DSvclituhOgv7TEyq5TiZtPbZIkyaSgkxaPBuk6jfw1zmnDgZ0B3PyTAllB5NWln
IpOvYXL/jN2+ao31L6qcpMPth1YkzAVU3rSBZPKoPbU/G/Mj0P1dDte/D4Cgl8vJ
bep9nb6lCE44Avy8nwL7nKFoT4S2c7ax6oESbM/C
=9frX
-----END PGP SIGNATURE-----