help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Emacs use-package: Guix backend?


From: Fredrik Salomonsson
Subject: Re: Emacs use-package: Guix backend?
Date: Sat, 19 Dec 2020 16:10:42 -0800

Hi Ricardo,

Ricardo Wurmus <rekado@elephly.net> writes:

> I recently moved all my Emacs packages to a separate profile, which is
> controlled by a manifest that’s generated from my init.org configuration
> file.  I like this, because I can separately upgrade packages from my
> main profile and keep my Emacs configuration self-contained.
>
> What still annoys me, though, is that package installation is separate
> from configuration.  I don’t really want to be forced to update the
> manifest at the top of my init.org before I can configure the package
> somewhere at the bottom of the init.org.
>
> The “use-package” macro was designed to allow for both installation and
> configuration in the same place.  By default it uses package.el to
> install packages when they aren’t available yet.  I’d like to use
> “use-package”, but I’d like it to install packages with Guix and also
> install to a separate Guix profile, preferably via a manifest.
>
> Package managers are supposed to override “use-package-ensure-function”
> and/or “use-package-pre-ensure-function” to use something other than
> package.el.
>
> Before I embark on this journey, do any of you have travel reports to
> share?

My 2 cents.

I got multiple profiles; one for emacs, nyxt, git and guile for example.
I wrote a small bash script to make it easy for me to upgrade all of
them or just a subset. What I like about this is that upgrading emacs
and all of its packages are the same as upgrading any of the other
profiles. I.e. I don't have to remember to run
`list-packages` -> `U` -> `x` to update my emacs packages anymore. Plus
I get the bonus of anything goes wrong I can just rollback the emacs
profile.

My emacs manifest is completely decoupled from my configuration. There
are potential of them becoming out of sync. But in practice I haven't
notice anything of that. I haven't found it annoying (yet) to update my
emacs manifest before adding the configuration. Mostly because my
package configuration has been quite stable. It's just recently I've
been starting testing some new packages (after seeing all the cool stuff
from the emacsconf).

> Do you think this is worth doing?

Yes, would be great to have use-package directly feed the manifest and
have some tighter coupling between the configuration and guix.

There are some speed bumps that I can see, one being for example
emacs-flymake-shellcheck does not give you shellcheck so in my manifest
I list both emacs-flymake-shellcheck and shellcheck for that to work.
Maybe keyword-extension[0] can handle cases like these? I.e. you have a
keyword where you can specify external dependencies. Something like:

(use-package flymake-shellcheck
  :guix-install '("shellcheck"))

[0] https://github.com/jwiegley/use-package/tree/master#keyword-extensions

Also, at least for me, I would still like to be able to upgrade/rollback
the emacs profile together with the rest of guix. Instead of that being
yet another step to update your whole system.

> If so, where could we add this feature so that all Guix users benefit
> from it? Emacs-Guix?

That is a good question :). Emacs-Guix seems like a good fit to me as it
already has the logic to talk to guix from emacs.

-- 
s/Fred[re]+i[ck]+/Fredrik/g



reply via email to

[Prev in Thread] Current Thread [Next in Thread]