From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.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 AEfRMl35TGMTlgAAbAwnHQ (envelope-from ) for ; Mon, 17 Oct 2022 08:42:37 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id qJXpMl35TGP1NgAA9RJhRA (envelope-from ) for ; Mon, 17 Oct 2022 08:42:37 +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 8C55E3BA2E for ; Mon, 17 Oct 2022 08:42:37 +0200 (CEST) Received: from localhost ([::1]:55374 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1okJpa-0004qe-Ly for larch@yhetil.org; Mon, 17 Oct 2022 02:42:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56246) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okFxI-0005Mv-QB for guix-devel@gnu.org; Sun, 16 Oct 2022 22:34:16 -0400 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]:34676) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1okFxG-00010I-LD for guix-devel@gnu.org; Sun, 16 Oct 2022 22:34:16 -0400 Received: by mail-ej1-x62e.google.com with SMTP id ot12so21950571ejb.1 for ; Sun, 16 Oct 2022 19:34:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=iWvQ9mNwyO4EJDA3qa+dXbaaZeBfJ/uNpTpLw88K6rU=; b=HF1u9CxYKb6NeTI9up31PHjUZz2vdaK7GM5aa2ZnxsV2g/MMZr70DHyIuUT2XbB46v McW1jrcl037P5QpH+YTe29O8hEcUOFg59xVdyKKmC+/aXzu8GZ/dnyUSBnYz01aVd5Gz XqJ+tyD/TEk7sb/5nZeKKqSQfjWSuFDSrCJ5d7idei04EOZg+DxpR9Ps+NgZkDJAeqlB ty4FLuVdV+hXXKEYPArnVScnaji3MLWwqFLtIEFof8zFwzAfmWYFeTrAYZ/jTJUJS5C+ sYxkIE1bpsJHJd46BXy+XivvTJFGJ5lsb5Wyka+ZcC7s8VhpoK7dAS1pxWV1z8GU32ba mn4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=iWvQ9mNwyO4EJDA3qa+dXbaaZeBfJ/uNpTpLw88K6rU=; b=JxZ3XHrJP4VKo48+NpSRxePdRB8N9yR4OAMkq5kY8UTGfffEo6LiRWF8ax/PbAMTL4 5cafaXgVbH4avA05SposYgzXmhfGBKt34DNzLXIwN60PYUT8oA3MMgezbL4IESUgThgh 4M8sGRar2teQDcGyrlQCbISN7v7hs4dRZE6sSibHQIvicftdfUOvzv1Qm8PZh1bibhG2 jbUb5QekKF0Vwxjc9ATTGbGYGyHceJVZe/toA9dvBIV36NS0OHemdKvWm3arLzr1KAOt bV4eoVf3KmCYCeCz6ZAioQkL1gIpI3nsWtsKbzQ5yAMVZ18j1fJzw99MjwG6aQF897zs 9zFA== X-Gm-Message-State: ACrzQf2HvidY4twLmrli/1Ae4MXyZrGlNKpodEtDrlRn+Y2Tbf3fxToV ukLW6nwKKzUakKcv6w+RVddoJyOvb0opQbfrJ2rgc6T9CoM= X-Google-Smtp-Source: AMsMyM4/venwsChcVyATxDVgVoSnkDEoOVGKXS9aj1GVMogrHIl68X3WJB9AfiC8tpUKRtQfy+E/g2VaOqW3t0yQVl0= X-Received: by 2002:a17:906:fd8a:b0:75d:c79a:47c8 with SMTP id xa10-20020a170906fd8a00b0075dc79a47c8mr6636869ejb.389.1665974051011; Sun, 16 Oct 2022 19:34:11 -0700 (PDT) MIME-Version: 1.0 From: Zain Jabbar Date: Sun, 16 Oct 2022 16:34:00 -1000 Message-ID: Subject: Creating an Emacs Home Configuration Service To: guix-devel@gnu.org Content-Type: multipart/alternative; boundary="00000000000084018405eb31cf98" Received-SPF: pass client-ip=2a00:1450:4864:20::62e; envelope-from=zaijab2000@gmail.com; helo=mail-ej1-x62e.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, HTML_MESSAGE=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-Mailman-Approved-At: Mon, 17 Oct 2022 02:38:01 -0400 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=1665988957; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=iWvQ9mNwyO4EJDA3qa+dXbaaZeBfJ/uNpTpLw88K6rU=; b=EGzGc+Wq4txC4oRJu5L4mvMbEHvgNy/d+XjfZk++gbb3fUuJTYZC7VEyHnKEWLf9PtqmHj maAI3tAD43bH1Pwb8N5K1U31TdXkiFjrY87rbS2O0knQry7AEV22WgHryoezLJoC+sZwjS dQOItqnPOcYyAGqWxd/a/bkGJHIaanKsa5xbfvG0/DzQqgwEseJT8EvwsQAGlr0VW8c4cW vlPMMDqvDcj/qb/BjLQ3gbhFEgXm4Nn0IHWp3bRfmMxXw0hLU0WEmPJUesAkmwoze+jkGV rbKqkYqjsYuapwpXF5qSrtH0aRf7I5c9KSpoUuygxgh0bT2Aoumr1GPfj/P+ZQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1665988957; a=rsa-sha256; cv=none; b=j5eFtNPrjAKI/hiGbQ+9DlthG7svj9bjS6mQwbQvuCX95Gm8E7BeDUDfq2W/zznEC5+JgW RRIQXMQOM+3uktY0+cKL+ZCmx8Pa8n+w86Zm6l+0J2DkgZ33N1i+8wqbkRh81EQrL37kAF 7NBSzg8Z+qz/+9rlyoJw9W4T48HnIfq/4VWJh1UtNGOlchHmx8YJfI6liJTlOeBNFNm32T TGHmg9PsFjVbQEi1knX8GIJX0rp5L7oavJ8dKu52wCeomMBYitlk44BLPX0CCCk8DAK2X5 TKQQCOWB7KazCx7UHw/AOoUn67DZrrujy8GF41PjtNnqXMUq8pS/+/JDntUSvQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=HF1u9CxY; 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: -5.22 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=HF1u9CxY; 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: 8C55E3BA2E X-Spam-Score: -5.22 X-Migadu-Scanner: scn0.migadu.com X-TUID: I9KPCq06cCWk --00000000000084018405eb31cf98 Content-Type: text/plain; charset="UTF-8" Aloha Guix Development Team, Running =guix home search emacs= returns nothing. I also could not find an email using =C-u M-x debbugs-gnu= about an Emacs configuration service. This is my first email to this mailing address. Please give me pointers on formatting and further improvements. I have attempted to make an =emacs-home-service-type= so that it is possible to configure Emacs using Guix home. This code is extremely preliminary hence I don't even think it is worth sending as a patch. Also I have never worked on a multi person Git project before and do not know how to solve the keyring error I get when using guix pull. I will outline what my code does and what features I would like to add. #+BEGIN_SRC scheme (define* (emacs-configuration-service name #:key (init '()) (early-init '()) (emacs-packages '())) (service-type (name (symbol-append 'emacs- name '-configuration)) (extensions (list (service-extension home-profile-service-type (lambda (config) emacs-packages)) (service-extension home-files-service-type (lambda (config) (list `(,(string-append ".config/emacs/services/" (symbol->string name) ".el") ,(scheme-file (string-append (symbol->string name) ".el") init #:splice? #t)) `(,(string-append ".config/emacs/early-services/" (symbol->string name) ".el") ,(scheme-file (string-append "early-" (symbol->string name) ".el") early-init #:splice? #t))))))) (default-value #f) (description "Configures Emacs init.el"))) (define-public emacs-init-service-type (service-type (name 'home-emacs) (extensions (list (service-extension home-profile-service-type (lambda (config) (list emacs-next))) (service-extension home-files-service-type (lambda (config) (list `(".config/emacs/early-init.el" ,(scheme-file "early-init.el" '((mapc 'load (file-expand-wildcards "~/.config/emacs/early-services/*.el"))) #:splice? #t)) `(".config/emacs/init.el" ,(scheme-file "init.el" '((mapc 'load (file-expand-wildcards "~/.config/emacs/services/*.el"))) #:splice? #t))))))) (default-value #f) (description "Configures Emacs init.el"))) #+END_SRC I define a general configuration service generator which takes in four things: 1. The =name= of the service 2. The configuration to be ran in =init.el= 3. The configuration to be ran in =early-init.el= 4. The packages in Guix to be added to the =home-profile=. After giving the =name=, =packages=, and =config.el= files we get a new service type that we can add to our home declaration. This service will then add a file in =~/.config/emacs/services/emacs-{NAME}-configuration.el=. I then have another service that places an =init.el= which loads everything in the service directory. If we want to install and configure =evil-mode= using this =home-service= we may define the following somewhere. #+BEGIN_SRC scheme (define-public emacs-evil-service-type (emacs-configuration-service 'evil #:emacs-packages (list emacs-evil) #:init '((evil-mode 1)))) #+END_SRC Within our =home-environment= we may add the service using: #+BEGIN_SRC scheme (home-environment ;; ...Things in the home-environment... (services (list ;; ...Other Services... (service emacs-evil-service-type)))) #+END_SRC There are some missing features I want to add. 1. Have the =home-emacs-*-service-type= service-types add to the =init.el= directly rather than within a folder to be loaded. I couldn't add two files with the same name to the store. So I have emacs-evil.el in the store to be placed separately later rather than appending to the existing init.el file. 2. Have Emacs update whenever the =home-environment= is updated. Meaning, if I did not add =(service emacs-evil-service-type)= in my =home-environment= then obviously =M-x evil-mode= should not work. But after adding the service then I want =M-x evil-mode= to work without having to restart Emacs. I do not understand the Emacs loading system on Guix well enough to know why it does not work. Skipping all of the =home-service= stuff, running =guix install emacs-evil-mode= then =(guix-emacs-autoload-packages)= does not let emacs know that =evil-mode= is installed. I would need to close Emacs and start Emacs again for Emacs to know about =evil-mode= being installed. 3. Use configurations somehow. I have completely neglected this feature in my system. I do not know what would be useful there. -- Thank you, Zain Jabbar --00000000000084018405eb31cf98 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Aloha Guix Development Team,

Running =3Dguix hom= e search emacs=3D returns nothing. I also could not find an email using =3D= C-u M-x debbugs-gnu=3D about an Emacs configuration service.

This is= my first email to this mailing address. Please give me pointers on formatt= ing and further improvements.

I have attempted to make an =3Demacs-h= ome-service-type=3D so that it is possible to configure Emacs using Guix ho= me. This code is extremely preliminary hence I don't even think it is w= orth sending as a patch. Also I have never worked on a multi person=C2=A0Gi= t project before and do not know how to solve the keyring error I get when = using guix pull. I will outline what my code does and what features I would= like to add.

#+BEGIN_SRC scheme
(define* (emacs-configuration-se= rvice name #:key (init '()) (early-init '()) (emacs-packages '(= )))
=C2=A0 (service-type (name (symbol-append 'emacs- name '-con= figuration))
(extensions
(list (service-extension
home-pro= file-service-type
(lambda (config) emacs-packages))
=C2=A0 =C2= =A0 =C2=A0 (service-extension
home-files-service-type
(lambda (= config)
=C2=A0(list
=C2=A0 `(,(string-append
=C2=A0 = =C2=A0 =C2=A0 ".config/emacs/services/" (symbol->string name) = ".el")
=C2=A0 =C2=A0 ,(scheme-file (string-append (symbol-= >string name) ".el")
=C2=A0 init #:splice? #t))
= =C2=A0 `(,(string-append
=C2=A0 =C2=A0 =C2=A0 ".config/emacs/= early-services/" (symbol->string name) ".el")
=C2= =A0 =C2=A0 ,(scheme-file (string-append "early-" (symbol->stri= ng name) ".el")
=C2=A0 early-init #:splice? #t))))))) (default-value #f)
(description "Configures Emacs init.el"= ;)))


(define-public emacs-init-service-type
=C2=A0 (service-t= ype (name 'home-emacs)
(extensions
(list (service-extension<= br> home-profile-service-type
(lambda (config) (list emacs-next)))<= br> =C2=A0 =C2=A0 =C2=A0 (service-extension
home-files-service-type=
(lambda (config)
=C2=A0(list
=C2=A0 `(".config/em= acs/early-init.el"
=C2=A0 =C2=A0 ,(scheme-file
=C2=A0 = =C2=A0 =C2=A0 "early-init.el"
=C2=A0 =C2=A0 =C2=A0 '((= mapc
=C2=A0'load (file-expand-wildcards
"~/.confi= g/emacs/early-services/*.el")))
=C2=A0 =C2=A0 =C2=A0 #:splice? = #t))
=C2=A0 `(".config/emacs/init.el"
=C2=A0 =C2=A0= ,(scheme-file
=C2=A0 =C2=A0 =C2=A0 "init.el"
=C2= =A0 =C2=A0 =C2=A0 '((mapc
=C2=A0'load (file-expand-wildcard= s
"~/.config/emacs/services/*.el")))
=C2=A0 =C2= =A0 =C2=A0 #:splice? #t)))))))
(default-value #f)
(description &q= uot;Configures Emacs init.el")))
#+END_SRC

I define a genera= l configuration service generator which takes in four things:
1. The =3D= name=3D of the service
2. The configuration to be ran in =3Dinit.el=3D3. The configuration to be ran in =3Dearly-init.el=3D
4. The packages = in Guix to be added to the =3Dhome-profile=3D.

After giving the =3Dn= ame=3D, =3Dpackages=3D, and =3Dconfig.el=3D files we get a new service type= that we can add to our home declaration. This service will then add a file= in =3D~/.config/emacs/services/emacs-{NAME}-configuration.el=3D. I then ha= ve another service that places an =3Dinit.el=3D which loads everything in t= he service directory.

If we want to install and configure =3Devil-mo= de=3D using this =3Dhome-service=3D we may define the following somewhere.<= br>
#+BEGIN_SRC scheme
(define-public emacs-evil-service-type
=C2= =A0 (emacs-configuration-service
=C2=A0 =C2=A0'evil #:emacs-packages= (list emacs-evil)
=C2=A0 =C2=A0#:init '((evil-mode 1))))
#+END_S= RC

Within our =3Dhome-environment=3D we may add the service using:
#+BEGIN_SRC scheme
(home-environment
=C2=A0;; ...Things in the = home-environment...
=C2=A0(services
=C2=A0 (list
=C2=A0 =C2=A0;; .= ..Other Services...
=C2=A0 =C2=A0(service emacs-evil-service-type))))#+END_SRC

There are some missing features I want to add.

1. = Have the =3Dhome-emacs-*-service-type=3D service-types add to the =3Dinit.e= l=3D directly rather than within a folder to be loaded. I couldn't add = two files with the same name to the store. So I have emacs-evil.el in the s= tore to be placed separately later rather than appending to the existing in= it.el file.

2. Have Emacs update whenever the =3Dhome-environment=3D= is updated. Meaning, if I did not add =3D(service emacs-evil-service-type)= =3D in my =3Dhome-environment=3D then obviously =3DM-x evil-mode=3D should = not work. But after adding the service then I want =3DM-x evil-mode=3D to w= ork without having to restart Emacs. I do not understand the Emacs loading = system on Guix well enough to know why it does not work. Skipping all of th= e =3Dhome-service=3D stuff, running =3Dguix install emacs-evil-mode=3D then= =3D(guix-emacs-autoload-packages)=3D does not let emacs know that =3Devil-= mode=3D is installed. I would need to close Emacs and start Emacs again for= Emacs to know about =3Devil-mode=3D being installed.

3. Use configu= rations somehow. I have completely neglected this feature in my system. I d= o not know what would be useful there.

--
Thank you,
Zain Jabbar<= /div>
--00000000000084018405eb31cf98--