From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id KIMAJ2lz/2bZIgEAe85BDQ:P1 (envelope-from ) for ; Fri, 04 Oct 2024 04:47:37 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id KIMAJ2lz/2bZIgEAe85BDQ (envelope-from ) for ; Fri, 04 Oct 2024 06:47:37 +0200 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=k0GaYa0r; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=OC9kkiQm; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.com (policy=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=1728017257; a=rsa-sha256; cv=none; b=BzgP+BrfKw7tjPrzWUtrAOCTWL34bfRGoRf0/jAha+jMpOsyCJAJbiRLJop9WjyF58ewf7 2NocGjA55hkF5EnVjiYryvqjT8ZlqvD7n5v4p0FSDd8Ed7CHnks9lRkEXW7u+9+zJrsTYK VHN+pRuiQY56vryJEn/7o/A1k/FQYLJ2a865ICsZwZJrV5Mra4x6SpfoxImVsUHqJH1HsO uMMXVn42rctcG8EL68nAJIxMcvNYENnX5v0U1WBw0RsIghjZ45ykmGvxeiQQjvuZjjPevr a9CVZQYjOndywmNJ1IwSf5VFXv7DzuaOjkguB/tX1MOasjt8OXEo6TcB3AlvVw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=k0GaYa0r; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=OC9kkiQm; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.com (policy=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=1728017257; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: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: dkim-signature; bh=FIIR1+LQqF7n1KnxCyBKLgb6zUX5K2SQa53YfgnIxAI=; b=hct+eZChNHoBp1Zww+XmCWnBYpb5y/g/8n9AqFpFvRt8zrBgj5qdueeAOlUJr8ygiKoCaZ dCEWhMzI/KaWClc1PTEA5QAyr8eV8BJGZYtdCUnrHTX94n1sYbD7dZWbalLhDrr09U9IGA 8Q7NcuwkWzUyA6mJPjcra+Iab009FC3hJgGWzM1R/cZpLqILKcjl43nfiF7c2B56zvoq8/ 7O9k8mOcRQMHQnEyM5DUfqEtSlL+xtaVK2Mr7tOMkXXQS6VOREo5GQcclrsPLdOvbJwxHi /RZcZEhZrWer5BwnpI/8EFSe7wo6t3JznIr9ko5UzDrkYnH4GINqhL2WFeDAJw== 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 063BF32D29 for ; Fri, 04 Oct 2024 06:47:36 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1swaDd-0003oY-03; Fri, 04 Oct 2024 00:47:09 -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 1swaDV-0003nv-Kn for guix-patches@gnu.org; Fri, 04 Oct 2024 00:47:02 -0400 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 1swaDV-0007ML-C4 for guix-patches@gnu.org; Fri, 04 Oct 2024 00:47:01 -0400 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:In-Reply-To:References:Subject; bh=FIIR1+LQqF7n1KnxCyBKLgb6zUX5K2SQa53YfgnIxAI=; b=k0GaYa0rrWpEgCK7QzcFLZI3X6rT5WWfOzeTb0s/yxFf6TSbzt14UQDFkX+91LqgWKpoxjN6Ems7YC0GEKCXzX04tieBsKlf5NVdhZ3qtEDLs1jjW7yBLQD/Lpd2N2qwzeCRaH5I6VEzfLduvGXC54Vxn7X28xjWWT2DcVRazjdBXij3YIlYVSNuUoUvAEtCZ/sm8Hbvjr8rdbc1vnntEQz6we6EdDdLzXg2hbhipEQ5h1wa2ZYV7KTFxVXAGmr0ucvVdHo6EH3qMsfwm6MjehSD5RQVt5rbgRh6QtEOIBeUhQULVzrAPq/v4wkuYjXNAHCPUFmRJQYihbLvrvhZTQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1swaDY-00039p-0I for guix-patches@gnu.org; Fri, 04 Oct 2024 00:47:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#73467] PATCH V3 for Wireguard: Add auto-start? field References: <87cyksjfhw.fsf@gmail.com> In-Reply-To: <87cyksjfhw.fsf@gmail.com> Resent-From: Apoorv Singh Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 04 Oct 2024 04:47:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73467 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 73467@debbugs.gnu.org Received: via spool by 73467-submit@debbugs.gnu.org id=B73467.172801721612084 (code B ref 73467); Fri, 04 Oct 2024 04:47:03 +0000 Received: (at 73467) by debbugs.gnu.org; 4 Oct 2024 04:46:56 +0000 Received: from localhost ([127.0.0.1]:34212 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swaDJ-00038g-Ff for submit@debbugs.gnu.org; Fri, 04 Oct 2024 00:46:56 -0400 Received: from mail-pg1-f177.google.com ([209.85.215.177]:53435) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swPsv-0001Dx-LD for 73467@debbugs.gnu.org; Thu, 03 Oct 2024 13:45:06 -0400 Received: by mail-pg1-f177.google.com with SMTP id 41be03b00d2f7-656d8b346d2so793192a12.2 for <73467@debbugs.gnu.org>; Thu, 03 Oct 2024 10:45:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727977442; x=1728582242; darn=debbugs.gnu.org; h=mime-version:message-id:date:subject:to:from:from:to:cc:subject :date:message-id:reply-to; bh=FIIR1+LQqF7n1KnxCyBKLgb6zUX5K2SQa53YfgnIxAI=; b=OC9kkiQmhF8fADe1NIwHbbxyxSJ8Mp3R+DMD/00xYoAwiOEFtGD74Ze/xZEWtuvzxH LK3r7p0VHO7RGMnvp5/DZKsz4/+pXWUXfVOdy8yki15x8x6A+s/YGZ/uNdY9EPKvqnPR wakT3J4g/G7g3JDuZlqWYEDe1EQLTgul89PYWdBFyIaGqY5fxzI57/dVtvXTMcp3n7eG PGMAtvMXf4itSDKranXFjzrp44otopbaIjmd3P3yJZehGJCU8lpY+fSP3u9+5wu54aMK zBu5QRoh0D5UurFaUk6ci3w33D73h67MfdzrCujS4LDa/N61bw8RR85pEjS2R2Hlyvdq eTVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727977442; x=1728582242; h=mime-version:message-id:date:subject:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=FIIR1+LQqF7n1KnxCyBKLgb6zUX5K2SQa53YfgnIxAI=; b=qtpT/eLcmDozgngVuhaaaOVRWjnF86qmCMjDN0Byk9r/Ksy4Zg+uXFbzf6uphECjVJ eNN6bKrWTjDweb3oG6eSE7w68AKTd6o2YJfQ9tmsm64BK+j4g2r7D4vbDAHP7PFHSdwD BbNC4Nb/7RH2Klg7cl4HvWxt5gwFX21wjTZ7X0hqI0si1TGK4IORvCE7CRV97pCCyA5K m0TIlvD6WsFUZUvVJr3tA4OQMhYsrVf4nWwnsTDayRp39NVZCaeMofDi5y9MJFPLIRtS FvXbx1N/j4OyebEDiZayd9lqzr9qoEOJTDQqlLUXjTc6ItBIoxMzsfhLKae0z71w/A3r FsiQ== X-Gm-Message-State: AOJu0YyICZoKHO1Z5Bo6JvYT5Vvldv041vZy6Ky2eboZhJY9VRYY8Y3U 16PDkvJiqguVODter4b6qxTiNxry7JskMwbU/0yh1gdG5+DPR6e1I1GZ X-Google-Smtp-Source: AGHT+IH7BlIlDq2fC7ckj8t+7icXRpK8k7e/KToVuX542T08n+9/e1qBSIIZuRGe905UD9v18bSHWA== X-Received: by 2002:a05:6a21:1584:b0:1d4:fbdc:aedc with SMTP id adf61e73a8af0-1d6dfa27915mr173639637.4.1727977442169; Thu, 03 Oct 2024 10:44:02 -0700 (PDT) Received: from MachineY ([139.5.251.166]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71dd9ddc834sm1625157b3a.105.2024.10.03.10.44.00 for <73467@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 10:44:01 -0700 (PDT) From: Apoorv Singh Date: Thu, 03 Oct 2024 23:13:58 +0530 Message-ID: <8734ldw081.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Mailman-Approved-At: Fri, 04 Oct 2024 00:46:48 -0400 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-Spam-Score: -0.73 X-Spam-Score: -0.73 X-Migadu-Queue-Id: 063BF32D29 X-Migadu-Scanner: mx10.migadu.com X-TUID: K1ivGAhAuE3X --=-=-= Content-Type: text/plain The following patch adds auto-start? field for wireguard-service-type --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Wireguard-Add-auto-start-field.patch Content-Description: Wireguard Add auto-start? field >From 7f4c9783cad8e3574ab43a6dec9e13713ef3311b Mon Sep 17 00:00:00 2001 From: apoorv569 Date: Wed, 25 Sep 2024 09:10:36 +0530 Subject: [PATCH V3] Wireguard: Add auto-start? field --- doc/guix.texi | 4 ++++ gnu/services/vpn.scm | 9 +++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 52e36e4354..50676997e2 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -34396,6 +34396,10 @@ special values: @code{"off"} that disables the creation of routes 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}) (type: boolean) +Whether the service should be started automatically. If it +is @code{#f} the service has to be started manually with @command{herd start}. + @end table @end deftp diff --git a/gnu/services/vpn.scm b/gnu/services/vpn.scm index 449909e34d..1b0cc4d337 100644 --- a/gnu/services/vpn.scm +++ b/gnu/services/vpn.scm @@ -86,6 +86,7 @@ (define-module (gnu services vpn) wireguard-configuration-pre-down wireguard-configuration-post-down wireguard-configuration-table + wireguard-configuration-autostart? wireguard-service-type)) @@ -760,7 +761,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-autostart? ;boolean + (default #t))) (define (wireguard-configuration-file config) (define (peer->config peer) @@ -907,7 +910,8 @@ (define (wireguard-shepherd-service config) (match-record config (wireguard interface) (let ((wg-quick (file-append wireguard "/bin/wg-quick")) - (config (wireguard-configuration-file config))) + (config (wireguard-configuration-file config)) + (autostart (wireguard-configuration-autostart? config))) (list (shepherd-service (requirement '(networking)) (provision (list (wireguard-service-name interface))) @@ -916,6 +920,7 @@ (define (wireguard-shepherd-service config) (stop #~(lambda _ (invoke #$wg-quick "down" #$config) #f)) ;stopped! + (auto-start? autostart) (actions (list (shepherd-configuration-action config))) (documentation "Run the Wireguard VPN tunnel")))))) -- 2.46.0 --=-=-= Content-Type: text/plain; format=flowed . -- - Apoorv Singh - Sent from Emacs. --=-=-=--