From unknown Tue Jun 17 22:21:16 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#52689] [PATCH] services: wireguard: Add DNS config field. Resent-From: Nathan Dehnel Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 20 Dec 2021 23:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 52689 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52689@debbugs.gnu.org Cc: Nathan Dehnel <5498361+Gooberpatrol66@users.noreply.github.com> X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.164004433610052 (code B ref -1); Mon, 20 Dec 2021 23:53:02 +0000 Received: (at submit) by debbugs.gnu.org; 20 Dec 2021 23:52:16 +0000 Received: from localhost ([127.0.0.1]:51739 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mzSS0-0002c4-7j for submit@debbugs.gnu.org; Mon, 20 Dec 2021 18:52:16 -0500 Received: from lists.gnu.org ([209.51.188.17]:41726) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mzSRv-0002bu-Rq for submit@debbugs.gnu.org; Mon, 20 Dec 2021 18:52:15 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54784) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mzSRv-0001Jc-IB for guix-patches@gnu.org; Mon, 20 Dec 2021 18:52:11 -0500 Received: from [2607:f8b0:4864:20::334] (port=44651 helo=mail-ot1-x334.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mzSRt-00007A-Qd for guix-patches@gnu.org; Mon, 20 Dec 2021 18:52:11 -0500 Received: by mail-ot1-x334.google.com with SMTP id u18-20020a9d7212000000b00560cb1dc10bso14490435otj.11 for ; Mon, 20 Dec 2021 15:52:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=wpt+A0y/zx4JKAcA1cOGo8XaXGoiB/RnbBOrh8WEHYU=; b=qakjr2mQz9qP2WGtFfsq3o6i6VX54m1RuMefqvlaw4mx12Pg8BlaYi1sesmrEQBS4W 0rl0HkLdSIAlPm8halmBvTNe5dcC4YXWNSk0I9Nsg5/C/aD7N+plxTP2JcUf6+zHpH9O NkDkI1vh7iLgaUbLOKZ7dGtVIR9Qg5LazGNX1hn9HEbD/X1RUEm5d4oV1Iec8OxHPKpe cSt+PSlDqPY0PLiy9zdKegIZ1mG4NuUCzTH++BoRtEySlxmu6OGBfCi28yse97sfC+2v gVO/k7pz7ByawN+HdcQUkD3ZIKcrPsEZMcEfD+2iyfvgx62SAnRT8lNvYZRs67LB7/f6 oLqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=wpt+A0y/zx4JKAcA1cOGo8XaXGoiB/RnbBOrh8WEHYU=; b=cyJwaUgTR8MWs/VBH2tdpz1yUAke9bfUS0WhzCVoxvcGZOKFlwx6xBJ/UgB2GNDAXq nUHOexcO7vXXLyUqrcezG+GWuinMixSHMJeZRjMGT1Ay3tRFRuWAbUUj9SzMtkOhQ5MM E+g/gB2OeRk65/fRQY/Ul0xiIycRSJtmVfd+5vmfrvWb8Dd4HKbMmPxHaAya8uw2I1Zo lZLrZ6tDCEZaEBTRkL4KNSYcKdl145ljGaMwETB/X+4FvJN/UZRhjW/R1ibrRZOQI2ai 4prIBk1Wv/Y9YwlsWNqWyLu3IFdoAMs3pGuiQSCJwmRM3UkPUTw6Nch6MWk3cxdFRWzN Olhg== X-Gm-Message-State: AOAM533FlAwFP2pr7w5x9jGctjgcStrErowMD16xrxUStkIt3JbMhnR4 APRb04CNqSC/h0yGWs+Qv+nYuEs/zsQ= X-Google-Smtp-Source: ABdhPJw8zRoK8Z6r+Pa/MPYaS4IZ6AbL/BK98snltyL5hbGEe6PKyXYsessJoCZEC0xkh9Jq/Ftc+Q== X-Received: by 2002:a05:6830:4119:: with SMTP id w25mr407050ott.98.1640044326085; Mon, 20 Dec 2021 15:52:06 -0800 (PST) Received: from guixlaptop.austin.rr.com (cpe-70-123-155-155.austin.res.rr.com. [70.123.155.155]) by smtp.googlemail.com with ESMTPSA id p14sm3284675oou.31.2021.12.20.15.52.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Dec 2021 15:52:05 -0800 (PST) From: Nathan Dehnel Date: Mon, 20 Dec 2021 17:51:53 -0600 Message-Id: <20211220235153.20101-1-ncdehnel@gmail.com> X-Mailer: git-send-email 2.34.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::334 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::334; envelope-from=ncdehnel@gmail.com; helo=mail-ot1-x334.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) 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 (--) From: Nathan Dehnel <5498361+Gooberpatrol66@users.noreply.github.com> * gnu/services/vpn.scm (wireguard-configuration): Add dns field * doc/guix.texi: Document dns field --- doc/guix.texi | 3 +++ gnu/services/vpn.scm | 11 +++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index aca88cdada..8e9cd8df18 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -28601,6 +28601,9 @@ The IP addresses to be assigned to the above interface. @item @code{port} (default: @code{51820}) The port on which to listen for incoming connections. +@item @code{dns} (default: @code{#f}) +The DNS server(s) to announce to VPN clients via DHCP. + @item @code{private-key} (default: @code{"/etc/wireguard/private.key"}) The private key file for the interface. It is automatically generated if the file does not exist. diff --git a/gnu/services/vpn.scm b/gnu/services/vpn.scm index 6004e41d8d..1a8f2c8d6a 100644 --- a/gnu/services/vpn.scm +++ b/gnu/services/vpn.scm @@ -67,6 +67,7 @@ (define-module (gnu services vpn) wireguard-configuration-interface wireguard-configuration-addresses wireguard-configuration-port + wireguard-configuration-dns wireguard-configuration-private-key wireguard-configuration-peers @@ -715,7 +716,9 @@ (define-record-type* (private-key wireguard-configuration-private-key ;string (default "/etc/wireguard/private.key")) (peers wireguard-configuration-peers ;list of - (default '()))) + (default '())) + (dns wireguard-configuration-dns ;string + (default #f))) (define (wireguard-configuration-file config) (define (peer->config peer) @@ -739,7 +742,7 @@ (define (peer->config peer) "\n")))) (match-record config - (wireguard interface addresses port private-key peers) + (wireguard interface addresses port private-key peers dns) (let* ((config-file (string-append interface ".conf")) (peers (map peer->config peers)) (config @@ -755,6 +758,7 @@ (define (peer->config peer) Address = ~a PostUp = ~a set %i private-key ~a ~a +~a ~{~a~^~%~}" #$(string-join addresses ",") #$(file-append wireguard "/bin/wg") @@ -762,6 +766,9 @@ (define (peer->config peer) #$(if port (format #f "ListenPort = ~a" port) "") + #$(if dns + (format #f "DNS = ~a" (string-join dns ",")) + "") (list #$@peers))))))))) (file-append config "/" config-file)))) -- 2.33.1 From unknown Tue Jun 17 22:21:16 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#52689] [PATCH] services: wireguard: Add DNS config field. References: <20211220235153.20101-1-ncdehnel@gmail.com> In-Reply-To: <20211220235153.20101-1-ncdehnel@gmail.com> Resent-From: Nathan Dehnel Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 21 Dec 2021 20:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52689 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52689@debbugs.gnu.org Cc: Nathan Dehnel Received: via spool by 52689-submit@debbugs.gnu.org id=B52689.16401179317747 (code B ref 52689); Tue, 21 Dec 2021 20:19:01 +0000 Received: (at 52689) by debbugs.gnu.org; 21 Dec 2021 20:18:51 +0000 Received: from localhost ([127.0.0.1]:55789 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mzlb1-00020s-0i for submit@debbugs.gnu.org; Tue, 21 Dec 2021 15:18:51 -0500 Received: from mail-ot1-f52.google.com ([209.85.210.52]:36355) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mzlaz-00020d-KG for 52689@debbugs.gnu.org; Tue, 21 Dec 2021 15:18:49 -0500 Received: by mail-ot1-f52.google.com with SMTP id w6-20020a9d77c6000000b0055e804fa524so18127774otl.3 for <52689@debbugs.gnu.org>; Tue, 21 Dec 2021 12:18:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=O8dino611A5lw/XQ1ll4SjqZoWkiWcU/gvap+29j2J0=; b=NL137k0qOFYbNjbmzWmifJRoHppJ9LLSh2LWxWz18OikymVtOkIViqG5mXSy9Xy6Jt PFrHmTh+yDl2wFUw8rChuP81cXWWlpH5dGyaA0FE6BgvXm/Yri1+QSuONUVSe8C76HC/ V5JeBAe4mjy8TwdzptBy13uUX6oBzdJk1e0UbZdS6icLNjsltuhq1+1ZtSsBBBvTS8WX zZUrgG4wkdc9KSRAD+Nm3Fa3tuuDUWJy97hlGixaX+VM0mdkP4lRpImYL1n/9WVSGKLi PQn9MDYsGonIu79t18u/48sDJu6ZGkA+dZrg3oGKas1bRRZtsUBfPsYmEb1jnXzw7N8X f0vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=O8dino611A5lw/XQ1ll4SjqZoWkiWcU/gvap+29j2J0=; b=dMegW8IyEDfuASUM+JJIdgORbuWeQbnf4RAdphC9aZ3AcdgyB82KypU1ODYMAeq/EP 3yZ9Pj+KkeZ09zPgJ2m3UFyFgQlidMdXpEYgmHK1RQAneCcRrw4QYPDjMgsaWiZiAz7K Fnag4BZ2Ahd7ZuGjcYCw6Z7HZEqHFuERiuURceCmkPjov9SZumYdIISvpybcW4zC73Pz r4YdML12dR/bizFBbF7Q0u9gECVIQJV7981PB0X7kTfSnnS6NnZ4tDtmvhZrgDWxofyt 5pBwMK8OfVJhgH/TqOHO8YOMjVBMHpG3qdz1z9+L9rv+OcuwnD547BZIgmu77xpkeIbX TiHA== X-Gm-Message-State: AOAM531mBWSA4d+7/kTkvyL/XtrXlO4FR3RWcT1uVVPGQlhVCKixoWjd Q/kRWI/U3C0Q9HL2uHl4Td3bILeznpk= X-Google-Smtp-Source: ABdhPJwGNfM0zzlLCjbsfbqdzPclDJ7mYodt05hj/EnBwJO2IbIDkTo+dtBvFZCo5p6aJGVloTcs3g== X-Received: by 2002:a9d:7d83:: with SMTP id j3mr23831otn.236.1640117923766; Tue, 21 Dec 2021 12:18:43 -0800 (PST) Received: from guixlaptop.austin.rr.com (cpe-70-123-155-155.austin.res.rr.com. [70.123.155.155]) by smtp.googlemail.com with ESMTPSA id y12sm4446206oiv.49.2021.12.21.12.18.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Dec 2021 12:18:43 -0800 (PST) From: Nathan Dehnel Date: Tue, 21 Dec 2021 14:18:22 -0600 Message-Id: <20211221201822.15656-1-ncdehnel@gmail.com> X-Mailer: git-send-email 2.34.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 (-) * gnu/services/vpn.scm (wireguard-configuration): Add dns field * doc/guix.texi: Document dns field --- Redid the patch to change the comment from string to list of strings doc/guix.texi | 3 +++ gnu/services/vpn.scm | 11 +++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index aca88cdada..8e9cd8df18 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -28601,6 +28601,9 @@ The IP addresses to be assigned to the above interface. @item @code{port} (default: @code{51820}) The port on which to listen for incoming connections. +@item @code{dns} (default: @code{#f}) +The DNS server(s) to announce to VPN clients via DHCP. + @item @code{private-key} (default: @code{"/etc/wireguard/private.key"}) The private key file for the interface. It is automatically generated if the file does not exist. diff --git a/gnu/services/vpn.scm b/gnu/services/vpn.scm index 6004e41d8d..4ea9bcc12e 100644 --- a/gnu/services/vpn.scm +++ b/gnu/services/vpn.scm @@ -67,6 +67,7 @@ (define-module (gnu services vpn) wireguard-configuration-interface wireguard-configuration-addresses wireguard-configuration-port + wireguard-configuration-dns wireguard-configuration-private-key wireguard-configuration-peers @@ -715,7 +716,9 @@ (define-record-type* (private-key wireguard-configuration-private-key ;string (default "/etc/wireguard/private.key")) (peers wireguard-configuration-peers ;list of - (default '()))) + (default '())) + (dns wireguard-configuration-dns ;list of strings + (default #f))) (define (wireguard-configuration-file config) (define (peer->config peer) @@ -739,7 +742,7 @@ (define (peer->config peer) "\n")))) (match-record config - (wireguard interface addresses port private-key peers) + (wireguard interface addresses port private-key peers dns) (let* ((config-file (string-append interface ".conf")) (peers (map peer->config peers)) (config @@ -755,6 +758,7 @@ (define (peer->config peer) Address = ~a PostUp = ~a set %i private-key ~a ~a +~a ~{~a~^~%~}" #$(string-join addresses ",") #$(file-append wireguard "/bin/wg") @@ -762,6 +766,9 @@ (define (peer->config peer) #$(if port (format #f "ListenPort = ~a" port) "") + #$(if dns + (format #f "DNS = ~a" (string-join dns ",")) + "") (list #$@peers))))))))) (file-append config "/" config-file)))) -- 2.33.1 From unknown Tue Jun 17 22:21:16 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Nathan Dehnel Subject: bug#52689: closed (Re: bug#52689: [PATCH] services: wireguard: Add DNS config field.) Message-ID: References: <87pmppqcwp.fsf_-_@gnu.org> <20211220235153.20101-1-ncdehnel@gmail.com> X-Gnu-PR-Message: they-closed 52689 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 52689@debbugs.gnu.org Date: Wed, 22 Dec 2021 08:10:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1640160602-14469-1" This is a multi-part message in MIME format... ------------=_1640160602-14469-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #52689: [PATCH] services: wireguard: Add DNS config field. which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 52689@debbugs.gnu.org. --=20 52689: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D52689 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1640160602-14469-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 52689-done) by debbugs.gnu.org; 22 Dec 2021 08:09:24 +0000 Received: from localhost ([127.0.0.1]:56574 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mzwgd-0003kT-Um for submit@debbugs.gnu.org; Wed, 22 Dec 2021 03:09:24 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44072) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mzwgY-0003kB-Va for 52689-done@debbugs.gnu.org; Wed, 22 Dec 2021 03:09:22 -0500 Received: from [2001:470:142:3::e] (port=56820 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mzwgT-0000tp-OS; Wed, 22 Dec 2021 03:09:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=l085jvqE+5N1/JZnQBr3lHr63So+geWDU5PHl3uWPak=; b=XD/bJ5cB9hfUUWwwKj+/ F4KYHIbl6pUthMpMcyWyDW8u4zZ1vKNOotGeo0Y132XMOESvgk6rRh97G5695/2b/B2BEik0j8h64 20+fsQCwb5pzFFHNAip9svIPjOXO7XcHW97+hBv7Fbds09noNoDd6khzAJJYt+v2+QW3kNqajqmyO FSwcFhpGSMXD1SKghJ/Rll2qZX41/lR8+OQ0lsiMDbkpAQe5jer161CdUEtREIREkWXIBVj9W9Grw AjOjDaAyluJ1YrODg0syRqQEbU/eJm4gtjsMB7xH4uWnJhAguNSYAoy6AqMPJDnKN7T9AJgP69Lxm zLThCXxbZoUnNw==; Received: from [2a01:cb18:832e:5f00:3563:417e:2a38:86d8] (port=49240 helo=meije) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mzwgT-0004LY-8V; Wed, 22 Dec 2021 03:09:13 -0500 From: Mathieu Othacehe To: Nathan Dehnel Subject: Re: bug#52689: [PATCH] services: wireguard: Add DNS config field. References: <20211220235153.20101-1-ncdehnel@gmail.com> <20211221201822.15656-1-ncdehnel@gmail.com> Date: Wed, 22 Dec 2021 09:09:10 +0100 In-Reply-To: <20211221201822.15656-1-ncdehnel@gmail.com> (Nathan Dehnel's message of "Tue, 21 Dec 2021 14:18:22 -0600") Message-ID: <87pmppqcwp.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 52689-done Cc: 52689-done@debbugs.gnu.org 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: -3.3 (---) Hello, I added your copyright and pushed with an edited commit message. Thanks, Mathieu ------------=_1640160602-14469-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 20 Dec 2021 23:52:16 +0000 Received: from localhost ([127.0.0.1]:51739 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mzSS0-0002c4-7j for submit@debbugs.gnu.org; Mon, 20 Dec 2021 18:52:16 -0500 Received: from lists.gnu.org ([209.51.188.17]:41726) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mzSRv-0002bu-Rq for submit@debbugs.gnu.org; Mon, 20 Dec 2021 18:52:15 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54784) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mzSRv-0001Jc-IB for guix-patches@gnu.org; Mon, 20 Dec 2021 18:52:11 -0500 Received: from [2607:f8b0:4864:20::334] (port=44651 helo=mail-ot1-x334.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mzSRt-00007A-Qd for guix-patches@gnu.org; Mon, 20 Dec 2021 18:52:11 -0500 Received: by mail-ot1-x334.google.com with SMTP id u18-20020a9d7212000000b00560cb1dc10bso14490435otj.11 for ; Mon, 20 Dec 2021 15:52:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=wpt+A0y/zx4JKAcA1cOGo8XaXGoiB/RnbBOrh8WEHYU=; b=qakjr2mQz9qP2WGtFfsq3o6i6VX54m1RuMefqvlaw4mx12Pg8BlaYi1sesmrEQBS4W 0rl0HkLdSIAlPm8halmBvTNe5dcC4YXWNSk0I9Nsg5/C/aD7N+plxTP2JcUf6+zHpH9O NkDkI1vh7iLgaUbLOKZ7dGtVIR9Qg5LazGNX1hn9HEbD/X1RUEm5d4oV1Iec8OxHPKpe cSt+PSlDqPY0PLiy9zdKegIZ1mG4NuUCzTH++BoRtEySlxmu6OGBfCi28yse97sfC+2v gVO/k7pz7ByawN+HdcQUkD3ZIKcrPsEZMcEfD+2iyfvgx62SAnRT8lNvYZRs67LB7/f6 oLqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=wpt+A0y/zx4JKAcA1cOGo8XaXGoiB/RnbBOrh8WEHYU=; b=cyJwaUgTR8MWs/VBH2tdpz1yUAke9bfUS0WhzCVoxvcGZOKFlwx6xBJ/UgB2GNDAXq nUHOexcO7vXXLyUqrcezG+GWuinMixSHMJeZRjMGT1Ay3tRFRuWAbUUj9SzMtkOhQ5MM E+g/gB2OeRk65/fRQY/Ul0xiIycRSJtmVfd+5vmfrvWb8Dd4HKbMmPxHaAya8uw2I1Zo lZLrZ6tDCEZaEBTRkL4KNSYcKdl145ljGaMwETB/X+4FvJN/UZRhjW/R1ibrRZOQI2ai 4prIBk1Wv/Y9YwlsWNqWyLu3IFdoAMs3pGuiQSCJwmRM3UkPUTw6Nch6MWk3cxdFRWzN Olhg== X-Gm-Message-State: AOAM533FlAwFP2pr7w5x9jGctjgcStrErowMD16xrxUStkIt3JbMhnR4 APRb04CNqSC/h0yGWs+Qv+nYuEs/zsQ= X-Google-Smtp-Source: ABdhPJw8zRoK8Z6r+Pa/MPYaS4IZ6AbL/BK98snltyL5hbGEe6PKyXYsessJoCZEC0xkh9Jq/Ftc+Q== X-Received: by 2002:a05:6830:4119:: with SMTP id w25mr407050ott.98.1640044326085; Mon, 20 Dec 2021 15:52:06 -0800 (PST) Received: from guixlaptop.austin.rr.com (cpe-70-123-155-155.austin.res.rr.com. [70.123.155.155]) by smtp.googlemail.com with ESMTPSA id p14sm3284675oou.31.2021.12.20.15.52.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Dec 2021 15:52:05 -0800 (PST) From: Nathan Dehnel To: guix-patches@gnu.org Subject: [PATCH] services: wireguard: Add DNS config field. Date: Mon, 20 Dec 2021 17:51:53 -0600 Message-Id: <20211220235153.20101-1-ncdehnel@gmail.com> X-Mailer: git-send-email 2.34.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::334 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::334; envelope-from=ncdehnel@gmail.com; helo=mail-ot1-x334.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit Cc: Nathan Dehnel <5498361+Gooberpatrol66@users.noreply.github.com> 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 (--) From: Nathan Dehnel <5498361+Gooberpatrol66@users.noreply.github.com> * gnu/services/vpn.scm (wireguard-configuration): Add dns field * doc/guix.texi: Document dns field --- doc/guix.texi | 3 +++ gnu/services/vpn.scm | 11 +++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index aca88cdada..8e9cd8df18 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -28601,6 +28601,9 @@ The IP addresses to be assigned to the above interface. @item @code{port} (default: @code{51820}) The port on which to listen for incoming connections. +@item @code{dns} (default: @code{#f}) +The DNS server(s) to announce to VPN clients via DHCP. + @item @code{private-key} (default: @code{"/etc/wireguard/private.key"}) The private key file for the interface. It is automatically generated if the file does not exist. diff --git a/gnu/services/vpn.scm b/gnu/services/vpn.scm index 6004e41d8d..1a8f2c8d6a 100644 --- a/gnu/services/vpn.scm +++ b/gnu/services/vpn.scm @@ -67,6 +67,7 @@ (define-module (gnu services vpn) wireguard-configuration-interface wireguard-configuration-addresses wireguard-configuration-port + wireguard-configuration-dns wireguard-configuration-private-key wireguard-configuration-peers @@ -715,7 +716,9 @@ (define-record-type* (private-key wireguard-configuration-private-key ;string (default "/etc/wireguard/private.key")) (peers wireguard-configuration-peers ;list of - (default '()))) + (default '())) + (dns wireguard-configuration-dns ;string + (default #f))) (define (wireguard-configuration-file config) (define (peer->config peer) @@ -739,7 +742,7 @@ (define (peer->config peer) "\n")))) (match-record config - (wireguard interface addresses port private-key peers) + (wireguard interface addresses port private-key peers dns) (let* ((config-file (string-append interface ".conf")) (peers (map peer->config peers)) (config @@ -755,6 +758,7 @@ (define (peer->config peer) Address = ~a PostUp = ~a set %i private-key ~a ~a +~a ~{~a~^~%~}" #$(string-join addresses ",") #$(file-append wireguard "/bin/wg") @@ -762,6 +766,9 @@ (define (peer->config peer) #$(if port (format #f "ListenPort = ~a" port) "") + #$(if dns + (format #f "DNS = ~a" (string-join dns ",")) + "") (list #$@peers))))))))) (file-append config "/" config-file)))) -- 2.33.1 ------------=_1640160602-14469-1--