Guix
Guix
Guix is a package manager and derived Operating System based on the ideas of reproducible builds ands free software and the Guile Scheme language.
Using Guix an Operating System and user profiles can be defined declaratively in Scheme. This includes system services, using the GNU Shepherd init system and config file environment through the GNU Home module.
Thanks to the use of reproducible builds Guix is useful for setting up clean development environments with or without full container isolation.
Setting up a minimal Sway environment
Guix allows the development of a minimal computing environment by allowing easy rollbacks to previous generations, allowing experimentation and through tooling like guix graph which can show where dependencies are coming from.
Sway is a reasonably minimal tiling window manager based on Wayland, with good support in Guix.
While a Sway session can be launched through the login shell, it can be nicer to use a login system. greetd is often used for this purpose, with a Sway based 'greeter'. To set this up it is neccessary to set up greetd as a system service in the operating system definition.
Guix Shell
Guix Shell is a tool used to manage, amongst other things, development environments. You can invoke it with:
guix shell
to launch the environment.
Typically you will want some packages in the environment, for example for a gcc toolchain you can add:
guix shell gcc-toolchain
You can manage the packages in the environment with a manifest file. To create an initial one do:
guix shell --export-manifest
You can then append packages to the manifest list as needed.
Further Reading
- https://guix.gnu.org/en/blog/2023/dissecting-guix-part-1-derivations/
- Raspberry pi example: https://codeberg.org/guix/guix/src/commit/757aefeaa4df338e0564044ba344f1daa81c5f10/gnu/system/examples/raspberry-pi-64.tmpl
- Sway and Guix: gofranz.com/blog/all-in-on-sway/
- Sample user setup: https://github.com/MorganJamesSmith/dotfilehttps://bugzilla.kernel.org/show_bug.cgi?id=215496s/blob/master/.config/guix/config.scm
- akirakyle.com/config/guix
- Sway example: https://gitlab.com/endocrin/guix-sway/-/blob/master/guix-sway-config.scm?ref_type=heads
- Sway example: https://gitlab.com/mbakke/guix-sway-example