From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id sCnhCKXwbmfxAAEAe85BDQ:P1 (envelope-from ) for ; Fri, 27 Dec 2024 18:23:33 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id sCnhCKXwbmfxAAEAe85BDQ (envelope-from ) for ; Fri, 27 Dec 2024 19:23:33 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b="Ke2nl/L7"; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b="Ks/VW+r3"; 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"; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1735323812; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=VaV4EmBrSZW7gc4po/j83a1GlylfDnCwRZfQ1ee8NKA=; b=NYP/N6V/PNEUv59wbfNeH1VsjOCol9upLJ5iF4OU3nNujRwIUQ2fW7uSrD0CFtnM8IiDjF RMKWedBm+mEH2xdhg7vTbxjxyGMJxU/C3dNTXVJaF4oFPAEE0ej2XA+klaG6D5B8FzA5F3 92vvOoLHvmH1RAOSY97MmlX2Kj2zF88xJVVnGx8U5lE7hyvANGogUqeFU3vlRjdX8PVjxw yzMwTq1Lh0wI1Wyd+AOdTT+rOnK0vpSAkA1ekC555ipxEkV9DS8QiD5ZkLyeLyaiSxmrBk pWly1ZRyHqFgj3VdlmW54fCV6cKvzfZJIEGzuAlAGtOSvP40Lqv4h8zBzoeZsA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b="Ke2nl/L7"; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b="Ks/VW+r3"; 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"; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1735323812; a=rsa-sha256; cv=none; b=kcsAoB4xEJcbQ4kt1S5rsfyGtDsej0TyjVYUxvG5GVzbkr2uyrQYBU0S+N46vQCiYJqKVa 5TrY9uYmTqwUWwzZTaDHBvmVG62mtNPnTJfzAmYx4++aGGdK/L5M371QqOF+H7qcQkU9us WJ49FOnYy5D/kg4JuLsNJJmRZ/9mxBqMG1yyb86nNjcm+cwWHNPH5vjzQ1prKmJJbmvxbt 5eq9Jas0+XbL2rahNEXTfHDyXLDGbZW0W9PbttPFYE6BjeJ2glt0ezg2YoOnKDtjApeUJc CPYMHwHcsOY5eqRTiOuhR79mm9hsVRD/r7rd9H27SkHMR1tXVd9GRGzAHrsEQQ== 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 740281F8E for ; Fri, 27 Dec 2024 19:23:32 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tREzL-0001tb-OO; Fri, 27 Dec 2024 13:23:07 -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 1tREzJ-0001tJ-Or for guix-patches@gnu.org; Fri, 27 Dec 2024 13:23:05 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tREzI-0004FG-1M; Fri, 27 Dec 2024 13:23:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:Subject; bh=VaV4EmBrSZW7gc4po/j83a1GlylfDnCwRZfQ1ee8NKA=; b=Ke2nl/L7rHAkuXWzyZrAD8cvpJfNauhhhGY3uybKTT4COsJ72rVTGTvN/xPvHa6Fyrn7kyYNNi5HOSjMax99c4s4LTMMrWXV26yUkRMdGqtK+CoRj6DY2EhAlSeFyVPFhaDcDBJ3IATygXO16ef5AuqoEfM32EOv/YiLyvKYKcj6QmwWwQB/utoY2MHOOt0T3iovi2pCMGjekXklY/KVf3L0DuF507CvZGAUvIwPoc6pHHDSTqJzcS75l8RsgmMmPsijA5dqFGC5FMNNvnbr99pjEEwUjr2tHWYQGkn7gwrwjrPx49fW+mqOeaPY+8mhBGrOKp3hcgXxqWh6TMc0iA==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tREzG-0007Zg-Ro; Fri, 27 Dec 2024 13:23:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#75145] [PATCH] services: NetworkManager: configuration-directory Resent-From: 45mg <45mg.writes@gmail.com> Original-Sender: "Debbugs-submit" Resent-CC: ludo@gnu.org, maxim.cournoyer@gmail.com, guix-patches@gnu.org Resent-Date: Fri, 27 Dec 2024 18:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 75145 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 75145@debbugs.gnu.org Cc: 45mg <45mg.writes@gmail.com>, Ludovic =?UTF-8?Q?Court=C3=A8s?= , Maxim Cournoyer X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Maxim Cournoyer Received: via spool by submit@debbugs.gnu.org id=B.173532372329028 (code B ref -1); Fri, 27 Dec 2024 18:23:02 +0000 Received: (at submit) by debbugs.gnu.org; 27 Dec 2024 18:22:03 +0000 Received: from localhost ([127.0.0.1]:47539 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tREyI-0007Xx-4H for submit@debbugs.gnu.org; Fri, 27 Dec 2024 13:22:02 -0500 Received: from lists.gnu.org ([209.51.188.17]:33404) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <45mg.writes@gmail.com>) id 1tREyF-0007Xf-Vn for submit@debbugs.gnu.org; Fri, 27 Dec 2024 13:22:01 -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 <45mg.writes@gmail.com>) id 1tREyF-0001Hj-Hq for guix-patches@gnu.org; Fri, 27 Dec 2024 13:21:59 -0500 Received: from mail-pj1-x1044.google.com ([2607:f8b0:4864:20::1044]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <45mg.writes@gmail.com>) id 1tREyD-0004AX-UJ for guix-patches@gnu.org; Fri, 27 Dec 2024 13:21:59 -0500 Received: by mail-pj1-x1044.google.com with SMTP id 98e67ed59e1d1-2eed82ca5b4so9033604a91.2 for ; Fri, 27 Dec 2024 10:21:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735323716; x=1735928516; darn=gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=VaV4EmBrSZW7gc4po/j83a1GlylfDnCwRZfQ1ee8NKA=; b=Ks/VW+r38vHSTUsTJpBUhfRm6bxwGNWEWef3f06vSNRP1dev4j7OteESQCYuILbf2D pW2A69X6uD5IBsNOIn9XNV/gsBjM8q+h1uyUePrhwLfXk17LbOIdjlcHYz4XoQX2mt0h 5GevROGY8dT2xBF/odIMSYAbhOt8z3XDmCU4O8Fp4w99OEXHT651ub12y/Em4A6GybnU RzH2VpKy3NMFgZ6SLTd9lyA35qBL4v6B5EwhYgczwPMcnCPZJEYlAHHNVZ4EEz/Rh1aM cP0QZjryEy3HIZXr4xi+z6FDdWefXyjhN4gbRm8fDsCbzdImosW9HWSnxl2hQeRrlKzR jfHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735323716; x=1735928516; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=VaV4EmBrSZW7gc4po/j83a1GlylfDnCwRZfQ1ee8NKA=; b=Zj7nUOchyr4STXD3U1gPgpSmQvrtBnWAlnpEYT58GiR+E4ud4Tjkkniuvg7SED2jHM bhTnriPuGUiZMnDuMtfEYcycIYYDweZi5BK36DRjThRy+xz3U7tdHd+PqZNFnqzH4EJJ fIuZPFIvtSukznsCPvzipv+4bdsxSoYOl+aOArHIuvQHKBA4F+omPGpgenakjcTqPR0S x2Fgk0yq2LPBEYVL1LouxWqD7oayOkHLuUUMT+meMRMIEziUSjcH0PtS1XCb+VRQvhpS YGWi1to+e4VbYimOGAmYbQjPDFzH/ShLsYPKfersv4tX7a07NEbZu/rvFBZf9nx/tDfj uLFw== X-Gm-Message-State: AOJu0YxQc1PpQTkV5Mo4bK7r3NK1/a9WNDV7nvIGlzIb6rF6ez37xsBB 3ySb9SxVFAwtk7L2IRq76VRNEWFBNijh6D/Tcj2UBZxNGTye+dm6pGJHxDHb X-Gm-Gg: ASbGnctkwtbabGwWjlV5taue7TvvuLr9z2vrE0s3KkXQF6iXzMj3bBPNFM2a1k46TzP k7VlCmz+pKW1MqYtLwvMjkEdMCgp93tcbOAICXDm6v5LKrxf9SUccSeVNu4mHxFvcBg1VS5sU37 mOIz+uz1FMtJJmWPl8P15hVcpoAjHgF9xGLAfMf9n8GP+8iCUHyXbhIAn6ydXuODszi08bB9tLY /IhHe5XKJlsf52sJE46/X71ZtBdXR4l3jVwQgqdrcE2qOG2AaEGZIEWIx4Hkq91ZWit1KgLbWaS X-Google-Smtp-Source: AGHT+IFDGilKrbjxjwDIOmJ26tmuZqNFsFFaaMR+tCpNg0Q0zE0x4Bg6oxd7c3YmpKEtpmy3LTXdlw== X-Received: by 2002:a17:90b:534b:b0:2ee:c91a:acf7 with SMTP id 98e67ed59e1d1-2f452dfccdcmr41084712a91.4.1735323716041; Fri, 27 Dec 2024 10:21:56 -0800 (PST) Received: from localhost.localdomain ([2401:4900:1cb8:a2d3:f4aa:1246:d469:678a]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dc9d9775sm138178965ad.148.2024.12.27.10.21.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Dec 2024 10:21:55 -0800 (PST) From: 45mg <45mg.writes@gmail.com> Date: Fri, 27 Dec 2024 13:18:06 -0500 Message-ID: <7743f403ebf1693fc386a397e9aed1975b43f900.1735323486.git.45mg.writes@gmail.com> X-Mailer: git-send-email 2.47.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::1044; envelope-from=45mg.writes@gmail.com; helo=mail-pj1-x1044.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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 X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: 1.73 X-Spam-Score: 1.73 X-Migadu-Queue-Id: 740281F8E X-TUID: KvJPnnzYfcvt Give users a way to configure NetworkManager, by specifying a directory containing configuration files. This directory will then be symlinked to `/etc/NetworkManager/conf.d` (NetworkManager's default configuration directory location). * gnu/services/networking.scm () [configuration-directory]: new option. * doc/guix.texi: document it. Change-Id: I243a71593b9235cc11ebf9fea1926a1840d993d2 --- doc/guix.texi | 30 ++++++++++++++++++++++++++++++ gnu/services/networking.scm | 10 ++++++++-- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index da4d2f5ebc..ee0fbf59f9 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -21441,6 +21441,36 @@ Networking Setup (VPNs). An example of this is the @code{network-manager-openvpn} package, which allows NetworkManager to manage VPNs @i{via} OpenVPN. +@item @code{configuration-directory} (default: @code{#f}) +A directory (file-like object) that will be symlinked as +@file{/etc/NetworkManager/conf.d}. NetworkManager will read +configuration files from this directory. For the configuration file +format, see the @command{NetworkManager.conf(5)} man page. + +For example, you could supply an existing directory: + +@lisp +(service network-manager-service-type + (network-manager-configuration + (configuration-directory + (local-file "files/NetworkManager/conf.d" #:recursive? #t)))) +@end lisp + +Or create a directory using @code{file-union}: + +@lisp +(service network-manager-service-type + (network-manager-configuration + (configuration-directory + (file-union "my-configuration-directory" + `(("existing-file" ,(local-file "001-basic.conf")) + ("constructed-file" ,(plain-file "002-unmanaged.conf" + "[keyfile] +unmanaged-devices=interface-name:wlo1_ap +"))))))) +@end lisp + + @end table @end deftp diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index 48a86b3694..7152c5a95f 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -23,6 +23,7 @@ ;;; Copyright © 2023 Bruno Victal ;;; Copyright © 2023 muradm ;;; Copyright © 2024 Nigko Yerden +;;; Copyright © 2024 45mg <45mg.writes@gmail.com> ;;; ;;; This file is part of GNU Guix. ;;; @@ -1262,18 +1263,23 @@ (define-record-type* (default '())) (iwd? network-manager-configuration-iwd? ; TODO: deprecated field, remove. (default #f) - (sanitize warn-iwd?-field-deprecation))) + (sanitize warn-iwd?-field-deprecation)) + (configuration-directory network-manager-configuration-configuration-directory ;file-like + (default #f))) (define (network-manager-activation config) ;; Activation gexp for NetworkManager (match-record config - (network-manager dns vpn-plugins) + (network-manager dns vpn-plugins configuration-directory) #~(begin (use-modules (guix build utils)) (mkdir-p "/etc/NetworkManager/system-connections") #$@(if (equal? dns "dnsmasq") ;; create directory to store dnsmasq lease file '((mkdir-p "/var/lib/misc")) + '()) + #$@(if configuration-directory + `((symlink ,configuration-directory "/etc/NetworkManager/conf.d")) '())))) (define (vpn-plugin-directory plugins) base-commit: 831b94a1efcea8f793afc949b5123a6235c9bb1a -- 2.47.1