From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id SNMfBuwKmmTQfQEASxT56A (envelope-from ) for ; Tue, 27 Jun 2023 00:02:20 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id GGUJBuwKmmQ+TgEA9RJhRA (envelope-from ) for ; Tue, 27 Jun 2023 00:02:20 +0200 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 3FB6139C09 for ; Tue, 27 Jun 2023 00:02:19 +0200 (CEST) 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1687816939; 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=uHUskVqGO9pIiyb5O95yytTMJ3fbcF1l/k6et/XcUN8=; b=i8Fa+NhdW9MOx1UwsGEMMuBj1g7351Fk+p94iOsrCFMuXiTTFL/qPVjJTIXeJcHLPqIdIA S0u4qmhIvKPhEIygkGW1U+ysO6NsdAMHQCk1qaGIOrz1T0xVOdX/sJSmYxRQYpGafA7x5I vwKkRaCX+2cLX68QY51uXuiJBN43u3gdRI9jdrbALU/XnE2DtwvSJDpcgQnPjnQtAedJKu hn0nTEa6Qj91EsdTMm4eQ9LjMViXGNNkX3qeNsh7A1S7a1HghpqWrmPOCUAvAbxHXQ+sXQ L9mQ67Ud+GLhxOZ3+QCi15GRogI+aFKJrAiVT/yAciwZXC3hV6SkJiKfabeDxg== 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-Seal: i=1; s=key1; d=yhetil.org; t=1687816939; a=rsa-sha256; cv=none; b=Y5ropwCKFLfBCb0PE7rIrHXZLsM1ULbgpcAtj50s+vVK1iB8/jTw3XzblvSwohCeGXYjAX N1cvxw6Mj+uOyCcMlaAK6RgSfLahrLl9Y6G2DjlEGNmTADImdo0hauH6gjF6Eq5D+46NBU vSAajKTL2J6eIPOFScStAFmMldbb9MPn734FjnCdJIXb55pVy5U1s5zma/vSE7ajZCJrPb +G7BrN7/WtlhIot/WhTwjXivKieplMLRLvtb/KbWpiXBsSyul8YCrO199CDxoFzIrknajv NSsop7cTytubxvgwSeMkdQMOTWsdrIOlWJ1KnyUSrXRuidtDMsVJ3n7vTfqZfA== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qDuGq-0005VY-4a; Mon, 26 Jun 2023 18:01:16 -0400 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 1qDuGi-00051v-S6 for guix-patches@gnu.org; Mon, 26 Jun 2023 18:01:10 -0400 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 1qDuGf-0005XH-8Y for guix-patches@gnu.org; Mon, 26 Jun 2023 18:01:06 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qDuGf-0008TB-3c for guix-patches@gnu.org; Mon, 26 Jun 2023 18:01:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63985] [PATCH v3 09/11] services: NetworkManager: Prefer package over network-manager. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 26 Jun 2023 22:01:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63985 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63985@debbugs.gnu.org Cc: Bruno Victal Received: via spool by 63985-submit@debbugs.gnu.org id=B63985.168781684732465 (code B ref 63985); Mon, 26 Jun 2023 22:01:05 +0000 Received: (at 63985) by debbugs.gnu.org; 26 Jun 2023 22:00:47 +0000 Received: from localhost ([127.0.0.1]:47190 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qDuGN-0008RR-0b for submit@debbugs.gnu.org; Mon, 26 Jun 2023 18:00:47 -0400 Received: from smtpmciv3.myservices.hosting ([185.26.107.239]:50424) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qDuGC-0008Qn-I3 for 63985@debbugs.gnu.org; Mon, 26 Jun 2023 18:00:37 -0400 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpmciv3.myservices.hosting (Postfix) with ESMTP id B7439203C4 for <63985@debbugs.gnu.org>; Tue, 27 Jun 2023 00:00:35 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 1C7568009B; Tue, 27 Jun 2023 00:00:35 +0200 (CEST) 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 vtDQBfPRZ3Qi; Tue, 27 Jun 2023 00:00:34 +0200 (CEST) Received: from guix-nuc.home.arpa (unknown [10.192.1.83]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 8FB448009A; Tue, 27 Jun 2023 00:00:34 +0200 (CEST) From: Bruno Victal Date: Mon, 26 Jun 2023 22:59:35 +0100 Message-Id: <81521d94a397b288655c9bc8b68b9a0efe09bc38.1687816734.git.mirai@makinata.eu> X-Mailer: git-send-email 2.39.2 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-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: scn0.migadu.com X-Migadu-Spam-Score: -2.35 X-Spam-Score: -2.35 X-Migadu-Queue-Id: 3FB6139C09 X-TUID: hUErg14fxowR * gnu/services/networking.scm () [package]: New field. [network-manager]: Deprecate field. (network-manager-environment, network-manager-shepherd) (network-manager-service-type): Adjust to use 'package'. * doc/guix.texi (Networking Setup): Replace mentions of network-manager with package. --- doc/guix.texi | 2 +- gnu/services/networking.scm | 41 +++++++++++++++++++++++++++++-------- 2 files changed, 33 insertions(+), 10 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 2f7e734874..974bfa3fb0 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -20352,7 +20352,7 @@ Networking Setup Data type representing the configuration of NetworkManager. @table @asis -@item @code{network-manager} (default: @code{network-manager}) +@item @code{package} (default: @code{network-manager}) The NetworkManager package to use. @item @code{shepherd-requirement} (default: @code{'(wpa-supplicant)}) diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index a4d3affa6c..496ff0f0ec 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -166,6 +166,7 @@ (define-module (gnu services networking) network-manager-configuration network-manager-configuration? + network-manager-configuration-package network-manager-configuration-shepherd-requirement network-manager-configuration-dns network-manager-configuration-vpn-plugins @@ -1164,8 +1165,10 @@ (define (warn-iwd?-field-deprecation value) 'shepherd-requirement' field instead~%"))) value) +(define-maybe/no-serialization package) + (define-configuration network-manager-configuration - (network-manager + (package (package network-manager) "The NetworkManager package to use." empty-serializer) @@ -1242,6 +1245,17 @@ (define-configuration network-manager-configuration (apply generic-ini-serialize-string 'wifi.backend value rest))))) + (network-manager + maybe-package + "Deprecated. Use ``package'' field instead." + (sanitizer + (lambda (value) + (when (maybe-value-set? value) + (warning (G_ "the 'network-manager' field is deprecated, please use \ +'package' field instead~%"))) + value)) + empty-serializer) + (prefix generic-ini-)) (define (network-manager-serialize-configuration config) @@ -1288,10 +1302,11 @@ (define (network-manager-environment config) (define (network-manager-shepherd-service config) (match-record config - (network-manager shepherd-requirement dns iwd?) + (package shepherd-requirement dns iwd?) (let* ((iwd? (or iwd? ; TODO: deprecated field, remove later. (and shepherd-requirement (memq 'iwd shepherd-requirement)))) + (package (maybe-value network-manager package)) (conf (network-manager-serialize-configuration config)) (vpn-plugin-env (map (match-lambda ((key . value) @@ -1314,7 +1329,7 @@ (define (network-manager-shepherd-service config) '((mkdir-p "/var/lib/misc")) '()) (let ((pid (fork+exec-command - (list #$(file-append network-manager + (list #$(file-append package "/sbin/NetworkManager") (string-append "--config=" #$conf) "--no-daemon") @@ -1332,7 +1347,7 @@ (define (network-manager-shepherd-service config) ;; to finish starting-up. This is required otherwise ;; services will fail since the network interfaces be ;; absent until NetworkManager finishes setting them up. - (system* #$(file-append network-manager "/bin/nm-online") + (system* #$(file-append package "/bin/nm-online") "--wait-for-startup" "--quiet") ;; XXX: Finally, return the pid from running ;; fork+exec-command to shepherd. @@ -1342,10 +1357,18 @@ (define (network-manager-shepherd-service config) (define network-manager-service-type (let ((config->packages (lambda (config) - (match-record config - (network-manager vpn-plugins) - `(,network-manager ,@vpn-plugins))))) - + (match-record config + (package network-manager vpn-plugins) + (let ((package (or (maybe-value network-manager) + package))) + `(,package ,@vpn-plugins))))) + ;; Handle network-manager field deprecation for + ;; polkit-service-type extension. + (network-manager-configuration-package* + (lambda (config) + (match-record config + (package network-manager) + (maybe-value network-manager package))))) (service-type (name 'network-manager) (extensions @@ -1355,7 +1378,7 @@ (define network-manager-service-type (service-extension polkit-service-type (compose list - network-manager-configuration-network-manager)) + network-manager-configuration-package*)) (service-extension account-service-type network-manager-accounts) (service-extension session-environment-service-type -- 2.39.2