From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id aLESLuhnUGNRLwAAbAwnHQ (envelope-from ) for ; Wed, 19 Oct 2022 23:11:04 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id sN3fLehnUGMgBQAAauVa8A (envelope-from ) for ; Wed, 19 Oct 2022 23:11:04 +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 49737A2AB for ; Wed, 19 Oct 2022 23:11:04 +0200 (CEST) Received: from localhost ([::1]:47884 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1olGL9-0000ZE-7q for larch@yhetil.org; Wed, 19 Oct 2022 17:11:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44310) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1olGK8-0000Yu-Bi for guix-devel@gnu.org; Wed, 19 Oct 2022 17:10:00 -0400 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]:35359) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1olGK5-0001Nf-3m for guix-devel@gnu.org; Wed, 19 Oct 2022 17:10:00 -0400 Received: by mail-ej1-x634.google.com with SMTP id k2so42922277ejr.2 for ; Wed, 19 Oct 2022 14:09:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=vNbmbSvFMgJqe/BVA6FSLULFrwLTRBIwvH0Soutb13Y=; b=DVUiQO4OpvY+rK1+/FKL+Iqqoedp84nnM4tuqdFU+aHJhxH1dGAV9GkS51zKnf6diS rn5LYf0X3xZYtZ/hdMi1KLLgNUYyM5YOgZfh2EFGsgr+SvwVi8XUGISuSu6hnofbnpCe yh/XM8B6QSl2CxTCx28HbDH0Hs3Uj4AUg3vOs8uEon5+5pWvP6/oNjeM3y8Sk5J+zxga BVgf7akJqANwt2GjcL3ctyS9ADASNyZ5LyeDcAEkntXp+ncTbSUVt1Hl/ft1PFlLUSZT w29yiBbRT9LKgoyaqwssxWgg6OAs/f/MlMY1gZ+fDdbZHwxiCAjv7XNxemeUHPCxkzV8 vX9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=vNbmbSvFMgJqe/BVA6FSLULFrwLTRBIwvH0Soutb13Y=; b=oiDLbLLE1JKSQxZAKn9DFiQpAIrSt5dDYbkKApq9Omwskw9dNiN8WADHJoN7zGHwqB hP0yju/oPb1qFLeLhVrlhhdOh16zbCkpyD8ibNVSokINtwaoREjTn9Ekj8vcUCfXKSnB jwLosG5R+orKxeNVDlNKKpVXrFcfrNq78t/Oq2FGM5NlfI3VXglMDC987E/S/hEWVva7 MSsrHi9+oep8XIBjqu7j3okxjra28BEYSY1Vk2x5s6YXmf6yyzjoxWHfhKaH68hmtR2R thGyJzs3YxVe14ws8bp44CVOiaBXZaOrPtKy0U8FClXK7SBpoCNfDWBog8P9X9WxMJaG bx0w== X-Gm-Message-State: ACrzQf2BAgLHpR8TILHJuNkLH53aAcEoJ1FCfFk7wG+3ase9hYaDcjof 17D0OOozVvtaIPzxnPhez82RzGfSEFwHxFQgLlw= X-Google-Smtp-Source: AMsMyM6WjD49tSUWlJa7JZSLModxdPHcjg5LVoYMaX3GyMDwaGYTLkQdMoWmn5gRlXzWgpqYqR+Y0KUsxNCy1gpugMw= X-Received: by 2002:a17:906:9b93:b0:78d:eb36:1ce7 with SMTP id dd19-20020a1709069b9300b0078deb361ce7mr8415668ejc.621.1666213792365; Wed, 19 Oct 2022 14:09:52 -0700 (PDT) MIME-Version: 1.0 References: <331c0017d7a4842fd2919b330a3d3894@dismail.de> <8b00165ff49030fdd11708cb1fd4a5b9@dismail.de> <3cf810d64c1ca5697bee6eaf39d8dd7b@dismail.de> <852cb48a4171fdc057c874cc5fb164cc@dismail.de> In-Reply-To: <852cb48a4171fdc057c874cc5fb164cc@dismail.de> From: Zain Jabbar Date: Wed, 19 Oct 2022 11:09:41 -1000 Message-ID: Subject: Re: Creating an Emacs Home Configuration Service To: jbranso@dismail.de Cc: guix-devel@gnu.org Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2a00:1450:4864:20::634; envelope-from=zaijab2000@gmail.com; helo=mail-ej1-x634.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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=1666213864; 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=vNbmbSvFMgJqe/BVA6FSLULFrwLTRBIwvH0Soutb13Y=; b=K1YK735yqTeVK8WFlHr7xkf+c1usbNSjQ2yvPJW4qRxZUsYNGSGt6npnZ9mK9Nmwag16C9 nVyroh6XtF/+v/dLadw1N0ava56IiHIaDK2geNB0vXm7bVAB5wGZJGTmWGeTmHUWhr3pse CI3FsMyxuRUjdCVng1fe8oLSMDGHblLjNWNfvYU2TIGOCoGkYVjGCEIxhaNvSUH1qM/yYX z6Vb0u3ebo0xppe/kBXXr/jcKYgztiMeOgrpcmIJnPvYY9s4+uT2ZbPfLnhS29UKGq3ayK GhGdfUX1wO0S0ePXMZ8FwiIYD1+a+U49v1LTH4JfsSTEkFhLQpjacIGvgB3zxA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1666213864; a=rsa-sha256; cv=none; b=PxhI/FVY7DcY4GbL8rZARHSiQE4+BzdLNvIOHRGZB6PmB//9e0gIAEQehTzrVmUZSYFdl0 9LdalblTgHRZZ+iY+g9wB7YPEvkbl8th/4nSLGlDvfADhAJbFNV7iEUY3hCXiMJ+aBe9Y2 4RcRkHe1iYFYOc567QemjMHcDGzI5M5IXwg0MTn9kqmD7SkeWUTe0PRDiSZCCZMkQHBnYd CssflWVHKzbOUtj64Oig6mexfBLQOVGjEc5fr9dykp0fVQ7lCBtw3Lk5BEoibh6vJSqhgq 1XeQnFMOgeU0h3eHQ0M08rpkqsHVk+MFa2qErm764WgWeuYebmrY4XpRQ3NJ6Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=DVUiQO4O; dmarc=pass (policy=none) header.from=gmail.com; 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: -2.42 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=DVUiQO4O; dmarc=pass (policy=none) header.from=gmail.com; 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: 49737A2AB X-Spam-Score: -2.42 X-Migadu-Scanner: scn0.migadu.com X-TUID: ejkTqMhYMzYr Aloha All, Thank you for your input! It's all been very constructive. I will do my best on that patch. On Wed, Oct 19, 2022 at 10:56 AM wrote: > > October 19, 2022 4:25 PM, "Zain Jabbar" wrote: > > > Aloha All, > > > > Thank you for your insightful messages. Sorry my code did not work as > > smoothly as I would have liked. I have a =home-environment= definition > > 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 > > =use-package= 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. :) > > > > > #+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)) > > > > (define file-likes? (list-of file-like?)) > > > > (define-configuration/no-serialization emacs-configuration > > (emacs-packages > > (file-likes (list (specification->package "emacs-next"))) "Files") > > (early-init > > (list '()) "Early-Init") > > (init > > (list '()) "Init")) > > > > (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"))) > > > > (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 > > > > ;; 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 > > > > minimal-home-environment > > #+END_SRC > > > > I saved this file to =minimal-working-example.scm= and ran a container using > > =guix home -N --share=/tmp container ./minimal-working-example.scm=. > > This should spawn a shell in which you can run =emacs= (as terminal). > > Furthermore we can also run the info help command and get to the > > debbugs page. > > > > The =init= and =early-init= configuration options take in > > S-Expressions not files. Under the hood the service uses =scheme-file= > > 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 > > =*.scm= file and you want to evaluate elisp, use =M-x eval-region= or > > =M-x edit-indirect-region= (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. > > > > If 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 > > =guix home= declaration with the =share= parameter should hopefully > > help with this error. Oddly enough if we do not specify the > > installation of =bash=, Emacs says it cannot uncompress the info > > manuals because there is no =sh=. That is why I included =bash= into > > the emacs packages list. I do think a lot of these "solutions" will be > > unncessecary if users were to use =guix home reconfigure= rather than > > user the container. Though it's nice to debug them there. > > Thanks for the explanation! -- Thank you, Zain Jabbar