From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id KDMZLGuwZmYfHwEA62LTzQ:P1 (envelope-from ) for ; Mon, 10 Jun 2024 07:51:07 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id KDMZLGuwZmYfHwEA62LTzQ (envelope-from ) for ; Mon, 10 Jun 2024 09:51:07 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1718005867; a=rsa-sha256; cv=none; b=lIWI/PKiUOivhFLS/rMaSp8szwZDkS4W4A+Gc9JYeDXb+kEiI5l64xs/5EdctF2zNMoya2 cHe/xaJTzcNCOJxMdcsSZBw6/WId/OFpxf37ex9qW9kh7I2tj5SmRkHziIWaHvZCA3ouzc I0PcW8qvMgE4ODuYnEhAgm5tLysDu9O2oXZH4roZlLXwjpzJXwwtiYC+Fku+zTWhseuVXZ lzFT6z1F3o47WkVxumJkGM9JBxDcHCKbtWR4z/OtPbTu2oOR3Dru+0a/H6SMoF7fLNflG3 05KPJZf3g3hbn91pKbnVYc2ldg2BfwQH5TwHkKkbSY4YJJVcWYqydVWQ+Ax7QQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1718005867; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=+sU3lhdhwqpQi0Djhcjv4NKjmy0PVwNbTao+cA3i4Ug=; b=cPLqNUve5XSbgXcYWzd4JkKMbNinTuu//rJmyPe5N+Fu5bJBwxWOtMANFoGSFWOEG2H31y jZS9ctdMrgLrTjBwg7kIEluQoUb7aj8H1wE4f2NGoknJpjcuixjjfN5mTUGOiaknO/N2IK eIbrk6avFZMiGQhxSq5cELviKte1G6Kc0zcA6IIIbbtvog+ak/f/YZ/PZ2ArazYWxY2ZCg QMe8b4KzfC8V2OM6pFL6HgOLHOUoxe6au1QywIxMKciJD5i134hXSMUr72JgHIh3ggpY14 Xxf3G8YBaka2QFdFHLUmN+RvUddNUWQ3nW4WK65u730hhKS//2Fb1dyEDKgSrg== 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 5934D1BC46 for ; Mon, 10 Jun 2024 09:51:07 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sGZnV-0008RM-OB; Mon, 10 Jun 2024 03:50:33 -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 1sGZnP-0008QR-Nl for help-guix@gnu.org; Mon, 10 Jun 2024 03:50:29 -0400 Received: from mira.cbaines.net ([212.71.252.8]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sGZnN-0003ol-TT for help-guix@gnu.org; Mon, 10 Jun 2024 03:50:27 -0400 Received: from localhost (unknown [212.132.255.10]) by mira.cbaines.net (Postfix) with ESMTPSA id 1E4C327BBE2; Mon, 10 Jun 2024 08:50:23 +0100 (BST) Received: from felis (localhost.lan [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id b8a2e280; Mon, 10 Jun 2024 07:50:22 +0000 (UTC) From: Christopher Baines To: =?utf-8?Q?Abb=C3=A9?= Cc: help-guix@gnu.org Subject: Re: Seeking help with g-expressions maze In-Reply-To: <171799411588.7.857514431154339738.351278683@p.atriar.ch> (=?utf-8?Q?=22Abb=C3=A9=22's?= message of "Mon, 10 Jun 2024 04:35:09 +0000") References: <171799411588.7.857514431154339738.351278683@p.atriar.ch> User-Agent: mu4e 1.12.4; emacs 29.3 Date: Mon, 10 Jun 2024 08:50:20 +0100 Message-ID: <875xuh1bk3.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Received-SPF: pass client-ip=212.71.252.8; envelope-from=mail@cbaines.net; helo=mira.cbaines.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Queue-Id: 5934D1BC46 X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -8.44 X-Spam-Score: -8.44 X-TUID: A7PAZqExWo44 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Abb=C3=A9 writes: > (define-configuration/no-serialization home-rbw-configuration > (pinentry-program > (file-like (file-append pinentry "/bin/pinentry-curses")) > "Pinentry program to use.") > (email > (string "") > "Email address of the user") ... > (define (rbw-config config) > (match-record config > (pinentry-program email base-url identity-url notificat= ions-url > client-cert-path sync-interval lock-t= imeout) > `((pinentry-program . ,pinentry-program) > (email . ,email) > (base_url . ,base-url) > (identity_url . ,identity-url) > (notifications_url . ,notifications-url) > (client_cert_path . ,client-cert-path) > (sync_interval . ,sync-interval) > (lock_timeout . ,lock-timeout)))) > (define (home-rbw-configuration-file config) > (let ((xformed-config (rbw-config config))) > (computed-file "rbw-config.json"=20 > > #~(call-with-output-file #$output > (lambda (port) > (display #$(scm->json-string xformed-config) p= ort)))))) Here you're calling scm->json-string on an alist containing the file-append record for pinentry-program. scm->json-string doesn't know how to handle that, it's invalid. Hence the exception you're getting. > `(("rbw/config.json" ,(home-rbw-configuration-file config)))) ... > While applying this module, I end up with following obvious error, but > I'm not quite sure how to go about resolving this: > > ----------------8<----------------------8<----------------------- > ice-9/boot-9.scm:1685:16: In procedure raise-exception: > Throw to key `json-invalid' with args `(# "/bin/pinentry-curses">)'. > ----------------8<----------------------8<----------------------- If you want to use scm->json-string, you need to be working with a data structure it can understand, and it can't understand gexp's. That suggests you should run it on the build side, once the file-append record has been transformed in to a string. I think this would be similar to how the transmission service in Guix builds it's settings.json file. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAmZmsDxfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh aW5lcy5uZXQACgkQXiijOwuE9XdJYw//Yxci6Cdp4us7gA2ckpZjibBDDih5Jaw6 5lVGQUWNKVNjsVUmKy3RQSZvBEdj6LvolaoUpnBhwwU/99mNnc2mAPG4xvv7G38t gvUIyKNIAz0LPEQMAJrPl+E24ObtgmY7RWTIwlMqDueVTM9+ym7MhK+/4wx3aiSS egvReLjzUi/vs3SxUPBDMYseAp85LJlJNSk5n+grXM8PigDfWc10IoapwMX4xe4j 0+ptAO0tNPDiXK3rbtGJDYDPUZtvnRAEh/wcSv80Ylos+nu96ztkbOoT8ZlBjeJD PptSOVb8xhViZrr/5sirNNyTD4XJxzsMjUgCSBL1Hd8utpTDH33rTBMqKtvXnNkj MTgOCQv/Od+COukXqo42ALr3CBJ3UWbXKXcOA2N/52aE/KzJekdNu9nPPNue4u2F cH9pygVLvMMY8IYw4A3iDKqL1wuxdIIDHriPRgFazfpyVyuxvlSYy35yW5ScZ2iu rNc97PD80Owew/oD+3I9TKUsMgPmpJ1V7i0TlGKXMafMCWMXMwW3eKIE6UAdqYDD jHeQ1ihsWTzkI0GI+JayUgubp8cxl1YSvnTi67Q1ZOmGyzaIy4x0ezzMjLpUujNd EcZYRpNurJMqsfcKjPzuvKMPyKUNz8DhbJp1IatSUWb4YC6UPLuUtNEH0FGsRwRy 1kKR64RtUlE= =QXVd -----END PGP SIGNATURE----- --=-=-=--