Subject: Re: [bug#64620] [PATCH] gnu: home: Add home-emacs-service-type.

From: Kierin Bell <[email-masked]>
Date: Sat, 26 Aug 2023 10:06:03 -0400

Hi (,

"(" <[email-masked]> writes:

> *Very* nice!  I think it would be nice to support a PACKAGES field with
> a list of Guix packages to make available to Emacs, though that would
> complicate the code a bit.
>
> You'd probably have to do something like what I did[1], which is a
> little hacky, and you'd want to somehow redirect the output from
> building the Emacs profile to a log file in '$XDG_STATE_HOME/log/emacs',
> but it'd let people use native-comp without the hassle of transforming
> the packages themselves (with appropriate EMACS and NATIVE-COMP? fields,
> of course :)) Also lets you isolate your emacs environment from your
> regular environment, if you wanted to do that for... reasons.
>
> If you'd rather not implement that for now, it's okay; I'm very much
> willing to submit a followup if/when this is merged.
>
> [1] https://git.sr.ht/~whereiseveryone/guixrus/tree/master/item/guixrus/home/services/emacs.scm#L113
>
>   -- (
>
>

Although there is an EXTRA-PACKAGES field for Guix packages (I use it,
e.g., for font packages) and a CONFIGURED-PACKAGES field specifically
for installing Emacs packages, I do like the idea of having a separate
Emacs profile, or even a separate profile for each Emacs server.

Part of me wanted to find a way to do that more "properly", with some
sort of lower-level `home-emacs-environment-service-type' that sets up
the profiles (hopefully in a more orthodox way), etc.  But that turned
out to be even more hacky in the end.

Looking at the Emacs build system modules, I'm not sure exactly how
building separate profiles would allow native-comp without transforming
the package inputs.  Isn't the build system basically hard-coded to use
`emacs-minimal' for building Emacs packages (i.e., unless we manually
transform the package inputs)?

At the very least, I'd like to set things up the best I can for this,
even if I end up leaving it to people with more expertise to implement.

Thanks (!

-- 
Kierin Bell
GPG Key: FCF2 5F08 EA4F 2E3D C7C3  0D41 D14A 8CD3 2D97 0B36