Meeting the Guix System
Table of Contents
1. Prologue
1.1. Heard about Hurd
Sitting on a high-speed train racing across the vast land of China, with beautiful views flashing past windows, I felt bored. But videos on Bilibili neither interested me, until that one…
It was August 28, 3 days before the semester began, 7 months after the news was posted.
1.2. Going Back to Future
I had heard of Hurd a long time ago. For me, it's like a fantasy created by a group of old-school hackers who dream of a world where all people respect Free Software.
When fantasy was "Almost There"…
That motivated me to think about Linux, GNU/Linux distributions, the systemd wars, the development of Wayland, and, as a NixOS user before, the Nix(OS) community drama. I felt like going back, toward the pure world of computers. But where is it?
The Guix System is a GNU operating system that experimentally supports 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. Here it is.
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 the next day. Manual, Ventoy, backing up, and sleeping…
2. Until Login
The sun casts its rays upon the earth, bringing brightness.
The Guix System will be installed on my Lenovo ThinkBook X G2, a laptop released in 2025, the last good old days. To me, if the proprietary status quo of hardware is ignured, it's almost perfect. Besides, the day 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 chose the latter method then.
2.1. Disk Partitioning
Here stands the B-tree.
The partitions are 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 files however you want, and Guix will generate the corresponding system for you, but here I only modified the simplest config to make the system just 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 it uses GNU Linux-libre as its kernel, where all non-free firmware is removed. Later, unfortunately, I changed the kernel to Linux. But at that moment, I wanted to feel Linux-libre.
Tether your computer.
One of the most concerning issues of Linux-libre is its wireless support. There is no Ethernet port on my laptop, but with USB Tethering, USB Type-C is just enough:
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 ancient power.
The actual install phase is quite easy:
# 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
guix system init /mnt/etc/config.scm /mnt
reboot is misspelled REBIRTH.
reboot
Log in as root with empty password, and then set passwords:
passwd root
passwd <user>
exit
Finally, you can log in:
This is the GNU operating system, welcome!
3. What's next?
As mentioned earlier, the system is completely determined by config files you provide. But beyond that, Guix also has the ability to handle your home environment.
Next, let's embark on the long journey of customization. And before that, remember:
Design matters more.