From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id NbYQO//PoWMogAAAbAwnHQ (envelope-from ) for ; Tue, 20 Dec 2022 16:08:48 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id qIsaOf/PoWO26wAAG6o9tA (envelope-from ) for ; Tue, 20 Dec 2022 16:08:47 +0100 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 8BBDF9EBE for ; Tue, 20 Dec 2022 16:08:47 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p7eDH-0003kq-Hn; Tue, 20 Dec 2022 10:07:27 -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 1p7eCo-0003Uz-Px for guix-devel@gnu.org; Tue, 20 Dec 2022 10:07:04 -0500 Received: from relay6-d.mail.gandi.net ([217.70.183.198]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p7eCm-0006jd-RO for guix-devel@gnu.org; Tue, 20 Dec 2022 10:06:58 -0500 Received: (Authenticated sender: andrew@trop.in) by mail.gandi.net (Postfix) with ESMTPSA id C3E99C0015; Tue, 20 Dec 2022 15:06:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop.in; s=gm1; t=1671548812; h=from:from: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; bh=Kge1N+eoquW0yZmWL2knUCZbi3TRa1VDcbWGXgBS1qk=; b=SuV/fc93wR2HydX9tj1nNE+E6KzPpbCRY4sNiGEHaOQqV1uTdghckhVNQAj0BuO4aNczJF 0yAogtlhLZ0PtVLjlbo/A/AsQAJqDHoW8j3MwbxIufWbJfsD1OVTrOcI6cSLMghOBA9ZzZ XUvayAPRKTDd5sSwjuKYpg6u9nk276u18ucYEIAMT7RHXH6kLmVlgsfDNfuciNy4hMxEF5 Or+DDAeJ4JzMW502U7iY5a5c4uIWbxzvCaUVSauAWO0NcI9/fh4kpVxh3W9qkHMBWA9fyi CJWqFJiSAmeZ+qmvf63zJhsL2TsndonUwJCmVv+R0tgJvaFaVdov4r2gElyksQ== From: Andrew Tropin To: Mekeor Melire , Liliana Marie Prikler Cc: guix-devel@gnu.org Subject: Re: Proof of Concept: Import Emacs' use-packaged packages into Guix' manifest.scm In-Reply-To: <87edsuh0i9.fsf@posteo.de> References: <87r0wxbhm5.fsf@posteo.de> <87edsuh0i9.fsf@posteo.de> Date: Tue, 20 Dec 2022 19:06:48 +0400 Message-ID: <87wn6mxgfr.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Received-SPF: pass client-ip=217.70.183.198; envelope-from=andrew@trop.in; helo=relay6-d.mail.gandi.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: guix-devel-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=trop.in header.s=gm1 header.b="SuV/fc93"; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1671548927; a=rsa-sha256; cv=none; b=LIr1xmqI7eczI6zL0ooV+7SixM6EcArqFBmcx6YNGaPo7lKV9odQHtU3H7i5rn5tW9iS6O BOnU6qaDGtYPaKxNF50DPQdd3J2Q7xcDQP25L2MeIHCkWTGQlNlkbnpIonSLvj9DaHXP1X v4YyyrEmVmq8aCLLIB6RTfVE2MhAaT/J1wYcugRzlyLIJDuhje6m3B7EvadPSzrTK+TokL +J11lx3/78fse+tb3q6D+DgQ1pe60rqZGfasu3GZ8/QJAHqFEegxUUvVli7BoIN8i5f9qT 3o7bjWR2nBGAIPOvWZGAcA/q1tfNr8s7C4cgbHaDyqTfTkaJKYuSoAw/oe9KQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1671548927; 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:dkim-signature; bh=Kge1N+eoquW0yZmWL2knUCZbi3TRa1VDcbWGXgBS1qk=; b=rGWNzO1NiH01IDMqd00b+cfNgCn1lVKumqOIcYiSHxFt2QSIgERqnTX/mi268nDckufPJO 2OWv1SJyl242KblwZbxKzvvtmfZWbpLxKyF2pScamDgyK3dRMsdejo9jsKeSnGoFN4oywu Cozrb51FW6DwPAIWxYSyDNga9xoCAbT9eDWfArnPa4kLQ6lGMExQCh76VqaEyrH2bYLcai lpTwl3aybn9n8QTjfVn8f3mlHVAKu8X9cqB6ucQzsStKN2j/LpIhHZMif37O98BKBaA2Mv 6zX0dl5Oxdgu9Vxacou2ViPhhbdNOsRYnfN9SVbqvWdttjPyFIhQUERTyPzzTg== X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=trop.in header.s=gm1 header.b="SuV/fc93"; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org"; dmarc=none X-Migadu-Spam-Score: -11.05 X-Spam-Score: -11.05 X-Migadu-Queue-Id: 8BBDF9EBE X-TUID: 3LZPxTPPJ3C6 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On 2022-12-20 09:16, Mekeor Melire wrote: > 2022-12-18 09:11 liliana.prikler@gmail.com: > >> I think we should be able to build an Emacs service in Guix Home that ca= n=20 >> manage init.el. As a workaround, use-package should also have a :when=20 >> clause, so you can use :when (featurep 'some-package-autoloads) if you'r= e=20 >> unsure whether 'some-package is actually installed. This makes your init= =20 >> file a little more resilient and is particularly useful with pure shells. > > =3Dguix home import=3D for init.el is a great idea! (See below for use-ca= ses.) > > And yes, =3D:when (featurep 'some-package-autoloads)=3D is a workaround t= hat makes=20 > init.el files loadable even if respective packages are not available. But= the=20 > submitted code aims to enable you to install needed emacs-packages so tha= t=20 > such a restricting workaround is not needed. > >> Given the caveats, I would rather like to see an Emacs Lisp based script= =20 >> that mocks use-package and generates a manifest by evaluting init.el. Th= is=20 >> should give you more correct results. It's not a bad idea per se, but as= -is,=20 >> I think it would better be maintained in your own channel before=20 >> upstreaming. > > Problem is that in cases where needed packages are not installed and the = user=20 > did not add =3D:when (featurep 'foo)=3D everywhere, it's possible that ev= aluating=20 > init.el will fail because of some package not being available. Thus, IMHO= , we=20 > can't rely on Emacs to evaluate the init.el. But we could use Emacs to ex= pand=20 > the (use-package) macros inside init.el. But I doubt that it's worth it. = I=20 > rather think it's easier to use Guile to parse invocations of =3Drequire= =3D and=20 > =3Duse-package=3D. > >> For upstreaming, I see two potential paths. The first one would be=20 >> integration to `guix home import', which Andrew Tropin (CC'd) could prob= ably=20 >> tell you more on. The second would be integration into `guix package' as= a=20 >> callable function/command line argument, but IMHO that's less likely to= =20 >> pass. > > All in all, I think there are three use-cases: > > - If you want Guix Home to handle the installation of emacs- packages, th= ere=20 > should be =3Dguix home import=3D to automatically install those package= s, as=20 > resulting from early- and init.el files. guix home import doesn't install anything, it only generates a configuratio= n. > > - If you simply want to install all emacs- packages once per CLI, there s= hould=20 > be =3Dguix package --install-from-elisp-file=3D~/.emacs.d/init.el=3D an= d similar=20 > CLI-arguments or -commands, such as --install-from-elisp-expression,=20 > --install-from-elisp-init-files. There could also be --fit-to-elisp-=20 > variants which not only install packages, but also remove redundant, un= used=20 > emacs-* packages. I don't think we want a separate tricky flags here. Especially we don't want some implicit logic removing unused packages. Just =2D-8<---------------cut here---------------start------------->8--- guix package --install-from-expression=3D\ ((@ (mekeor emacs-helper) generate-package-from-elisp) \ #:elisp (local-file "./init.el")) =2D-8<---------------cut here---------------end--------------->8--- should be enough. If you want to be sure unused packages are not installed just don't use imperative guix package and maintain you configuration in declarative manner. > > - If you want to use a manifest.scm for your Guix user-profile and > import appropriate emacs- therein, there should be Guile modules and > functions which allow to do so, as the submitted code does. Those > modules could also be used with =3Dguix package -e=3D. > > And in all three cases, your early- and init.el files might load packages= via=20 > =3Drequire=3D or =3Duse-package=3D at least. =2D-=20 Best regards, Andrew Tropin --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmOhz4gACgkQIgjSCVjB 3rC9IA//czoNweO8UWaZglD39ODI95HICTN1w1VCYTn0AOfOnWMiCcEOPPsox6HQ Qu4V1EopxGvzkpSLq7i4awHDeD/Af39dmH3qKpS9gL++K7d0L5LkFnoKhakyOslM n2FVHO1wZa5m5viIKOEDqOWYg4RdBJqclIUGhXEF8QeqreXQu87qiXTQk01DLkaA bSDqIpiT80QhEsQ1IbABaTIRCIFr4ErOALdlvxeUuKor9qdNG738dOOW6jedjNj0 SG8I1u7tMqDyx0BAYSfMk1cM9jkJPE0DssRNsmIOR3F1uHnWQ+KacB/8/mrj3A7q HXLG2ibAS3vI9JUB+h9stnYeLfAYjWNO81SKWiKkPOVuipWztY1ueHvVKV0YIpWo 6d+wHccj2+S7ZKT3ZRE2uq+0rky73T//PLxlGJgPxZ0Xl2v4WuE2Wr9o9Fl8BNer Sgrs5Tm4mbncKktlp3jxRNy9uTWYk19cbHA3SCmyA91B9pgZ/4CGQMFq5y4ZBdaa dqOPvLvIi/NoGeFuELrJ6u+V1SKL9YzO1td7E3yrtaQqqmR6C3lcvniF8dbIOZ7o Nv3bqsv3tuI1aQbAUCd3C+kE3LkhwnlcvI0hYjtSjJ9/oTlrtrBorSn9ep6DCaLO 7wYEWYeBFrE8jrIPTDCFDrWQdFq/PoK/qRxybF6953EE9LrERvk= =KzEG -----END PGP SIGNATURE----- --=-=-=--