1 --- 2 title: "Gentoo to Guix System" 3 date: 2022-02-24 4 draft: false 5 --- 6 7 Last December, I volunteered to help run the Free Software Foundation's table at [Ohio LinuxFest](https://olfconference.org), and it was a great experience. 8 I met a lot of professionals and excellent people who shared some of my passions. 9 One thing I needed to do to be able to represent the FSF was to make sure any computer I was taking to the event was for the most part running Free Software- that is, that the laptop I brought with me was running a Free operating system. 10 11 When I was asked whether I could do this, I remembered I was still using a nonfree kernel on my laptop (the internal wifi card depended on iwlwifi), and it was running Gentoo GNU/Linux, which isn't [FSF-endorsed](https://www.gnu.org/distros/free-system-distribution-guidelines.html) because part of the project is maintaining nonfree software (packaging nonfree kernel bits, nonfree software packages etc). 12 I knew my laptop really only depended on a nonfree wifi-card driver from a nonfree blob, but the FSF was happy to mail me an adapter that was usable with linux-libre. 13 At this point, I installed [Guix System](https://guix.gnu.org) on the free space on my drive, since I've heard good things about Guix's packaging philosophy. 14 I was already a fan of Portage, because of the responsible way build options can be automated and streamlined, so I was interested in how Guix differed. 15 16 The first sign I was out of familiar water was the way Guix System handles what we would consider 'global configurations' like the contents of `fstab` or whatever system daemons we tell the init system to manage. 17 The best way I can describe the philosophy of Guix is "functional" - the goal state is that you can provide an input to produce its associated output. 18 When you use Guix System, you define your *system* in Scheme, and then `guix system` interprets the output and makes it to your spec. 19 That is, you don't change `fstab`, you tell Guix how `fstab` should be. 20 This is super cool, and it makes for reproducible systems, and easy rollbacks in case you make a breaking change. 21 Also, since the only requirement for your operating system spec is that it has to be a valid `operating-system` type declaration, you can use whatever tricks you want up your sleeve to define it. 22 23 Traditionally for matters like this I usually either just remember how I had something set up and try my best to replicate it, or back-up the configurations themselves, although sometimes it can be dubious whether or not the package manager will manhandle my configurations if I tell it to do something. 24 For example, Portage would often see my changes to `inittab` as something that needs to be overwritten and prompt me to during `etc-update`. 25 With Guix, the state of `inittab` is defined when my operating system is generated, and it is immutable until I make a new `operating-system`. 26 System configuration is so consolidated now that I [just stick the whole thing on git for backup and tracking](https://git.eonn.xyz/guix-config/log.html). 27 28 Package management with Guix has the same type of philosophy, since `guix system`, is just part of Guix. 29 Packages are also defined functionally with the effect that if I hand you a definition for some package, you will be able to replicate it bit-for-bit. 30 If sources are referenced with Git, you can cite the commit hash and give a checksum to ensure that you are using the exact same codebase that I am. 31 I've found writing packages to be very easy and straightforward, despite my lacking sense for Scheme. 32 33 Guix also has other nuances that win me over, like profiles and its extreme flexibility by design. 34 I ended up using it full-time instead of Gentoo GNU/Linux, and I've been enjoying the experience, so I'll be using it on my personal computers for the time being. 35 It's a bonus that it's another excuse for me to learn some Lisps, and that's the real learning curve of using Guix system. 36 The Guix paradigm diverges from how GNU systems are set-up, and so oftentimes doing an internet search for "linux how to do x" in the context of system administration doesn't fly. 37 Learning how to do things the Guix Way can be daunting, but the documentation is well done for such a new project and after a while it 'makes sense' such that I can solve novel 'how can I produce x's by intuition, which is an indicator that something's being done right.