Development Environments with GUIX shell

2025-01-04 @rrobin

Since I use guix I often want to setup an environment when I am developing some program using guix packages.

As an example lets say I am starting to work on some C code with some dependencies (pkg-config, efl), and create a manifest file with the development dependencies e.g.

I can then call guix shell using this file with:

This will start a shell with all the dependencies I need to build my project.

Later I might create an actual package for my software project, e.g. defined in guix.scm in my repository. Here is a silly (and incomplete) example

Notice my inputs are the same packages used in manifest.scm i.e. they are the dependencies needed to build this package. Now that I have this package recipe I can change the previous manifest.scm to rely on it instead:

However I sometimes need more tools in my development environment. For example I want gdb to debug some issues. So I can change manifest.scm to include this too:

and that is it.

References

https://guix.gnu.org/manual/en/html_node/Writing-Manifests.html#package_002ddevelopment_002dmanifest