dot

vizie's NixOS desktop: Hyprland, CachyOS kernel and gaming tweaks

148 lines6716 bytesMarkdown

Moving from CachyOS to NixOS

nixos-anywhere installs NixOS from the MacBook over SSH. It switches the running CachyOS into a NixOS installer in RAM (kexec), wipes the NVMe drive and lays it out as hosts/desktop/disko.nix says, builds the system on the desktop itself and reboots into it. No USB stick, and nothing Linux gets built on the Mac.

CachyOS and everything on the NVMe drive are gone afterwards. Your home folder is backed up to the Kingston SATA SSD (sda) first, and only what restore-filter lists comes back: it's a fresh start. The other SATA SSD (sdb) is never touched.

1. On the desktop (CachyOS)

2. On the Mac

Needs Nix (with flakes) and the GitHub CLI signed in to your account: dot and philly are private, and gh auth setup-git lets Nix fetch them. The Mac's public key must also be in macKeys in hosts/desktop/default.nix (committed and pushed), so it can log in to the new system.

gh auth setup-git
gh repo clone Eiziv/dot ~/dot
cd ~/dot && nix develop

nix develop opens a shell with nixos-anywhere in it. Then install. It logs in as you (with your password, or the Mac's key if CachyOS has it), asks for your sudo password once, and from then on wipes the desktop's NVMe drive without asking again:

nixos-anywhere --flake .#desktop --build-on remote --copy-host-keys --no-use-machine-substituters vizie@10.0.0.40

It takes a while: the CachyOS kernel's binary cache has been down, so the kernel compiles on the desktop. --no-use-machine-substituters skips that cache; if it's back up (curl -sI https://attic.xuyh0120.win/lantian/nix-cache-info gives 200), leave the flag out and the kernel downloads instead. The desktop reboots into NixOS at the end.

3. After the reboot

From the Mac (its key is in the config, for root and for you):

ssh root@10.0.0.40
passwd vizie
mount -o ro /dev/disk/by-label/backup /mnt
/mnt/vizie/git/dot/tools/restore-from-sata
umount /mnt

Then log in on the desktop.

4. On the new system

5. What changed

What is different from CachyOS, all on purpose:

Unchanged on purpose, but worth knowing:

6. Games

7. Once you're happy

The backup on sda stays until you need the drive for something else. It is the only copy of what wasn't restored, including the repos that exist only here (skate3, skate-game, he60, move, and Left4Resi's uncommitted changes), so copy out anything you want before reusing the drive. NixOS doesn't mount it; sudo mount /dev/disk/by-label/backup /mnt gets you into it.