From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 28 05:33:18 2025 Received: (at submit) by debbugs.gnu.org; 28 Feb 2025 10:33:18 +0000 Received: from localhost ([127.0.0.1]:45530 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tnxgD-0006L6-Hk for submit@debbugs.gnu.org; Fri, 28 Feb 2025 05:33:18 -0500 Received: from lists.gnu.org ([2001:470:142::17]:34508) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tnxgA-0006Kf-C3 for submit@debbugs.gnu.org; Fri, 28 Feb 2025 05:33:15 -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 1tnxfp-0006lV-9f for guix-patches@gnu.org; Fri, 28 Feb 2025 05:33:02 -0500 Received: from voltorb.zancanaro.id.au ([45.77.50.64]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tnxfh-0003rt-2s for guix-patches@gnu.org; Fri, 28 Feb 2025 05:32:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=k1; bh=DlmGMwJdziRq0Wl kwVSpYubUvXBdO/Y7Xwn9KOgtawI=; h=date:subject:to:from; d=zancanaro.id.au; b=mL5CMPYqtrHHSKz3z8Ly6AHHmAEcGUAR8zBaTZAYBm0ZE3GqE wZKXUYU8J9yxNY+8VPfB+PXttylUxArVygE9zt4e4TChytkrKtGI+4KWCy29m03oChccXw CoLucaRSa8eb1ZVIGmrAFKU+kHulirR3REAZqCwx6EuPoUwY0iRA= Received: by voltorb.zancanaro.id.au (OpenSMTPD) with ESMTPSA id 4d72084d (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Fri, 28 Feb 2025 10:32:25 +0000 (UTC) From: Carlo Zancanaro To: guix-patches@gnu.org Subject: [PATCH] services: wireguard: Add the auto-start? field. Date: Fri, 28 Feb 2025 21:31:10 +1100 Message-ID: <5d18dcc609db2170071a302ee35fc0d74170ae54.1740738670.git.carlo@zancanaro.id.au> X-Mailer: git-send-email 2.48.1 MIME-Version: 1.0 X-Debbugs-Cc: Ludovic Courtès , Maxim Cournoyer Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=45.77.50.64; envelope-from=carlo@zancanaro.id.au; helo=voltorb.zancanaro.id.au 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, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit 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: -0.0 (/) * gnu/services/vpn.scm (): Add auto-start?. (wireguard-shepherd-service): Pass auto-start? to Shepherd service. * doc/guix.texi (VPN Services)[wireguard]: Document it. Change-Id: I7880a8c8e9860250f875e845e94eb118a4b852fa --- Does what it says on the tin. This makes it possible to define a wireguard service without automatically starting the service. This is convenient for connections on desktops/laptops if they are not always used. doc/guix.texi | 8 +++++++- gnu/services/vpn.scm | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 93380dc30d..c7ca21ef52 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -43,7 +43,7 @@ Copyright @copyright{} 2017, 2018, 2019 Clément Lassieur@* Copyright @copyright{} 2017, 2018, 2020, 2021, 2022 Mathieu Othacehe@* Copyright @copyright{} 2017 Federico Beffa@* -Copyright @copyright{} 2017, 2018, 2024 Carlo Zancanaro@* +Copyright @copyright{} 2017, 2018, 2024, 2025 Carlo Zancanaro@* Copyright @copyright{} 2017 Thomas Danckaert@* Copyright @copyright{} 2017 humanitiesNerd@* Copyright @copyright{} 2017, 2021 Christine Lemmer-Webber@* @@ -35570,6 +35570,12 @@ VPN Services altogether, and @code{"auto"} (the default) that adds routes to the default table and enables special handling of default routes. +@item @code{auto-start?} (default: @code{#t"}) +Whether the Wireguard network should be started automatically by the +Shepherd. If it is @code{#f} the service has to be started manually +with @code{herd start wireguard-$interface} (for example: @code{herd +start wireguard-wg0}). + @end table @end deftp diff --git a/gnu/services/vpn.scm b/gnu/services/vpn.scm index c66622ad6c..478a0d543e 100644 --- a/gnu/services/vpn.scm +++ b/gnu/services/vpn.scm @@ -13,6 +13,7 @@ ;;; Copyright © 2022 Timo Wilken ;;; Copyright © 2023 Maxim Cournoyer ;;; Copyright © 2024 Richard Sent +;;; Copyright © 2025 Carlo Zancanaro ;;; ;;; This file is part of GNU Guix. ;;; @@ -88,6 +89,7 @@ (define-module (gnu services vpn) wireguard-configuration-pre-down wireguard-configuration-post-down wireguard-configuration-table + wireguard-configuration-auto-start? wireguard-service-type)) @@ -764,7 +766,9 @@ (define-record-type* (post-down wireguard-configuration-post-down ;list of strings (default '())) (table wireguard-configuration-table ;string - (default "auto"))) + (default "auto")) + (auto-start? wireguard-configuration-auto-start? ;boolean + (default #t))) (define (wireguard-configuration-file config) (define (peer->config peer) @@ -916,6 +920,7 @@ (define (wireguard-shepherd-service config) (match-record config (wireguard interface) (let ((wg-quick (file-append wireguard "/bin/wg-quick")) + (auto-start? (wireguard-configuration-auto-start? config)) (config (wireguard-configuration-file config))) (list (shepherd-service (requirement '(networking)) @@ -926,6 +931,7 @@ (define (wireguard-shepherd-service config) (invoke #$wg-quick "down" #$config) #f)) ;stopped! (actions (list (shepherd-configuration-action config))) + (auto-start? auto-start?) (documentation "Run the Wireguard VPN tunnel")))))) (define (wireguard-monitoring-jobs config) base-commit: a76708a872e65230931f3c5c3b079d0a39d5cb84 -- 2.48.1 From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 02 10:47:38 2025 Received: (at 76637-done) by debbugs.gnu.org; 2 Mar 2025 15:47:38 +0000 Received: from localhost ([127.0.0.1]:33185 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tolXW-0002DM-Cg for submit@debbugs.gnu.org; Sun, 02 Mar 2025 10:47:38 -0500 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]:55346) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tolXT-0002Cs-3B for 76637-done@debbugs.gnu.org; Sun, 02 Mar 2025 10:47:36 -0500 Received: by mail-pj1-x1033.google.com with SMTP id 98e67ed59e1d1-2fecba90cc3so3531893a91.2 for <76637-done@debbugs.gnu.org>; Sun, 02 Mar 2025 07:47:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1740930449; x=1741535249; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=tMdc1KHK1c/y9WqBzKulafucq4DaavmIEzmnQ7EGPsk=; b=SzTAt6xoET0qNSn5gwtz3OwIR67Sk1dr1mmgDrNBFtGOlTBYVh2QHROFeEZQVz/TRq ytDEmngExTCPlYMhcSjWVk9r07OipDyg3THHkJsyBoPLHp5yUp4bPf4C5fV6maE10aGA HNqs5Cckrb3hQ48L7qRcA2w45urxXe023OX+WQt7RoabEr1cK4KDMvNCtt1AU1X4wNK/ GSYTpUtmY/cMHnoNu0Wgu8etsg3kTtvN8MGlZPWSlC9jaDhyTpvFjmmPIxaqaTxpPIFD jWFFQvA112C4ipZLJI8mlxcnrAf143YUV2AHHOSx19eYiDDjZNb7xRcIz51j9SDlIdIq mIpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740930449; x=1741535249; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=tMdc1KHK1c/y9WqBzKulafucq4DaavmIEzmnQ7EGPsk=; b=MgJFquzp2Ws7P1XVBI5u8CnqODu5sYNQeRktE7sOisgSLI0pTv8X/ihHXoYCRHF14L 9SAg03HnceO4IZf/3K/MnRbRhwTKgLf2Tow4MPxrw1R4+Fh/Qsfm7ll10dmxGX5FVAN1 cRhsoNRHx+HZgqh64ONOSkJswxK6puWEbFvtt0GD5M9rFw1q3P0kSCnFsHJ/hBO0fJax JbA8c2m9i/Vxo4awGkIGi6qQ92AsTXNrISIo+Gb7aDLZ9ybipMIW3gdIzofUr9HlZYgz TlFoJLzpxg5T5MCHFC1qjpOF0JjERmanP+QufJswyBXa6RVnx+16Q+7ID7YCAAooG46U ThOg== X-Gm-Message-State: AOJu0Ywnq5ONu0fT6OuhxYvuxj1JO4Y2G5ESmdbzQeABwyvyufKsnu5M jDmlA0C8FSnA/7sO5HoAI6/Dq+SPlkMfwKjDoN+o6eqAzUipEF+Y X-Gm-Gg: ASbGncvqdbT704lj4wpfuto+t8G1/4vzGoODhrlk91mLQjcia3kLsjVCTva4RGJqQ+B ShCfcg2B9SoxyaWPyKF2yWPPOiZQlh6D9VKMYXB9DdKjIECSVnFOpVdc+IyMY0VX2te9A8wRL2D irkNM7uFGYVURBHEbJVlbx5tTJWpq6rwWGWyzrIyLLTN5Da6p5yVsIwBfqOxvZIpbblJzIuOchM V4/Prwjlj06MFY1Tqc03f0FisErCXBW/XfUcIV8vh+ICKva8iIhuMPsPCca4/OoH2O8oSVnTR/8 lvRYaJ05bSq0CqKTtw1s9ZGWVdnk18FEpZGJztez6mg= X-Google-Smtp-Source: AGHT+IEvltzh5chQJPAEjxq+jIpwM/WSSd7fvLvqGrXUdiN/xRc7VsGjdW/jarFhF2Iw/SpJd2NXLg== X-Received: by 2002:a17:90b:4b0d:b0:2f4:4003:f3ea with SMTP id 98e67ed59e1d1-2febac0659dmr17252075a91.33.1740930449041; Sun, 02 Mar 2025 07:47:29 -0800 (PST) Received: from terra ([2405:6586:be0:0:83c8:d31d:2cec:f542]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2fec63c0cfcsm4376687a91.17.2025.03.02.07.47.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Mar 2025 07:47:28 -0800 (PST) From: Maxim Cournoyer To: Carlo Zancanaro Subject: Re: [bug#76637] [PATCH] services: wireguard: Add the auto-start? field. In-Reply-To: <5d18dcc609db2170071a302ee35fc0d74170ae54.1740738670.git.carlo@zancanaro.id.au> (Carlo Zancanaro's message of "Fri, 28 Feb 2025 21:31:10 +1100") References: <5d18dcc609db2170071a302ee35fc0d74170ae54.1740738670.git.carlo@zancanaro.id.au> Date: Mon, 03 Mar 2025 00:47:16 +0900 Message-ID: <87ikorfn97.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 76637-done Cc: 76637-done@debbugs.gnu.org, Ludovic =?utf-8?Q?Court=C3=A8s?= 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 (-) Hi, Carlo Zancanaro writes: > * gnu/services/vpn.scm (): Add auto-start?. > (wireguard-shepherd-service): Pass auto-start? to Shepherd service. > * doc/guix.texi (VPN Services)[wireguard]: Document it. > > Change-Id: I7880a8c8e9860250f875e845e94eb118a4b852fa Pushed, thank you. -- Maxim From unknown Sun Aug 10 16:49:10 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 31 Mar 2025 11:24:09 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator