# Moving from CachyOS to NixOS [nixos-anywhere](https://github.com/nix-community/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) - [ ] Optional, but the last chance: record WoW's performance to compare later. In Faugus, edit Battle.net, turn on MangoHud and add this line to the launch arguments: `MANGOHUD_CONFIG=read_cfg,output_folder=/home/vizie/benchmarks,log_duration=60,log_interval=0`. In game, stand somewhere you can return to (a busy city), keep the camera still and press Left Shift+F2. Do it three times. Do the same on NixOS later and compare with `~/git/dot/tools/bench-compare`. - [ ] Quit Signal, Discord, Firefox, Claude and the games, then update the backup (only what changed since the last run is copied): ```bash sudo ~/git/dot/tools/backup-to-sata ``` - [ ] Let the Mac log in as root, which nixos-anywhere needs. Paste the Mac's public key (`cat ~/.ssh/id_ed25519.pub` on the Mac) into: ```bash sudo install -d -m700 /root/.ssh && sudo nano /root/.ssh/authorized_keys ``` ## 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 still log in after the install. ```bash gh auth setup-git gh repo clone Eiziv/dot ~/dot ``` Check from the Mac that `ssh root@10.0.0.40` logs in. Then install. **This wipes the desktop's NVMe drive** without asking again: ```bash nix run github:nix-community/nixos-anywhere -- --flake ~/dot#desktop --build-on remote --copy-host-keys --no-use-machine-substituters root@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): ```bash 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 - The login screen is the same gtkgreet over the blurred wallpaper. - Only what `restore-filter` lists came back: app data and logins, SSH keys, shell history, `~/git/dot`, Steam's settings and saves. Everything else (Downloads, the other repos, CachyOS leftovers) is on the backup drive under `vizie/`: `sudo mount -o ro /dev/disk/by-label/backup /mnt` to copy something back. - "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`. ## 5. 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. `/home` was 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-shaders` stay 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-mono` to `fonts.packages` in `modules/nixos/desktop.nix` to get the font the config names. - **The login screen opens a kitty terminal** behind gtkgreet (`hl.exec_cmd("kitty")` in `config/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_keys`** has a key labelled `chris@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.nix` to try one. ## 6. Games - **Steam**: your settings, Proton versions and game saves (`compatdata`) are back. The games in `~/Games/SteamLibrary` and Steam's own library show as not installed; install them again. Steam may need the library folder re-added (Settings → Storage). - **WoW**: in Faugus, remove the old Battle.net entry and add Battle.net again (Faugus installs it into a new prefix at `~/Games/battlenet`). Pick the same runner, `Proton-CachyOS Latest` (it's back in `~/.local/share/Steam/compatibilitytools.d`), and the same launch arguments: `WINE_SIMULATE_WRITECOPY=1` and `PROTON_ENABLE_WAYLAND=0`. Install WoW, then copy your settings and addons back before you start it: ```bash sudo mount -o ro /dev/disk/by-label/backup /mnt cp -a /mnt/wow/{WTF,Interface} ~/Games/battlenet/drive_c/'Program Files (x86)'/'World of Warcraft'/_retail_/ sudo umount /mnt ``` - **OSRS**: install the official Old School RuneScape launcher. Bolt is gone, and so is its data. ## 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.