Desktop
BOOMSTICK’s DESKTOP=1 just test-vm does this chapter on a test VM
(x86_64, under emulation): the system half, a reboot into greetd,
then the sway-home half as user – hm-install, the GPU driver
setup, firefox from Nix – and an admin diff that finds no drift.
What it cannot do is log in to sway: the VM has no screen, so
whether sway, its bar and firefox actually draw, with the GPU, is
untested.
The base system is headless on purpose. A desktop is something you
add to it, and on this machine adding things means editing the host
repo and running admin apply. This chapter adds sway, a tiling
Wayland compositor, with my own dotfiles, sway-home, for the
user account.
The desktop comes from two places, split along one line: what the system has to provide comes from pacman, and what the user chooses comes from Nix.
| From pacman, via the host repo | From Nix, via Home Manager and sway-home |
|---|---|
| sway, swaylock, swayidle, kanshi, the Wayland portal | foot, waybar, rofi, screenshot and clipboard tools, fonts |
| PipeWire and WirePlumber, pamixer, playerctl, brightnessctl | firefox, with its add-ons and settings |
| greetd and tuigreet, the login screen | emacs, and the command-line toolbox |
| polkit, Nix itself | every dotfile: sway, waybar, foot, bash, git … |
The left column is the part that is tangled up with the system: sway
needs logind and the system’s Mesa drivers, swaylock authenticates
through the system’s PAM, greetd is a system service, and Nix’s own
daemon runs as root. Those come from Arch, managed by admin like
everything else on the machine. The right column is the part that is
personal – which terminal, which bar, which keys – and it comes from
Home Manager, which builds a user’s whole environment from one git
repository and can roll it back. That is the same arrangement the
NixOS Workstation book uses, minus NixOS.
admin and user are still separate. The desktop belongs to user,
the day-to-day account; admin changes the system it runs on.