<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>tusharhero's pages about Guix</title>
<description>Guix related articles</description>
<generator>Emacs webfeeder.el</generator>
<link>https://tusharhero.codeberg.page/</link>
<atom:link href="https://tusharhero.codeberg.page/guix.xml" rel="self" type="application/rss+xml"/>
<lastBuildDate>Mon, 07 Sep 2026 09:07:37 +0530</lastBuildDate>
<item>
  <title>Guix shell now inside Emacs!</title>
  <description><![CDATA[<div id="content" class="content">

 <img src="https://tusharhero.goatcounter.com/count?p=/guix-shell-in-emacs.html"></img> <p>
 <i>~657 words. ~3 minutes.</i>
</p>

 <div class="tagbar"> <span> <a href="tags.html">tags:</a></span>  <span> <a href="tags.html#guix">guix</a></span>  <span> <a href="tags.html#emacs">emacs</a></span>  <span> <a href="tags.html#programming">programming</a></span></div>

 <div class="org-center">
 <p>
This is my submission for  <a href="https://plaindrops.de/blog/2026/emacscarnival2607/">Emacs Carnival July 2026</a>.
</p>
</div>

 <p>
If you don't know what  <a href="https://guix.gnu.org/">GNU Guix</a> is: It's an advanced package manager
and a distribution of the  <a href="https://gnu.org">GNU Operating system</a>. With kernel support
for both  <a href="https://www.fsfla.org/ikiwiki/selibre/linux-libre/">GNU Linux-libre</a> and, experimentally, for the  <a href="https://www.gnu.org/software/hurd/">GNU Hurd</a>.
</p>

 <p>
Guix's package manager is inspired by  <a href="https://nixos.org/">Nix</a>, except that it uses  <a href="https://gnu.org/software/guile">GNU
Guile</a> instead of Nixlang for package definitions, and system
definitions. Also replacing Systemd with  <a href="https://gnu.org/software/shepherd">GNU Shepherd (GNU's Init
System and Service manager)</a>.
</p>

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

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

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

 <div class="org-src-container">
 <pre class="src src-scheme"> <code>(specifications-&gt;manifest
 '( <span class="org-string">&quot;gcc-toolchain&quot;</span>
    <span class="org-string">&quot;gdb&quot;</span>
    <span class="org-string">&quot;mupdf&quot;</span>
    <span class="org-string">&quot;make&quot;</span>))
</code></pre>
</div>

 <p>
If you run a  <code>guix shell</code> in a directory containing the file, it gets
the appropriate dependencies for you.
</p>

 <div class="org-center">
 <p>
Check the info manual for more information:  <a href="https://guix.gnu.org/manual/devel/en/html_node/Invoking-guix-shell.html">(info &quot;(guix) Invoking
guix shell&quot;)</a>.
</p>
</div>

 <p>
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…
</p>

 <div class="org-src-container">
 <pre class="src src-bash"> <code>$ you@yourcomputer ~/Projects/awesome-program$ guix shell 
guix shell: loading environment from  <span class="org-string">'/home/you/Projects/awesome-program/manifest.scm'</span>...
$ you@yourcomputer ~/Projects/awesome-program$ emacs
</code></pre>
</div>

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

 <div class="org-center">
 <p>
Check the info manual for more information:  <a href="https://doc.guix.gnu.org/emacs-guix/latest/en/html_node/Guix-Shell.html">(info &quot;(emacs-guix) Guix Shell&quot;)</a>.
</p>
</div>

 <p>
Here's how I usually use it.
</p>

 <p>
Firstly, let's say you feel like using Python. In the CLI, you would
do.
</p>

 <div class="org-src-container">
 <pre class="src src-bash"> <code>$ you@yourcomputer ~/Projects/awesome-program$ guix shell python
</code></pre>
</div>

 <p>
The same in Emacs is like so,
</p>


 <div class="video-title"></div>
 <video title=""> <source src="media/guix-shell-single-package.webm"> <a href="media/guix-shell-single-package.webm"></a>
</source></video> <p>
But what if you want to use multiple packages? Like
</p>

 <div class="org-src-container">
 <pre class="src src-bash"> <code>$ you@yourcomputer ~/Projects/awesome-program$ guix shell python python-numpy
</code></pre>
</div>

 <p>
Well, we got you covered there as well,
</p>


 <div class="video-title"></div>
 <video title=""> <source src="media/guix-shell-multi-package.webm"> <a href="media/guix-shell-multi-package.webm"></a>
</source></video> <p>
 <i>(Yeah, I forgot about the commas).</i>
</p>

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

 <div class="org-src-container">
 <pre class="src src-bash"> <code>$ you@yourcomputer ~/Projects/awesome-program$ guix shell python python-numpy --export-manifest &gt; manifest.scm
</code></pre>
</div>

 <p>
In Emacs, you would do,
</p>


 <div class="video-title"></div>
 <video title=""> <source src="media/guix-shell-export.webm"> <a href="media/guix-shell-export.webm"></a>
</source></video> <p>
I think there is still much to be desired in this interface. It
doesn't even attempt to provide of  <code>guix shell</code>'s power, for which it
would probably need a transient menu (library powering  <a href="https://magit.vc/">magit</a> and the
other menus in  <code>emacs-guix</code>).
</p>

 <p>
You might also be interested in packages like  <a href="https://codeberg.org/pastor/ben.el">ben.el</a> which are more
general in scope.
</p>
</div>]]></description>
  <link>https://tusharhero.codeberg.page/guix-shell-in-emacs.html</link>
  <guid isPermaLink="false">https://tusharhero.codeberg.page/guix-shell-in-emacs.html</guid>
  <pubDate>Fri, 31 Jul 2026 00:00:00 +0530</pubDate>
</item>
</channel>
</rss>
