Meating the Guix System
Table of Contents
1. Prologue
Sitting on a comfortable high-speed train racing across the vast land of China, with beautiful views flashing past the window, I felt bored. Videos on Bilibili neither interested me, until that one…
GNU Hurd is "Almost There".
It was August 28, 3 days before the semester began.
I had heard of Hurd a long time ago, for me, it was like a fantasy created by a group of old-school hackers who dreams of a world where all people respects FREEDOM. When fantasy was "Almost There", you know that feeling, although "There" is still far from us.
GNU is such a legendary project, and Hurd makes it even more so.
And that was when I started thinking about Linux, GNU/Linux distributions, the systemd wars, the development of Wayland, and, as a NixOS user, the Nix(OS) community drama. I felt like going back, towards the pure world of the computer. But where is it?
The Guix System, a GNU operating system, experimentally support Hurd. It uses GNU Shepherd as PID 1 and implements the NixOS-like system managment logic. Equipped with X11, EXWM, and Emacs, it even becomes a modern "Lisp Machine", where the languages used to generate the whole system, manage system, control X11 windows, and configure and extend Emacs where you do lots of things, are all Lisp.
The moment I came up with it, I knew there was no going back.
One train after another, I found myself sitting in my room. It was time to prepare for tomorrow.
2. Until Login
Guix System will be installed on my Lenovo ThinkBook X G2. It was released in 2025, the last good old days, and its hardware is almost perfect to me, if we ignore the proprietary status quo of hardware today. By the way, shortly after I received the laptop, I upgraded the original 1TB SSD to a 2TB one. Lucky!
Intricate spells are the only way to grant you the true power.
There are 2 installation methods provided: the graphical (actually TUI) one, and the shell-based one. I tried the graphical one at first, but it failed in a strange way, so I turned to the latter method then.
2.1. Disk Partitioning
Here stands the B-tree.
The partition is simple:
- ESP (EFI System Partition)
- the rest of SSD
# List partition layouts parted -l # Partition the SSD parted /dev/nvme0n1 mklabel gpt parted /dev/nvme0n1 mkpart ESP fat32 1MiB 1GiB parted /dev/nvme0n1 set 1 esp on parted /dev/nvme0n1 mkpart root btrfs 1GiB 100% # Check the alignment parted /dev/nvme0n1 align-check optimal 1 parted /dev/nvme0n1 align-check optimal 2
Then make the file systems:
mkfs.fat -n ESP -F 32 /dev/nvme0n1p1 mkfs.btrfs -L root /dev/nvme0n1p2
Leverage the powerful subvolume feature of Btrfs:
mount -o compress=zstd LABEL=root /mnt cd /mnt btrfs subvolume create @snapshots @system @swap @cache @home btrfs filesystem mkswapfile --size=34G @swap/swapfile cd
Mount them together:
umount /mnt mount -o compress=zstd,subvol=@system LABEL=root /mnt cd /mnt mkdir -p boot/efi var/cache swap home etc mount LABEL=ESP boot/efi # Do not compress ESP mount -o subvol=@swap LABEL=root swap # Do not compress swap neither mount -o compress=zstd,subvol=@cache LABEL=root var/cache mount -o compress=zstd,subvol=@home LABEL=root home swapon swap/swapfile cd
2.2. Editing Config Files
Do not be greedy.
This is where the true magic happens, and what makes Guix System (and NixOS) stands out. You can edit the config file as you like, but here I only modified the simplest config to make the system just enough to work:
cp /etc/configuration/bare-bones.scm /mnt/etc/config.scm mg /mnt/etc/config.scm # mg is a Micro Emacs clone guix style -f /mnt/etc/config.scm
2.3. Networking
Guix System is a Free System Distribution, so its kernel is GNU Linux-libre, where all non-free firmware is removed. Later, unfortunately, I changed the kernel to Linux. But at this moment, I wanted to feel Linux-libre.
The most dangerous part of Linux-libre is its wireless, but USB Tethering is your sharp weapon. Then the network setup is easy:
ip address ip link set <interface> up
2.4. Installing System
With all the preparation, your hard work was demonstrated.
Now, summon this modern projection of the ancient power.
# Make /gnu/store copy-on-write, such that packages are written to the target # disk on /mnt rather than kept in memory herd start cow-store /mnt # Projection guix system init /mnt/etc/config.scm /mnt # Misspelled REBIRTH reboot # Login with empty password, and then passwd root passwd <user> exit
This is the GNU operating system, welcome!