Subject: [PATCH v2 0/2] Improve customizability in WireGuard service

From: Richard Sent <[email-masked]>
Date: Wed, 23 Oct 2024 11:30:05 -0400

Hi all,

Thanks for the quick review Mathieu!

This patch is largely the same as before, but I spent some time
adjusting the documentation and adding an example of retrieving the
private key programmatically.

One interesting tidbit is pre-up and pals can alternatively be wrapped
in the gexp directly instead of each entry being gexp'd individually.

> ;; normal
> (pre-up (list #~(string-append "wg set %i private-key <("
>                                #$(file-append password-store "/bin/pass")
>                                " WireGuard/private-keys/%i)")))
> 
> ;; alternative
> (pre-up #~((string-append "wg set %i private-key <("
>                            #$(file-append password-store "/bin/pass")
>                            " WireGuard/private-keys/%i)")))

I see why this works (and it should work with any other service that
handles config lists with splicing+list wrapping), but it does feel a
little bit odd.

Seeing as how no other service seems to use the alternative form, I
opted to document the former.

Richard Sent (2):
  services: wireguard: Make the private-key field optional.
  services: wireguard: Support lists of gexps for most fields.

 doc/guix.texi        | 36 ++++++++++++++++-----
 gnu/services/vpn.scm | 75 +++++++++++++++++++++++---------------------
 2 files changed, 69 insertions(+), 42 deletions(-)

base-commit: bd26815cf8ce38a3b03676a6e3fc482bb74247cb
-- 
2.46.0