The system

Everything on this page is an edit to the host repo, made as admin, followed by admin apply. The same files are in BOOMSTICK’s desktop/ directory, which the test VM uses.

Packages

Add a block to packages.txt:

Edit this file: ~/arch/packages.txt
# Desktop: sway and what it needs from the system. The rest of the
# desktop -- terminal, bar, launcher, firefox, fonts, dotfiles -- comes
# from Nix, with Home Manager and sway-home.
nix
sway swaylock swayidle kanshi xdg-desktop-portal-wlr
pipewire pipewire-pulse pipewire-jack wireplumber pamixer playerctl brightnessctl
greetd greetd-tuigreet polkit
noto-fonts just
  • sway, swaylock and swayidle are the compositor, the screen locker and the idle watcher that starts it. kanshi switches display layouts when monitors come and go.
  • xdg-desktop-portal-wlr lets sandboxed programs and browsers share the screen.
  • PipeWire is the sound server, with pipewire-pulse standing in for PulseAudio so that pactl and pamixer – which sway-home’s volume keys call – work, and pipewire-jack standing in for JACK. WirePlumber decides which device is which. playerctl and brightnessctl are the media and brightness keys.
  • greetd with tuigreet is the login screen: a text prompt on the first console that starts sway once you have logged in.
  • polkit lets programs ask for privileges without being run as root.
  • noto-fonts is the font the system’s own programs draw with – sway’s title bars, swaylock – named because something among them asks for a font (see below). just runs sway-home’s install recipe.
Name the providers

pipewire-jack and noto-fonts are there because something else needs a JACK and a font, and more than one package provides each. Run by hand, admin apply lets pacman ask you which; admin apply --yes cannot answer that question and loops on it. Naming the one you want in packages.txt means nobody has to be asked – and it is what aconfmgr’s documentation recommends anyway.

  • nix is the package manager Home Manager needs. Arch packages it, and so does Arch Linux ARM, so there is no installer script to download and nothing outside pacman’s view.

Units

Add two lines to units.txt:

Edit this file: ~/arch/units.txt
nix-daemon.socket
greetd

nix-daemon.socket starts the Nix daemon the first time someone uses nix. Arch’s package leaves the socket open to every user, so user needs no group membership to use it.

greetd replaces the plain text login on the first console: greetd.service declares Conflicts=getty@tty1.service, so enabling it is all it takes. It also becomes display-manager.service.

Files

Nix needs flakes turned on, which Home Manager uses. The file replaces the one the package installs, so it keeps that one’s single setting:

Edit this file: ~/arch/etc/nix/nix.conf
build-users-group = nixbld
experimental-features = nix-command flakes

greetd needs to be told to start tuigreet, and tuigreet to start sway:

Edit this file: ~/arch/etc/greetd/config.toml
[terminal]
vt = 1

[default_session]
command = "tuigreet --time --remember --asterisks --cmd sway"
user = "greeter"

--remember fills in the last user who logged in.

Apply

Run this on the new machine:
git -C ~/arch add -A
git -C ~/arch commit -m "Desktop: sway, greetd, Nix"
admin apply
sudo systemctl reboot

admin apply installs the packages, puts the two files in place and enables the units, after showing you each change. It goes round twice: nix-daemon.socket and greetd do not exist until their packages are installed, so the first pass installs them and a second enables them, announced as Enabling units from newly installed packages. snap-pac snapshots the transaction like any other. The reboot is what starts greetd and the Nix daemon socket. Afterwards the console shows tuigreet instead of a login prompt; SSH as admin is unchanged.

Run admin diff once more. It should find no drift: the Nix store is on its own subvolume, @nix, mounted at /nix, which setup disk made for this and 90-ignore.sh ignores. That also keeps the store – which can grow to many gigabytes – out of the snapshots of /.

// settings
theme:
fx: