From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id sP4wKtCetmU3WQAA62LTzQ:P1 (envelope-from ) for ; Sun, 28 Jan 2024 19:37:04 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id sP4wKtCetmU3WQAA62LTzQ (envelope-from ) for ; Sun, 28 Jan 2024 19:37:04 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=none ("invalid DKIM record") header.d=freakingpenguin.com header.s=x header.b=Lr+dmZGf; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1706467024; h=from:from:sender:sender: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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=RYPnYxheee/5Nmpd9ONvWDmEXJM0yvwm6lkRYwLNVnI=; b=UfVfi46SQzfNUCp5vPJAqjBU4qAKlhq8n9fGTUL61YrxAR8DHqbfGuWW1QCslCUTD6IqH+ zwcCqEWHh5xe+Zvp75SffsCHcZCaBghQwJGuaPCo7TM0FFR0rBrV8Ic/xbgoD2O8ecsEsx ehulQpUZ4+2o/PqYmDgFhuaSPALx/FKObz747kffv96V5urTwJ3WU+tZSh4i52AXd2aD4E 0JyCt+1WhMxF/oq1kbLHlt8+F1jociFby6TWHcu6wZtQ0gFa1FGiD4t2Bw3shGcF6KT2Br UcBMjnlabtozLK0sNRVfXYmIq24H/1NY8GsITef5OijJ4dnCBVR+xOtUSmM7tQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none ("invalid DKIM record") header.d=freakingpenguin.com header.s=x header.b=Lr+dmZGf; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1706467024; a=rsa-sha256; cv=none; b=q1lARgWWY6hq7bGdIALR1uznDE4pocvVGZP/Ql0xvf0F36yhZARDmp4rHSZB0rWr9gdlGL T0dZHlyoagJ/7zRG99Rz7BQTiudRaFm6ALgn+qtL+qnqZ4G3zdcs6MnFAnW+4Xr88B6ADQ oJhwXLdmSvjXtfBw8A6JyBpWE2AnhhPe/Ch2N0nppzPYg5gwlyVL6tRGoG4cdPc4t1LkWJ H+heit8CMmnRgE3x5fTbUqZH4OUZ5mL6BhXkP8OP95PSXpr5u3F+TCIYi8tBLSSMqH6nph ZSkqTTQr1dCOhpDHT1FYDjs3UzcO6mw+KPpoyJwNbco/VpVSHxBwn1ojMM27rg== 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 8B05A16250 for ; Sun, 28 Jan 2024 19:37:04 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUA1F-000581-KK; Sun, 28 Jan 2024 13:36:38 -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 1rUA1C-00055y-0x for help-guix@gnu.org; Sun, 28 Jan 2024 13:36:34 -0500 Received: from mail-108-mta138.mxroute.com ([136.175.108.138]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rUA19-0000Wr-Py for help-guix@gnu.org; Sun, 28 Jan 2024 13:36:33 -0500 Received: from filter006.mxroute.com ([136.175.111.2] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta138.mxroute.com (ZoneMTA) with ESMTPSA id 18d515bccdf0003727.001 for (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Sun, 28 Jan 2024 18:36:27 +0000 X-Zone-Loop: 8fb967103f85c450f92f9478970e35a4bc64352f8ea7 X-Originating-IP: [136.175.111.2] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=freakingpenguin.com; s=x; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Message-ID:Date:References:In-Reply-To:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=RYPnYxheee/5Nmpd9ONvWDmEXJM0yvwm6lkRYwLNVnI=; b=Lr+dmZGfjLLBuotUAS8MlGW0aJ ltR8aZ2VGtG+O8iX6idcyJ1La3SCK/TIpz7Su3KtIDFBi/gsrZj2r7Y5G/u/+uJrFq7wF+H0agHB+ WDlM5ZnKPTTbyPYXQWOVgsUDK5mHSyOsSuKBMNk1bSihS8QXzInjywwqJq1pzyMkG010aRQ8lLVCy 4WTCSlaeN2SfS/yB2mIx1TL27CQnlcGPPSvxOuiaTNy648n8EstC/0s1A299+HI5qzvb/aoD+/eMR uMMs7NIFQLtGQ3ruZMDM7PzIe4/1AGG4BQZksNij6reSxbcA1kea5Tx343xj6Vi58QbOx9SLI88rf CVJmsIwg==; From: Richard Sent To: =?utf-8?Q?Cl=C3=A9ment?= Lassieur Cc: help-guix@gnu.org Subject: Re: Using gexps in wireguard-service-type postup In-Reply-To: <87wmrttuz3.fsf@lassieur.org> (=?utf-8?Q?=22Cl=C3=A9ment?= Lassieur"'s message of "Sun, 28 Jan 2024 15:04:32 +0100") References: <93b89074d790b8554de4c10434fc6be2@freakingpenguin.com> <87wmrttuz3.fsf@lassieur.org> Date: Sun, 28 Jan 2024 13:36:19 -0500 Message-ID: <87v87dnw4c.fsf@freakingpenguin.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Authenticated-Id: richard@freakingpenguin.com Received-SPF: pass client-ip=136.175.108.138; envelope-from=richard@freakingpenguin.com; helo=mail-108-mta138.mxroute.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: help-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -6.65 X-Migadu-Scanner: mx13.migadu.com X-Spam-Score: -6.65 X-Migadu-Queue-Id: 8B05A16250 X-TUID: SPr7ysVH+irD Cl=C3=A9ment Lassieur writes: On 2024-01-28 09:04, Cl=C3=A9ment Lassieur wrote: > Hi Richard, > which would be se same as >=20 > (private-key #~(string-append #$sudo "/bin/sudo -u user <(pass ..= .)")) Thanks. I made some progress with this, although I wound up hitting another hurdle with the preshared-key. When setting private-key, the following works fine: --8<---------------cut here---------------start------------->8--- (private-key #~(string-append "<(" #$sudo "/bin/sudo" " -u richard " #$password-store "/bin/pass ls " #$wireguard-nickleslan-p= rivate-key-key ")")) --8<---------------cut here---------------end--------------->8--- preshared-key, unfortunately, doesn't follow that same pattern. When setting preshared keys with the following snippet: --8<---------------cut here---------------start------------->8--- (wireguard-peer ... (preshared-key #~(string-append "<(" #$sudo "/bin/sudo -u richard " #$password-store "/bin/pass ls " #$wireguard-nickleslan-= preshared-key-key ")"))) --8<---------------cut here---------------end--------------->8--- I wind up with a wireguard.conf file with the following line. --8<---------------cut here---------------start------------->8--- PostUp =3D /gnu/store/4cnl0h79zc599xryr5jh66d7yq643zk4-wireguard-tools-1.0.= 20210914/bin/wg set %i private-key <(/gnu/store/gnybfg31is632dyaivd907f2h0w= ff80d-sudo-1.9.14p3/bin/sudo -u richard /gnu/store/ppd5qmx2b5fadjhww65xw09z= kjphll6r-password-store-1.7.4/bin/pass ls System/WireGuard/NicklesBread/pri= vate.key) peer EHoPXGJvQVVpQ6PZ/XQtHx0p5FWEVCS3y2oI2O+Y9zo=3D preshared-key= (string-append <( /gnu/store/gnybfg31is632dyaivd907f2h0wff80d-sudo-1.9.14p= 3 /bin/sudo -u richard /gnu/store/ppd5qmx2b5fadjhww65xw09zkjphll6r-passwor= d-store-1.7.4 /bin/pass ls System/WireGuard/NicklesBread/preshared.key )) --8<---------------cut here---------------end--------------->8--- Emphasis on how everything after preshared-key is a Lisp sexp, not evaluated output. I'm guessing this is because in gnu/services/vpn.scm, the relevant code is l --8<---------------cut here---------------start------------->8--- (format #f "PostUp =3D ~a set %i private-key ~a\ ~{ peer ~a preshared-key ~a~}" #$(file-append wireguard "/bin/wg") #$private-key '#$peer-keys) --8<---------------cut here---------------end--------------->8--- Peer keys is quoted immediately before the ungexp. I'm curious why that would be done and how I can get preshared-key set correctly. I did try changing preshared-key to (preshared-key #~,(...)), but that didn't accomplish anything besides creating a wireguard.config file with `preshared-key (unquote (string-append ...))` I assume this is because a quote (') is used instead of a quasiquote (`). Is there anything on my end I can do to fix this or does it have to be resolved in Guix proper? --=20 Take it easy, Richard Sent Making my computer weirder one commit at a time.