If you’ve ever felt overwhelmed by NixOS commands, flakes, or the dreaded garbage collection panic, this guide is for you. It’s not just a cheatsheet—it’s a practical survival kit for running NixOS with flakes, keeping your system clean, and always having a rollback strategy when things go sideways.
Always prefer boot over switch when testing major updates. Reboot to try it, rollback at bootloader if it fails.
Keep your lockfile in git. Rollbacks are trivial when you can checkout an old commit.
GC smartly. Don’t delete all history immediately—keep 14+ days for safety.
Use nix store diff-closures before switching, to see what really changed.
🚀 Final Thoughts
Running NixOS with flakes doesn’t have to feel like juggling chainsaws. With a solid update routine, rollback plan, and controlled garbage collection, you’ll have both cutting-edge packages and peace of mind.
This cheatsheet is meant to be your daily companion—bookmark it, print it, or stick it on your wall. Happy hacking!