From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.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 cGuEO4xkUGNKbQAAbAwnHQ (envelope-from ) for ; Wed, 19 Oct 2022 22:56:45 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id o78KAI1kUGMP7QAA9RJhRA (envelope-from ) for ; Wed, 19 Oct 2022 22:56:45 +0200 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 94CBC2F458 for ; Wed, 19 Oct 2022 22:56:44 +0200 (CEST) Received: from localhost ([::1]:60742 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1olG7H-0000O0-O3 for larch@yhetil.org; Wed, 19 Oct 2022 16:56:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60296) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1olG6j-0000Nm-NR for guix-devel@gnu.org; Wed, 19 Oct 2022 16:56:10 -0400 Received: from mx1.dismail.de ([78.46.223.134]:19800) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1olG6h-0007dk-7s for guix-devel@gnu.org; Wed, 19 Oct 2022 16:56:09 -0400 Received: from mx1.dismail.de (localhost [127.0.0.1]) by mx1.dismail.de (OpenSMTPD) with ESMTP id 313803a6; Wed, 19 Oct 2022 22:56:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=dismail.de; h= mime-version:date:content-type:content-transfer-encoding:from :message-id:subject:to:cc:in-reply-to:references; s=20190914; bh=FAQv0rUTVx6aigVCh6PI4Qm2Fpqfwn2c+edtGpKvvNU=; b=CQLwmkpewPJV 0Smv/5uyw6tYxFpUGfh26etNe1gA9+nTo4DnCOAElS5glMukDSVJcZYhGTvfH11m wB0F2hZHK9DEdQSYWZ5/9GiVLkHsIti1BJYLvS3reCCyDJ9BAQrTh2/hWUF89yeQ DE0iC7SMrOoIdzSdNN9v1jfabc3zfoaOjuwY21QblvtjwzDY3rMwaAL226BLTwET 9w6loIIsUi8Q+EhEFWxZQFalSWunPCdFOCDpxLmUfssIUPhL6DX5Wn3Mu9c/TdHJ RAxhLndntz0iqftAzsShqSTc7Nkk7MtZaH7ccGoEnMQLmsepwjo1H6r5U/QXJSKG eas+30B/LQ== Received: from smtp2.dismail.de ( [10.240.26.12]) by mx1.dismail.de (OpenSMTPD) with ESMTP id fab49b42; Wed, 19 Oct 2022 22:56:03 +0200 (CEST) Received: from smtp2.dismail.de (localhost [127.0.0.1]) by smtp2.dismail.de (OpenSMTPD) with ESMTP id 024223d8; Wed, 19 Oct 2022 22:56:03 +0200 (CEST) Received: by dismail.de (OpenSMTPD) with ESMTPSA id 027093d6 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 19 Oct 2022 22:56:03 +0200 (CEST) MIME-Version: 1.0 Date: Wed, 19 Oct 2022 20:56:02 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Mailer: RainLoop/1.16.0a From: jbranso@dismail.de Message-ID: <852cb48a4171fdc057c874cc5fb164cc@dismail.de> Subject: Re: Creating an Emacs Home Configuration Service To: "Zain Jabbar" Cc: guix-devel@gnu.org In-Reply-To: References: <331c0017d7a4842fd2919b330a3d3894@dismail.de> <8b00165ff49030fdd11708cb1fd4a5b9@dismail.de> <3cf810d64c1ca5697bee6eaf39d8dd7b@dismail.de> Received-SPF: pass client-ip=78.46.223.134; envelope-from=jbranso@dismail.de; helo=mx1.dismail.de 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" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1666213004; 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=PPNK9FKDrpfvWKszFIrrY+acZzDd1uejHK/aFeDtA38=; b=Y2NweiwIQMyl84iq2J4E4hVrbhOBdMS/+31DKjATGaMYB/20rUxmTC2IxXucDu8TPU+Lui lkNxMNf0X3+PvwDeKAZMECwslxDAxhRKKqqUU9ySF7BN9ohpr5lgTZ8mz3RlwAoI8fqA5R uLALOQk2dZjzoAu6W3taEg8CrqyEQiWv4DHWPFhG7Q6kgzbpGnonnvsmHCmPwmyUpABp/W Klyjutl7inNbBHOcyWRPiR4EoHzbd6d9EROP+3CaAqtE3PPfkzigCqfxzcxLkO+gPzp7mt /sI0C/kp/rL+M9wg3K9IBeQF0l9FV64vViJzCZ7mdS7tE9aYvI3XWbTe+Wyf7g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1666213004; a=rsa-sha256; cv=none; b=WZOoBenhhWotGvbFZqbM8qON2BFww8C1Fpl6E/WA2TiTSAWwxwUizniV5d11v874aClEc4 0UYczcTIjh43UueAfmLOuVOeXUTXx3V+1JvRSdiLjheZbN0kCIhGi02/BOt9whaef77GJK Ysl+fQqvI3I1u9CqFobMjgdAI8ivqoN5P9hkcli/9CHW8ogt4+UPA4abtrd4i41xsL7wiV 4WQRMU+gC98GfGVnOn+QFd4EQnMowFPwYyhDk94p9QMDf3cf8qnuA9TEoH2ddkG9QOIrcH sOOgSglydYukIA/Ok/cziX4Gp+H0th23aW8Telf6h7lL2Vk9Yek/e/1AZ1y7ag== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=dismail.de header.s=20190914 header.b=CQLwmkpe; dmarc=pass (policy=reject) header.from=dismail.de; 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" X-Migadu-Spam-Score: -3.52 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=dismail.de header.s=20190914 header.b=CQLwmkpe; dmarc=pass (policy=reject) header.from=dismail.de; 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" X-Migadu-Queue-Id: 94CBC2F458 X-Spam-Score: -3.52 X-Migadu-Scanner: scn1.migadu.com X-TUID: rmVVvCdX8/T8 October 19, 2022 4:25 PM, "Zain Jabbar" wrote: > Aloha All, >=20 >=20Thank you for your insightful messages. Sorry my code did not work as > smoothly as I would have liked. I have a =3Dhome-environment=3D definit= ion > that hopefully works for you. You can put everything into one > configuration as you described. I do that in the following source > block. For some reason I liked the idea of separate definitions of > each package, so that Guile and Guix Home kind of acts like a > =3Duse-package=3D declaration. Though that was needless abstraction on = my > end. I do not know if it is a needless abstraction. I am just bouncing ideas around with you. :) >=20 >=20#+BEGIN_SRC scheme > (use-modules (srfi srfi-1) > (ice-9 pretty-print) > (gnu home) > (gnu packages) > (gnu services) > (gnu home services) > (gnu services configuration) > (guix gexp) > (guix transformations)) >=20 >=20(define file-likes? (list-of file-like?)) >=20 >=20(define-configuration/no-serialization emacs-configuration > (emacs-packages > (file-likes (list (specification->package "emacs-next"))) "Files") > (early-init > (list '()) "Early-Init") > (init > (list '()) "Init")) >=20 >=20(define-public emacs-configuration-service > (service-type (name (symbol-append 'emacs-configuration)) > (extensions > (list (service-extension > home-profile-service-type > (lambda (config) (emacs-configuration-emacs-packages config))) > (service-extension > home-xdg-configuration-files-service-type > (lambda (config) > (list > `("emacs/init.el" ,(scheme-file "init.el" > (emacs-configuration-init config) > #:splice? #:t)) > `("emacs/early-init.el" ,(scheme-file "early-init.el" > (emacs-configuration-early-init config) > #:splice? #:t))))))) > (default-value (emacs-configuration)) > (description "Configures Emacs init.el"))) >=20 >=20(define-public minimal-home-environment > (home-environment > (services > (list > (service emacs-configuration-service > (emacs-configuration > (emacs-packages > (list > (specification->package "bash") > (specification->package "emacs-next") > (specification->package "emacs-debbugs") > (specification->package "emacs-evil") > (specification->package "emacs-paredit") > (specification->package "emacs-anzu"))) > (init '((evil-mode 1) > ;; Please add more config here > ;; Begining of emacs init configuration after evil-mode 1 >=20 >=20;; End emacs init configuration > )) > (early-init '((setq warning-suppress-log-types '((comp) (comp))) > (setq warning-suppress-types '((comp) (comp))))))))))) ; A > serious stack of pringles here >=20 >=20minimal-home-environment > #+END_SRC >=20 >=20I saved this file to =3Dminimal-working-example.scm=3D and ran a cont= ainer using > =3Dguix home -N --share=3D/tmp container ./minimal-working-example.scm= =3D. > This should spawn a shell in which you can run =3Demacs=3D (as terminal= ). > Furthermore we can also run the info help command and get to the > debbugs page. >=20 >=20The =3Dinit=3D and =3Dearly-init=3D configuration options take in > S-Expressions not files. Under the hood the service uses =3Dscheme-file= =3D > which takes in an expression. I am open to suggestions for other file > mechanisms, like if, for example, G-Expressions are more natural here. > I found that I did not know how to naturally append G-Expressions > together and that the S-Expressions can "bleed" into the config using > backquotes. So I chose just sticking in a list of expressions for > Emacs. Something Andrew Tropin taught me, if you are working in a > =3D*.scm=3D file and you want to evaluate elisp, use =3DM-x eval-region= =3D or > =3DM-x edit-indirect-region=3D (with the usual stipulation that if you = do > this very often we can bind it to a key). I would say when you submit your service to guix-devel others will give you some options too. I like the idea of S-expressions though. =20 >=20If my interpretation of 13.1 Declaring the Home Environment is > correct, we should expect an error associated with XDG_RUNTIME_DIR as > the necessary variables will be set via the Operating-System > declaration. The next error I believe is emacs wanting to make a file > where the home container does not have read or write permissions. My > =3Dguix home=3D declaration with the =3Dshare=3D parameter should hopef= ully > help with this error. Oddly enough if we do not specify the > installation of =3Dbash=3D, Emacs says it cannot uncompress the info > manuals because there is no =3Dsh=3D. That is why I included =3Dbash=3D= into > the emacs packages list. I do think a lot of these "solutions" will be > unncessecary if users were to use =3Dguix home reconfigure=3D rather th= an > user the container. Though it's nice to debug them there. Thanks for the explanation!