Moving from CachyOS to NixOS
The plan keeps your disk as it is. NixOS goes into new btrfs subvolumes next
to CachyOS's, and /home stays the same @home subvolume. Your files, game
libraries, app data, ~/.ssh, Firefox profile and Steam settings never move,
and CachyOS stays bootable until you remove it.
1. Before you start
- Push this repo (
git push) and the latestEiziv/philly. The install fetches philly from GitHub. - Back up what you can't get back to another disk or machine, in case
something goes wrong with the partition:
~/.ssh,~/.config/keys(the imsh upload key),~/.config/Signal(includingconfig.json, which holds the key to Signal's database),~/.config/mozilla, game saves that aren't in a cloud. - Optional: a read-only snapshot of /home to roll back to:
sudo btrfs subvolume snapshot -r /home /home/.snapshot-pre-nixos - Get the NixOS installer (26.05, graphical or minimal) on a USB stick.
2. Install
Boot the installer. Wired network works out of the box.
# The btrfs partition's top level, to make NixOS's subvolumes.
# Mount the new system the way hosts/desktop/hardware-configuration.nix does.
o=noatime,compress=zstd
# Compare the generated hardware config with the one in the repo; if the
# kernel modules or anything else differ, keep the generated lines.
# philly is a private repo: sign in to GitHub for this root shell.
# Install. The extra cache is where the CachyOS kernel comes from.
# It asks for a root password at the end. Then set yours:
The NixOS boot menu (systemd-boot) becomes the default. CachyOS's Limine stays in the firmware boot menu (F8 at the ASUS logo), and also on the ESP, next to it.
3. First boot
- The login screen is the same gtkgreet over the blurred wallpaper.
- Home Manager replaces the old symlinks in
~/.config(pointing into~/git/dotfiles) with its own. The old ones are kept beside them with a.pre-nixossuffix, so nothing is overwritten. - Bolt installs from Flathub in the background on the first boot with network
(
systemctl status flatpak-bolt). - "Command not found" suggestions need nix-index's database once:
nix-index(takes a few minutes). - Check the background programs:
systemctl --user list-units --type=service.
4. What changed
What is different from CachyOS, all on purpose:
- Packages are generic x86-64 builds, apart from the kernel (Zen 4) and proton-cachyos (x86-64-v3). CachyOS rebuilds everything for v3/v4.
- Snapper root snapshots are replaced by NixOS generations: each rebuild is
a boot menu entry.
/homewas never snapshotted on CachyOS either. - GTK theme: set in
modules/home/theming.nix. nwg-look can't save over those files any more. - Signal theme is built into the package: edit,
rebuild,config/signal/restart. - Bitwarden autostart: the same XDG autostart entry, with NixOS's program name.
- fish: only CachyOS's default fish config was there, and your shell is zsh, so fish isn't set up.
- vkBasalt's ReShade shaders in
~/.config/vkBasalt/reshade-shadersstay in your home folder; they aren't in this repo (vkBasalt.conf doesn't use them). - vkSumi: its config is kept, but the layer itself wasn't installed on CachyOS (there is no nixpkgs package for it either).
Unchanged on purpose, but worth knowing:
- kitty's font: kitty.conf asks for JetBrains Mono, which was never
installed, so kitty has been showing Noto Sans Mono. That's kept. Add
nerd-fonts.jetbrains-monotofonts.packagesinmodules/nixos/desktop.nixto get the font the config names. - The login screen opens a kitty terminal behind gtkgreet
(
hl.exec_cmd("kitty")inconfig/greetd/hyprland.lua), running as the greeter user. If gtkgreet ever crashed, that shell would be on screen before anyone logs in. If it's a leftover from debugging, delete that line. ~/.ssh/authorized_keyshas a key labelledchris@echoz.io, which lets that key log in as you over SSH (port 22 is open, as before). It stays in your home folder.- mDNS (port 5353) stays closed in the firewall, as ufw had it.
- sched-ext schedulers stay off, as before. See the comment in
modules/nixos/cachyos.nixto try one.
5. Going back to CachyOS
It still boots (firmware boot menu). Its ~/.config links now point into
NixOS's store, which CachyOS doesn't have, so rerun the old repo's script there:
~/git/dotfiles/symlink.sh.
6. Once you're happy
Remove CachyOS: boot NixOS, mount the top level, delete its subvolumes
(@, @root, @srv, @cache, @tmp, @log), then its kernels and Limine
files from the ESP (look first: sudo ls -R /boot; NixOS's own files are
/boot/EFI/nixos, /boot/EFI/systemd, /boot/EFI/BOOT and /boot/loader),
and its firmware boot entry (efibootmgr).