guix-commits
[Top][All Lists]
Advanced

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

02/02: services: network-manager: Add iwd backend support.


From: guix-commits
Subject: 02/02: services: network-manager: Add iwd backend support.
Date: Thu, 1 Dec 2022 10:02:17 -0500 (EST)

abcdw pushed a commit to branch master
in repository guix.

commit 0823fd1aa9e63b6021eb04d0d41d5c55ad328ebf
Author: Andrew Tropin <andrew@trop.in>
AuthorDate: Thu Dec 1 17:21:39 2022 +0400

    services: network-manager: Add iwd backend support.
    
    * gnu/services/networking.scm (network-manager-configuration)[iwd?]: New
    field.
    (network-manager-shepherd-service): Add iwd to requirements if needed.
    * doc/guix.texi: Add information about iwd? option.
---
 doc/guix.texi               |  4 ++++
 gnu/services/networking.scm | 13 +++++++++----
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 47b805dc7f..c482e932d9 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -19583,6 +19583,10 @@ This is the list of available plugins for virtual 
private networks
 (VPNs).  An example of this is the @code{network-manager-openvpn}
 package, which allows NetworkManager to manage VPNs @i{via} OpenVPN.
 
+@item @code{iwd?} (default: @code{#f})
+NetworkManager will use iwd as a backend for wireless networking if this
+option is set to @code{#t}, otherwise it will use wpa-supplicant.
+
 @end table
 @end deftp
 
diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm
index de02f16a34..a2ead9ef11 100644
--- a/gnu/services/networking.scm
+++ b/gnu/services/networking.scm
@@ -18,6 +18,7 @@
 ;;; Copyright © 2021 Christine Lemmer-Webber <cwebber@dustycloud.org>
 ;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
 ;;; Copyright © 2021 Guillaume Le Vaillant <glv@posteo.net>
+;;; Copyright © 2022 Andrew Tropin <andrew@trop.in>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1143,7 +1144,8 @@ project's documentation} for more information."
   (dns network-manager-configuration-dns
        (default "default"))
   (vpn-plugins network-manager-configuration-vpn-plugins ;list of file-like
-               (default '())))
+               (default '()))
+  (iwd? network-manager-configuration-iwd? (default #f)))
 
 (define network-manager-activation
   ;; Activation gexp for NetworkManager
@@ -1199,14 +1201,17 @@ project's documentation} for more information."
 
 (define network-manager-shepherd-service
   (match-lambda
-    (($ <network-manager-configuration> network-manager dns vpn-plugins)
+    (($ <network-manager-configuration> network-manager dns vpn-plugins iwd?)
      (let ((conf (plain-file "NetworkManager.conf"
-                             (string-append "[main]\ndns=" dns "\n")))
+                             (string-append
+                              "[main]\ndns=" dns "\n"
+                              (if iwd? "[device]\nwifi.backend=iwd\n" ""))))
            (vpn  (vpn-plugin-directory vpn-plugins)))
        (list (shepherd-service
               (documentation "Run the NetworkManager.")
               (provision '(networking))
-              (requirement '(user-processes dbus-system wpa-supplicant 
loopback))
+              (requirement (append '(user-processes dbus-system loopback)
+                                   (if iwd? '(iwd) '(wpa-supplicant))))
               (start #~(make-forkexec-constructor
                         (list (string-append #$network-manager
                                              "/sbin/NetworkManager")



reply via email to

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