3.7 KiB
🚀 Migration to nixos-unstable
This guide walks you through migrating from NixOS 25.11 (stable) to nixos-unstable.
What is nixos-unstable?
- Stable (25.11): Tested, stable packages. Updated every ~6 months.
- Unstable: Latest packages, updated continuously. May have occasional issues.
Why Migrate?
✅ Latest software versions
✅ Newest features and improvements
✅ Faster security updates
⚠️ Slightly higher risk of breakage
⚠️ Need to monitor updates more carefully
Migration Steps
Step 1: Update flake.nix ✅ (DONE)
The flake.nix has been updated to use:
nixpkgs/nixos-unstableinstead ofnixpkgs/nixos-25.11home-manager/masterinstead ofhome-manager/release-25.11
Step 2: Update the flake lock
This downloads the new channel information:
cd ~/nixos-dotfiles
nix flake update
This will update flake.lock to point to unstable versions.
Step 3: Test the new configuration
Build without switching (safe test):
sudo nixos-rebuild build --flake ~/nixos-dotfiles/#nixos-btw
Or use the Makefile:
make build
If there are no errors, proceed to Step 4.
Step 4: Switch to unstable
Apply the new configuration:
sudo nixos-rebuild switch --flake ~/nixos-dotfiles/#nixos-btw
Or:
make switch
Step 5: Reboot
sudo reboot
Step 6: Verify
After reboot, check your NixOS version:
nixos-version
You should see something like 25.05.xxxxx or higher (unstable doesn't have fixed versions).
Potential Issues & Solutions
Issue: Package not found
Some package names change between stable and unstable.
Solution: Check if the package was renamed:
nix search nixpkgs PACKAGE_NAME
Issue: Build fails due to package conflicts
Solution:
- Check the error message carefully
- Comment out problematic packages temporarily
- Rebuild
- Search for alternatives or updated package names
Issue: Home Manager evaluation errors
Solution: Home Manager on master branch may have API changes. Check the Home Manager release notes.
Issue: System doesn't boot
Solution: Boot into previous generation from GRUB menu:
- Restart and enter GRUB menu
- Select "NixOS - All configurations"
- Choose previous working generation
- Boot into it
- Roll back:
sudo nixos-rebuild switch --rollback
Rolling Back
If you want to go back to stable:
-
Edit
flake.nixand change back to:nixpkgs.url = "nixpkgs/nixos-25.11"; home-manager.url = "github:nix-community/home-manager/release-25.11"; -
Update and switch:
nix flake update make switch
Best Practices on Unstable
-
Update regularly - Don't let updates pile up
make update && make switch -
Monitor for breakage - Check NixOS Discourse for known issues
-
Keep old generations - Don't clean too aggressively
# Keep last 30 days instead of 7 sudo nix-collect-garbage --delete-older-than 30d -
Test before switching - Always use
make buildormake testfirst -
Subscribe to updates - Follow @nixos_org or NixOS Discourse
Current Status
- ✅ flake.nix updated to unstable
- ⏳ Ready for
nix flake update - ⏳ Ready to build and test
- ⏳ Ready to switch
Quick Migration Commands
# Update to latest unstable
nix flake update
# Test the build
make build
# If successful, switch
make switch
# Reboot
sudo reboot
Note: The system.stateVersion = "25.11" in core.nix should NOT be changed. This tracks when you first installed NixOS, not which channel you're using.