Guix shell now inside Emacs!

~649 words. ~3 minutes.

tags: guix emacs programming

This is my submission for Emacs Carnival July 2026.

If you don't know what GNU Guix is: It's an advanced package manager and a distribution of the GNU Operating system. With kernel support for both GNU Linux-libre and, experimentally, for the GNU Hurd.

Guix's package manager is inspired by Nix, except that it uses GNU Guile instead of Nixlang for package definitions, system definitions. Also replacing Systemd with GNU Shepherd (GNU's Init System and Service manager).

One of the features I use the most with Guix is guix shell. Which allows you to create software environments with the specified packages.

I use this whenever I have to quickly try out software like some programming language implementations, developer tool or build some random project.

I also use this to specify the development dependencies of the projects I work on, the dependencies are listed in a manifest.scm file.

(specifications->manifest
 '("gcc-toolchain"
   "gdb"
   "mupdf"
   "make"))

If you run a guix shell in a directory containing the file, it gets the appropriate dependencies for you.

Check the info manual for more information: (info "(guix) Invoking guix shell").

Anyway, how does this tie back to GNU Emacs? If you are like most Emacs users, you don't like starting a new instance of emacs for every project…

$ you@yourcomputer ~/Projects/awesome-program$ guix shell 
guix shell: loading environment from '/home/you/Projects/awesome-program/manifest.scm'...
$ you@yourcomputer ~/Projects/awesome-program$ emacs

Too annoying. What you instead want is to have a M-x guix-shell inside Emacs itself. This was contributed to the emacs-guix package by yours truly.

Check the info manual for more information: (info "(emacs-guix) Guix Shell").

Here's how I usually use it.

Firstly, let's you feel like using Python. In the CLI, you would do.

$ you@yourcomputer ~/Projects/awesome-program$ guix shell python

The same in Emacs is like so,

But what if you want to use multiple packages? Like

$ you@yourcomputer ~/Projects/awesome-program$ guix shell python python-numpy

Well, we got you covered there as well,

(Yeah, I forgot about the commas).

How about generating a manifest.scm file that you can use in the future? In the CLI, you would do,

$ you@yourcomputer ~/Projects/awesome-program$ guix shell python python-numpy --export-manifest > manifest.scm

In Emacs, you would do,

I think there is still much to be desired in this interface. It doesn't even attempt to provide of guix shell's power, for which it would probably need a transient menu (library powering magit and the other menus in emacs-guix).

You might also be interested in packages like ben.el.

Author: tusharhero

emailreplace [at] with @, and put the domain for username, and vice versa: sdf.org [at] tusharhero

© tusharhero 2024-2026, check licenses page for details.

Date: 2026-07-31 Fri 00:00

Emacs 30.2 (Org mode 9.7.11)