From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id wI8HNfmHoWO8vAAAbAwnHQ (envelope-from ) for ; Tue, 20 Dec 2022 11:01:29 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id UFMoNPmHoWPyfAAAG6o9tA (envelope-from ) for ; Tue, 20 Dec 2022 11:01:29 +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 7A6ED3BE39 for ; Tue, 20 Dec 2022 11:01:29 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p7ZBs-00083g-LI; Tue, 20 Dec 2022 04:45:40 -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 1p7ZBm-00082V-5j for guix-devel@gnu.org; Tue, 20 Dec 2022 04:45:35 -0500 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p7ZBk-0004qQ-2M for guix-devel@gnu.org; Tue, 20 Dec 2022 04:45:33 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id BDE93240026 for ; Tue, 20 Dec 2022 10:45:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1671529529; bh=WcGBuAik2rhdlosBlmMdAQXJEXDAERNLE+82/AAzcOU=; h=From:To:Cc:Subject:Date:From; b=V+L5ioeKWkGFAMuDGl3u4Jp0PAUZ/TuWh8Wp0xAJoXE3g/uvc9/QaQq6qMSNifGnP FV9mFWdxC7HZlxJu3uqDAhSkZ25oEtdRp5h/Okzzv9QHvz/U1oFXO2QKaD8bclIJyr TJG5bDa/YKm+4QFXuL3RWXbEfVdjn9e3YDKcQaxDZu47dEwsDK0Mfhc08En1yPmt9p V+5LLfEyeCf5BydN53XLqhWkReyrMDryCO1CeTyJb7mbqHfO+BiVpqBJHu5oLQRCHK WjVyAmMqB/tjeYEI1ZQcQX46E3Q9/rWgdtAu9C2IypxYE6pD6IQ9JN5i092IVS8OsQ pElQPBzNxI82A== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4NbsBb3Msnz9rxL; Tue, 20 Dec 2022 10:45:27 +0100 (CET) References: <87r0wxbhm5.fsf@posteo.de> From: Mekeor Melire To: Liliana Marie Prikler Cc: Andrew Tropin , guix-devel@gnu.org Subject: Re: Proof of Concept: Import Emacs' use-packaged packages into Guix' manifest.scm Date: Tue, 20 Dec 2022 09:16:47 +0000 In-reply-to: Message-ID: <87edsuh0i9.fsf@posteo.de> MIME-Version: 1.0 Content-Type: text/plain; format=flowed Received-SPF: pass client-ip=185.67.36.65; envelope-from=mekeor@posteo.de; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, 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=posteo.de header.s=2017 header.b=V+L5ioeK; 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=pass (policy=none) header.from=posteo.de ARC-Seal: i=1; s=key1; d=yhetil.org; t=1671530489; a=rsa-sha256; cv=none; b=Rgl9gitPlTjI6G1+esfULat9xj0UVX78BEll22bMmelumXidU767ail5ek/EKXHE3xjaYo HJ53wl/C6+tTdiWcp1QikNze2ov5zKvg8ZSkuI7FMewBzqA/+/ZQTcSAEfid4S/tGCA/U/ M9IDX9ina1g0y2dwaUr+41O+TtmXNb0X1ULFy9F3Lx365pzZ0Czz9MxJoOAt7xwvAVZslc u3pDF82MDDuBViysd9prOBLQHM6AMhTxa9BEg/k6QAiJpn2iGA7yD4rUrXWodfyHq7nE2p OZW1hwNzgpDWgvj3lG0n66DwtKZnB60/EUOnBJPBqGyNLgyq0d5piME2OhD87A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1671530489; 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=kz2OH9eca7oonNne0Q/Lp4o0OA52zUD7HfFlKff1s48=; b=NvO+pInrnZQk2W8ThcUZwQUeVCAZRP8ZI9v5R3xRvGdodUp9pNM8Erayh3iL2RKvel6XwR pBu6Ncvs4HgMGwFVSgGw9bhXFndqqvVd+iKJTEntb6wzdqWphsGdM4hfXoZomqRG9tB0V0 756cyafs1n4IoWmgY6hCW5HA0kQXLsRRinPfflkQzm2EA3WFjP1gFyWbgOdxaj/aaR43ty o9zGWil7mOGM3jypD1CT3PsHGjugukmctu1lp7xKx/YO9JmVLdxaxxut+rHZ858MubVHFV K4rshg8UiO6nSCtnOEshLwzFCw47Huyv7U8rfVGnEz0UDqrG7O+8veVmnGxypQ== X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.de header.s=2017 header.b=V+L5ioeK; 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=pass (policy=none) header.from=posteo.de X-Migadu-Spam-Score: -7.43 X-Spam-Score: -7.43 X-Migadu-Queue-Id: 7A6ED3BE39 X-TUID: yJ4QEU911mDD 2022-12-18 09:11 liliana.prikler@gmail.com: > I think we should be able to build an Emacs service in Guix Home that can > manage init.el. As a workaround, use-package should also have a :when > clause, so you can use :when (featurep 'some-package-autoloads) if you're > unsure whether 'some-package is actually installed. This makes your init > file a little more resilient and is particularly useful with pure shells. =guix home import= for init.el is a great idea! (See below for use-cases.) And yes, =:when (featurep 'some-package-autoloads)= is a workaround that makes init.el files loadable even if respective packages are not available. But the submitted code aims to enable you to install needed emacs-packages so that such a restricting workaround is not needed. > Given the caveats, I would rather like to see an Emacs Lisp based script > that mocks use-package and generates a manifest by evaluting init.el. This > should give you more correct results. It's not a bad idea per se, but as-is, > I think it would better be maintained in your own channel before > upstreaming. Problem is that in cases where needed packages are not installed and the user did not add =:when (featurep 'foo)= everywhere, it's possible that evaluating init.el will fail because of some package not being available. Thus, IMHO, we can't rely on Emacs to evaluate the init.el. But we could use Emacs to expand the (use-package) macros inside init.el. But I doubt that it's worth it. I rather think it's easier to use Guile to parse invocations of =require= and =use-package=. > For upstreaming, I see two potential paths. The first one would be > integration to `guix home import', which Andrew Tropin (CC'd) could probably > tell you more on. The second would be integration into `guix package' as a > callable function/command line argument, but IMHO that's less likely to > pass. All in all, I think there are three use-cases: - If you want Guix Home to handle the installation of emacs- packages, there should be =guix home import= to automatically install those packages, as resulting from early- and init.el files. - If you simply want to install all emacs- packages once per CLI, there should be =guix package --install-from-elisp-file=~/.emacs.d/init.el= and similar CLI-arguments or -commands, such as --install-from-elisp-expression, --install-from-elisp-init-files. There could also be --fit-to-elisp- variants which not only install packages, but also remove redundant, unused emacs-* packages. - 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 =guix package -e=. And in all three cases, your early- and init.el files might load packages via =require= or =use-package= at least.