From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id sEE7I6vu72N17QAAbAwnHQ (envelope-from ) for ; Fri, 17 Feb 2023 22:16:27 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id KGoxI6vu72OzaQAA9RJhRA (envelope-from ) for ; Fri, 17 Feb 2023 22:16:27 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 616663DBDE for ; Fri, 17 Feb 2023 22:16:27 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pT85U-0004Vf-1V; Fri, 17 Feb 2023 16:16:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pT85K-0004U7-DS for guix-patches@gnu.org; Fri, 17 Feb 2023 16:16:06 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pT85K-0004Lx-0i for guix-patches@gnu.org; Fri, 17 Feb 2023 16:16:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pT85J-000055-PZ for guix-patches@gnu.org; Fri, 17 Feb 2023 16:16:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#61587] [PATCH 1/8] services: network-manager: Add 'shepherd-requirement' field. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 17 Feb 2023 21:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61587 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 61587@debbugs.gnu.org Cc: Bruno Victal Received: via spool by 61587-submit@debbugs.gnu.org id=B61587.167666850432666 (code B ref 61587); Fri, 17 Feb 2023 21:16:01 +0000 Received: (at 61587) by debbugs.gnu.org; 17 Feb 2023 21:15:04 +0000 Received: from localhost ([127.0.0.1]:41705 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pT84N-0008Uo-R4 for submit@debbugs.gnu.org; Fri, 17 Feb 2023 16:15:04 -0500 Received: from smtpmciv4.myservices.hosting ([185.26.107.240]:36788) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pT84L-0008Tw-ON for 61587@debbugs.gnu.org; Fri, 17 Feb 2023 16:15:02 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpmciv4.myservices.hosting (Postfix) with ESMTP id E66F52090F for <61587@debbugs.gnu.org>; Fri, 17 Feb 2023 22:15:00 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 905B18009A; Fri, 17 Feb 2023 22:15:00 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id aPuIexZBHohC; Fri, 17 Feb 2023 22:15:00 +0100 (CET) Received: from guix-nuc.home.arpa (bl9-119-177.dsl.telepac.pt [85.242.119.177]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 1E08880098; Fri, 17 Feb 2023 22:15:00 +0100 (CET) From: Bruno Victal Date: Fri, 17 Feb 2023 21:14:52 +0000 Message-Id: <52d67f14ce662f215c384b59dfe28f446b9b384a.1676667941.git.mirai@makinata.eu> X-Mailer: git-send-email 2.39.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Seal: i=1; s=key1; d=yhetil.org; t=1676668587; a=rsa-sha256; cv=none; b=JEvSb3Eooy0V2boXYp56G9ZhD0+w4O2KY7s67Qee+bjl3KBGWSj4+bS68xHzhVfx3syjsi yi6Oj/WDgD/QL0/QUXBksRo6g4xK+8UivnoXohA4YLeuw9D1tynIUpx6skS40M7GXN1ddM kWr0LX8bZhSjGfQcczTPyQFuNWgaFd3+afJrIEnU9GVkvAMIMgg4kBg+fTCrXDG3xk0q5H gCqVaEwnMtfLFFLG1vHHBB4T4EXobUGl+3mhRIU48sBadTXbNvT60+TU4Tapqr5XcVlJPS Cb0uQ/pAMTJUUd3dSfcwV/ELSqSnVmMMkgRGscsRXSqL/JeDZVTiLUM53Xb5NQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1676668587; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=Ym8yni2b2E0ns42zFcFpXQbycXMjv1JLJwoAlBzt8Cs=; b=WYepniyVkMULkBFB44OtJbbhbpxmg4hpXxFWoIf05TKFkXcNwQ4YBGcarP2f6AmyLWS5R/ WA9efuhZMm0+HdUHJgV2Yz4yRTTm78IKssrsKxexRsRoZzWKQeQXJ3kPyvi4/RqDdqVLYa l5dDvjwLej58k6+JCGAr/nqI6LqmTGWeao1dgPx6FSjTL9Py/XOL4aj9DLO1NnAAbnjo9c FYZAyIMM7HLPdTj/oySVTCO/bRnTOQ34+V+i5Ltvq3DwYsZg+egqqNh5uhWTbodcGyP3ec OFxKOjHTl40W133SoIf6qw8WvpXb614TFEpeAqRnpEz5mlGvoK8ykjpxpPFhfQ== Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -1.63 X-Spam-Score: -1.63 X-Migadu-Queue-Id: 616663DBDE X-Migadu-Scanner: scn1.migadu.com X-TUID: 9o6Kaucp8tUv Note: This also makes wpa-supplicant an optional requirement. * gnu/services/networking.scm () [shepherd-requirement]: New field. (network-manager-shepherd-service): Honor it. (network-manager-configuration-shepherd-requirement): Export accessor. * doc/guix.texi (Networking Setup): Document it. --- doc/guix.texi | 6 ++++++ gnu/services/networking.scm | 10 +++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 44e2165a82..46e0f637d0 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -19704,6 +19704,12 @@ Networking Setup @item @code{network-manager} (default: @code{network-manager}) The NetworkManager package to use. +@item @code{shepherd-requirement} (default: @code{()}) +This option can be used to provide a list of symbols naming Shepherd services +that this service will depend on, such as @code{'wpa-supplicant} or +@code{'iwd} if you require authenticated access for encrypted WiFi or Ethernet +networks. + @item @code{dns} (default: @code{"default"}) Processing mode for DNS, which affects how NetworkManager uses the @code{resolv.conf} configuration file. diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index dacf64c2d1..5284855b83 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -143,6 +143,7 @@ (define-module (gnu services networking) network-manager-configuration network-manager-configuration? + network-manager-configuration-shepherd-requirement network-manager-configuration-dns network-manager-configuration-vpn-plugins network-manager-service-type @@ -1140,6 +1141,8 @@ (define-record-type* network-manager-configuration? (network-manager network-manager-configuration-network-manager (default network-manager)) + (shepherd-requirement network-manager-configuration-shepherd-requirement + (default '())) (dns network-manager-configuration-dns (default "default")) (vpn-plugins network-manager-configuration-vpn-plugins ;list of file-like @@ -1200,7 +1203,7 @@ (define (network-manager-environment config) (define (network-manager-shepherd-service config) (match-record config - (network-manager dns vpn-plugins iwd?) + (network-manager shepherd-requirement dns vpn-plugins iwd?) (let ((conf (plain-file "NetworkManager.conf" (string-append "[main]\ndns=" dns "\n" @@ -1209,8 +1212,9 @@ (define (network-manager-shepherd-service config) (list (shepherd-service (documentation "Run the NetworkManager.") (provision '(networking)) - (requirement (append '(user-processes dbus-system loopback) - (if iwd? '(iwd) '(wpa-supplicant)))) + (requirement `(user-processes dbus-system loopback + ,@shepherd-requirement + ,@(if iwd? '(iwd) '()))) (start #~(make-forkexec-constructor (list (string-append #$network-manager "/sbin/NetworkManager") -- 2.39.1