Pareto Optimal Dev

Package management and configuration in emacs

What’s the best way to manage packages in emacs? I’ve tried quite a few and prefer

package.el (builtin)

I used this until I ran into two problems:

Maybe now there are better solutions, but I moved on to straight.el.

Sometimes I think about returning because I’ve found sticking to base packages that closely follow emacs conventions seems to make debugging and maintaining my configuration easier for some reason.

This also reminds me of

straight.el

Straight worked well for me for some time, and I could really relate to parts of it’s readme given I was already into Haskell and NixOS:

Next-generation, purely functional package manager

Init-file and version lockfiles as the sole source of truth. No persistent state kept elsewhere.

100% reproducible package management, accounting for changes in packages, recipe repositories, configuration, and the package manager itself.

In practice though, I kept running into some issue where I had to keep re-running the straight-check-packages command or likely some other command.

You can see other reproducability issues in the straight.el issue tracker. I still turn to straight anywhere I can’t just use NixOS though.

NixOS

Nix builds packages in isolation from each other. This ensures that they are reproducible and don’t have undeclared dependencies, so if a package works on one machine, it will also work on another.

Given my struggles with package.el and straight.el, this sounded great!

From experience I knew NixOS has a steep learning curve, but I’d already paid parts of it while trying to develop Haskell projects using NixOS.

Essentially you add emacs packages to your NixOS configuratin and make emacs assume the packages will be in load-path somehow just as if you’d cloned them and then configure them normally.

To my surprise I’ve had 0 issues with this method of Package management and configuration in emacs.

For more details on this, see Replacing straight.el with Nix to manage my emacs packages.