From unknown Mon Aug 18 17:56:53 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#41080] [PATCH] doc: cookbook: add entry for Wireguard VPN connection on Guix System Resent-From: Marcin Karpezo Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 04 May 2020 15:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 41080 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 41080@debbugs.gnu.org Cc: Marcin Karpezo X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.158860743221216 (code B ref -1); Mon, 04 May 2020 15:51:02 +0000 Received: (at submit) by debbugs.gnu.org; 4 May 2020 15:50:32 +0000 Received: from localhost ([127.0.0.1]:33748 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jVdMW-0005W7-9G for submit@debbugs.gnu.org; Mon, 04 May 2020 11:50:32 -0400 Received: from lists.gnu.org ([209.51.188.17]:35524) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jVdMV-0005W0-4E for submit@debbugs.gnu.org; Mon, 04 May 2020 11:50:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36074) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jVdMU-00080o-M5 for guix-patches@gnu.org; Mon, 04 May 2020 11:50:30 -0400 Received: from mail.freearts.agency ([51.68.137.137]:49980) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jVdMS-000233-Jd for guix-patches@gnu.org; Mon, 04 May 2020 11:50:30 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 0AABF41239; Mon, 4 May 2020 17:50:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wioo.waw.pl; s=dkim; t=1588607410; h=from:from: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; bh=rRVGBSqLC3rmbGKiYmdvYs/rhNuG+BajJOtVEi5Etr8=; b=NMJSWWDmYn3rSeT4h29B+6RL7XnnJsuaK7Inhv16Xs3+SHm2Uj26V9/yafvzouEtCt0K2E cuwwimELx0vpwLnInlVemNYI6ZJyFUKdr9y9DNPuu9EE42pZxkVQKcxBB7/m1PFLyhE2wN 10MJibIe2AF8W28AcaH3sAyUhFv5wtv8f7PCyMFdmX+IWW33NS7wZUD31H9ZmTI9/Q7krK wMrBOsptYBt9aibljckvK2SkBMs+YFQWPIcznoWPUOViB1pTneTuIAF7QKczM4A6zO6k1F qbR33G1LEYjnYhZhn4p15FIRpBbQJOBBK/yYTmS2oLWzo3zROiUBpgy1w070Vw== From: Marcin Karpezo Date: Mon, 4 May 2020 17:49:16 +0200 Message-Id: <20200504154915.3963-1-sirmacik@wioo.waw.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Last-TLS-Session-Version: TLSv1.3 Received-SPF: pass client-ip=51.68.137.137; envelope-from=sirmacik@wioo.waw.pl; helo=mail.freearts.agency X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/04 11:50:16 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --- doc/guix-cookbook.texi | 77 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 76 insertions(+), 1 deletion(-) diff --git a/doc/guix-cookbook.texi b/doc/guix-cookbook.texi index f58d18d47c..598084ce65 100644 --- a/doc/guix-cookbook.texi +++ b/doc/guix-cookbook.texi @@ -327,7 +327,7 @@ package definitions. @item Inheritance makes it easy to customize a package by inheriting from it and modifying only what is needed. - + @item Batch processing: the whole package collection can be parsed, filtered and processed. Building a headless server with all graphical interfaces stripped @@ -1324,7 +1324,9 @@ reference. @menu * Customizing the Kernel:: Creating and using a custom Linux kernel on Guix System. * Customizing a Window Manager:: Handle customization of a Window manager on Guix System. +* Connect to Wireguard VPN:: Connecting to Wireguard VPN server on Guix System. * Setting up a bind mount:: Setting up a bind mount in the file-systems definition. + @end menu @node Customizing the Kernel @@ -1617,6 +1619,79 @@ Then you need to add the following code to a StumpWM configuration file (set-font (make-instance 'xft:font :family "DejaVu Sans Mono" :subfamily "Book" :size 11)) @end lisp +@node Connect to Wireguard VPN +@section Connect to Wireguard VPN +@anchor{#connect-to-wireguard-vpn} +To connect your Guix System with Wireguard VPN server you need to add +packages @code{wireguard-linux-compat} and @code{wireguard-tools} to +your system configuration file, e.g. @file{/etc/config.scm}. + +An example configuration file will look like this: + +@lisp +(use-modules (gnu)) +(use-package-modules vpn) + +(operating-system +;; … +(packages + (append (map specification->package + '("wireguard-linux-compat" "wireguard-tools")) + %base-packages))) +@end lisp + +After @code{guix system reconfigure /etc/config.scm} you'll find that +standard @code{wg-quick up wg0} command will not work due to lack of +package providing @code{resolvconf} command. + +@example +~ % sudo wg-quick up wg0 +[#] ip link add wg0 type wireguard +[#] wg setconf wg0 /dev/fd/63 +[#] ip -4 address add 10.200.200.2/24 dev wg0 +[#] ip link set mtu 1420 up dev wg0 +[#] resolvconf -a wg0 -m 0 -x +/home/sirmacik/.guix-profile/bin/wg-quick: line 31: resolvconf: command not found +[#] ip link delete dev wg0 +@end example + +Thanks to Network Manager support for Wireguard we can still connect to +our VPN using @code{nmcli} command. Up to this point this guide assumes +that you're using Network Manager service provided by +@code{%desktop-services}. Ortherwise you need to adjust your services +list to load @code{network-manager-service-type} and reconfigure your +Guix system (@uref{https://guix.gnu.org/manual/en/html_node/Networking-Services.html,see Networking Services}). + +To import your VPN configuration execute nmcli import command: + +@example +~ % sudo nmcli connection import type wireguard file wg0.conf +Connection 'wg0' (edbee261-aa5a-42db-b032-6c7757c60fde) successfully added +@end example + +Next connect to Wireguard server + +@example +~ % nmcli connection up wg0 +Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/6) +@end example + +By default NM will connect automatically on system boot. To change that +behaviour you need to edit your config: + +@example +~ % sudo nmcli connection edit wg0 +nmcli> print connection.autoconnect +connection.autoconnect: yes +nmcli> set connection.autoconnect no +nmcli> save +Connection 'prv' (edbee261-aa5a-42db-b032-6c7757c60fde) successfully updated. +@end example + +For more specific information about NetworkManager and wireguard +@uref{https://blogs.gnome.org/thaller/2019/03/15/wireguard-in-networkmanager/,see +this post on GNOME blogs}. + @node Setting up a bind mount @section Setting up a bind mount -- 2.26.2 From debbugs-submit-bounces@debbugs.gnu.org Mon May 11 15:15:38 2020 Received: (at control) by debbugs.gnu.org; 11 May 2020 19:15:38 +0000 Received: from localhost ([127.0.0.1]:53347 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jYDtq-0004j3-24 for submit@debbugs.gnu.org; Mon, 11 May 2020 15:15:38 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:49439) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jYDto-0004ip-93 for control@debbugs.gnu.org; Mon, 11 May 2020 15:15:37 -0400 Received: from webmail.gandi.net (webmail18.sd4.0x35.net [10.200.201.18]) (Authenticated sender: brice@waegenei.re) by relay2-d.mail.gandi.net (Postfix) with ESMTPA id 1580A40004 for ; Mon, 11 May 2020 19:15:29 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 11 May 2020 19:15:29 +0000 From: Brice Waegeneire To: control@debbugs.gnu.org Subject: Blocked by #41192 Message-ID: <35a2f74084f3e711a8537b0f1c08a040@waegenei.re> X-Sender: brice@waegenei.re User-Agent: Roundcube Webmail/1.3.8 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) block 41193 with 41192 block 41080 with 41192 quit From unknown Mon Aug 18 17:56:53 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#41080] [PATCH] doc: cookbook: add entry for Wireguard VPN connection on Guix System References: <20200504154915.3963-1-sirmacik@wioo.waw.pl> In-Reply-To: <20200504154915.3963-1-sirmacik@wioo.waw.pl> Resent-From: Brice Waegeneire Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 11 May 2020 19:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41080 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 41080@debbugs.gnu.org Received: via spool by 41080-submit@debbugs.gnu.org id=B41080.158922583928484 (code B ref 41080); Mon, 11 May 2020 19:38:02 +0000 Received: (at 41080) by debbugs.gnu.org; 11 May 2020 19:37:19 +0000 Received: from localhost ([127.0.0.1]:53354 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jYEEo-0007PM-PL for submit@debbugs.gnu.org; Mon, 11 May 2020 15:37:18 -0400 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:41937) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jYEEm-0007P7-0W for 41080@debbugs.gnu.org; Mon, 11 May 2020 15:37:16 -0400 Received: from webmail.gandi.net (webmail18.sd4.0x35.net [10.200.201.18]) (Authenticated sender: brice@waegenei.re) by relay8-d.mail.gandi.net (Postfix) with ESMTPA id 6332D1BF20C for <41080@debbugs.gnu.org>; Mon, 11 May 2020 19:37:09 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Mon, 11 May 2020 19:37:08 +0000 From: Brice Waegeneire Message-ID: <84b581259bee7a91a1c1676efc9c30d6@waegenei.re> X-Sender: brice@waegenei.re User-Agent: Roundcube Webmail/1.3.8 X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hello Marcin, Thank you for the patch! > +@lisp > +(use-modules (gnu)) > +(use-package-modules vpn) > + > +(operating-system > +;; … > +(packages > + (append (map specification->package > + '("wireguard-linux-compat" "wireguard-tools")) > + %base-packages))) > +@end lisp There is no use to put "wireguard-linux-compat" in the packages field, instead it should be in the kernel-loadable-modules field to be loadable by modprobe and an in the kernel-module-loader-service for being autoloaded at boot with an entry like: “(simple-service 'wireguard-module kernel-module-loader-service-type '("wireguard"))” Also note that all the above is only necessary with a Linux-libre kernel >5.6, after that wireguard is built into it. https://issues.guix.info/issue/41192 should fix the wg-quick issue, can you try it and update the documentation accordingly. About this script can you specify that it's a “very quick and dirty bash script” as wireguard's docs says and that it should probably be avoided except for testing and such. Also can you resend the patch as a git-patch instead of a plain diff, you can find the related guidelines in the manual[0]. [0]: https://guix.gnu.org/manual/en/html_node/Submitting-Patches.html#Submitting-Patches Cheers, - Brice From unknown Mon Aug 18 17:56:53 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#41080] [PATCH v2] Add wireguard connection instructions to cookbook References: <20200504154915.3963-1-sirmacik@wioo.waw.pl> In-Reply-To: <20200504154915.3963-1-sirmacik@wioo.waw.pl> Resent-From: Marcin Karpezo Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 26 May 2020 22:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41080 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 41080@debbugs.gnu.org Cc: Marcin Karpezo Received: via spool by 41080-submit@debbugs.gnu.org id=B41080.159053085526215 (code B ref 41080); Tue, 26 May 2020 22:08:01 +0000 Received: (at 41080) by debbugs.gnu.org; 26 May 2020 22:07:35 +0000 Received: from localhost ([127.0.0.1]:47166 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jdhjS-0006oj-Oj for submit@debbugs.gnu.org; Tue, 26 May 2020 18:07:35 -0400 Received: from mail.freearts.agency ([51.68.137.137]:53812) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jdhjP-0006oQ-5g for 41080@debbugs.gnu.org; Tue, 26 May 2020 18:07:33 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 0115040FB7; Wed, 27 May 2020 00:07:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wioo.waw.pl; s=dkim; t=1590530844; h=from:from: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; bh=3522wXVr6/tiqDlfsZgNpgKeIYM0X0rW/TOv8IxV/OE=; b=QDFzHx6mK47xE0SkucEl7xp0A/4rr/rg9mMfx/7ac12dLrFIvOuJV5T8oU7BNIdHZVBgkM PY+JoCdGsHhbdLAK06xqcIqcPPUWMZ9qFNc9oeyhx0NbGAiClUAzFHpM2RP9Ig9nehiPz/ GZ12yZiI+t9tKvwiFBzqH0jfCVPWezP7WGU81DbTak+OvBaDRvtlXPq1TNUVU9CE9UJCNP LpfHcYqHyyQ9PWhQFYShfgSqail3u5SJfeNn6qMdj5+7PE5DFqMDK7lrrz3STtLdfFB7jn qDzi5cblGIjT5fde9M9Qh3iL4LAOUrKdZ3X/ab8mN6N9QI4X26YHMDcOytKPIQ== From: Marcin Karpezo Date: Wed, 27 May 2020 00:07:17 +0200 Message-Id: <20200526220717.30682-1-sirmacik@wioo.waw.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Last-TLS-Session-Version: TLSv1.3 X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * doc: cookbook: add entry for Wireguard VPN connection on Guix System --- doc/guix-cookbook.texi | 68 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 67 insertions(+), 1 deletion(-) diff --git a/doc/guix-cookbook.texi b/doc/guix-cookbook.texi index 8651bc4429..0e0727310a 100644 --- a/doc/guix-cookbook.texi +++ b/doc/guix-cookbook.texi @@ -327,7 +327,7 @@ package definitions. @item Inheritance makes it easy to customize a package by inheriting from it and modifying only what is needed. - + @item Batch processing: the whole package collection can be parsed, filtered and processed. Building a headless server with all graphical interfaces stripped @@ -1323,6 +1323,7 @@ reference. @menu * Customizing the Kernel:: Creating and using a custom Linux kernel on Guix System. +* Connect to Wireguard VPN:: Connecting your Guix System to Wireguard VPN. * Customizing a Window Manager:: Handle customization of a Window manager on Guix System. * Setting up a bind mount:: Setting up a bind mount in the file-systems definition. @end menu @@ -1567,6 +1568,71 @@ likely that you'll need to modify the initrd on a machine using a custom kernel, since certain modules which are expected to be built may not be available for inclusion into the initrd. +@node Connect to Wireguard VPN +@section Connect to Wireguard VPN + +To connect your Guix system with Wireguard VPN server you need to add +@code{wireguard-tools} package to your system configuration file and +additional kernel line, e.g. @file{/etc/config.scm}. + +An example configuration file will look like this: + +@lisp +(use-modules (gnu)) +(use-package-modules vpn) + +(operating-system +;; … +(packages + (append (map specification->package + '("wireguard-tools")) + %base-packages)) + (kernel-loadable-modules (list wireguard-linux-compat)) + ;; … +@end lisp + +After @code{guix system reconfigure /etc/config.scm} you can either +place your config file in @file{/etc/wireguard} and run +@code{wg-quick up wg0} command or use NetworkManager for wireguard +management. + +Thanks to Network Manager support for Wireguard we can connect to our +VPN using @code{nmcli} command. Up to this point this guide assumes that +you're using Network Manager service provided by +@code{%desktop-services}. Ortherwise you need to adjust your services +list to load @code{network-manager-service-type} and reconfigure your +Guix system. + +To import your VPN configuration execute nmcli import command: + +@example shell +~ % sudo nmcli connection import type wireguard file wg0.conf +Connection 'wg0' (edbee261-aa5a-42db-b032-6c7757c60fde) successfully added +@end example + +Next connect to Wireguard server + +@example shell +~ % nmcli connection up wg0 +Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/6) +@end example + +By default NM will connect automatically on system boot. To change that +behaviour you need to edit your config: + +@example shell +~ % sudo nmcli connection edit wg0 +nmcli> print connection.autoconnect +connection.autoconnect: yes +nmcli> set connection.autoconnect no +nmcli> save +Connection 'prv' (edbee261-aa5a-42db-b032-6c7757c60fde) successfully updated. +@end example + +For more specific information about NetworkManager and wireguard +@uref{https://blogs.gnome.org/thaller/2019/03/15/wireguard-in-networkmanager/,see +this post by thaller}. + @node Customizing a Window Manager @section Customizing a Window Manager @cindex wm -- 2.26.2 From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 02 05:45:55 2020 Received: (at control) by debbugs.gnu.org; 2 Jun 2020 09:45:55 +0000 Received: from localhost ([127.0.0.1]:37951 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jg3UZ-0003B6-6w for submit@debbugs.gnu.org; Tue, 02 Jun 2020 05:45:55 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:35053) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jg3UX-0003At-QO for control@debbugs.gnu.org; Tue, 02 Jun 2020 05:45:54 -0400 Received: from webmail.gandi.net (webmail18.sd4.0x35.net [10.200.201.18]) (Authenticated sender: brice@waegenei.re) by relay2-d.mail.gandi.net (Postfix) with ESMTPA id 40B0640007 for ; Tue, 2 Jun 2020 09:45:46 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 02 Jun 2020 09:45:46 +0000 From: Brice Waegeneire To: control@debbugs.gnu.org Subject: Close #41080 Message-ID: X-Sender: brice@waegenei.re User-Agent: Roundcube Webmail/1.3.8 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) # I edited it, pushed as 5c3e94cdf8e3966d70be7cd7eff25c2575e25272 close 41080 quit