STATUS: Your sliceanddice NixOS system is in emergency mode
CAUSE: Configuration mismatch between master and development branches
SOLUTION: Multiple recovery paths available (choose the easiest one for you)
- Reboot the sliceanddice machine
- At the systemd-boot menu, press
SpaceorEsc - Select an older NixOS generation (from before the problem)
- Press Enter to boot
✅ Done! You're back in a working system.
Then prevent it from happening again:
cd /etc/nixos/.dotfiles
git checkout master
sudo nixos-rebuild switch --flake .#sliceanddiceIf you're in a working shell (emergency mode or booted from old generation):
cd /etc/nixos/.dotfiles
sudo bash fix-emergency-auto.shThis script will:
- ✅ Detect the configuration problem
- ✅ Switch to stable master branch
- ✅ Rebuild your system
- ✅ Verify everything works
Choose the guide that fits your situation:
| File | Purpose | When to Use |
|---|---|---|
| QUICKSTART.md | Fast recovery steps | You want the TL;DR |
| SOLUTION.md | Complete explanation | You want to understand what happened |
| EMERGENCY_RECOVERY.md | Technical deep-dive | You need detailed recovery procedures |
| diagnose-emergency.sh | Diagnostic script | You want to see what's wrong |
| fix-emergency-auto.sh | Automated fix | You want one-command recovery |
Short version: The development branch has new features that require additional files. If you rebuilt using development branch config but the files weren't present, NixOS couldn't activate and dropped into emergency mode.
Files required by development branch:
disko.nix- Disk/filesystem managementkbd-bl-ask.nix- Keyboard backlight configmsi-ec-sword-kbd-disable.patch- MSI laptop kernel patch- Power management features
- Boot generation limiting
Current master branch: ✅ Stable, working, doesn't need these files
Boot from systemd-boot menu → Select older generation → Boot
mount -o remount,rw /
cd /etc/nixos/.dotfiles
git checkout master
nixos-rebuild switch --flake .#sliceanddice
rebootsudo bash fix-emergency-auto.shBoot NixOS installer → Mount filesystems → Chroot → Fix config
Once your system is working again:
-
Verify you're on master branch:
cd /etc/nixos/.dotfiles git branch # Should show: * master
-
Stay on master (recommended):
- It's stable and tested
- No configuration changes needed
- Everything works
-
OR move to development (advanced):
- Merge development features properly
- Test in VM first
- Ensure all files are present
-
Run the diagnostic script:
bash diagnose-emergency.sh
-
Check the detailed guides:
- Read
SOLUTION.mdfor full explanation - Read
EMERGENCY_RECOVERY.mdfor technical details
- Read
-
Verify filesystem integrity:
lsblk -o NAME,UUID,FSTYPE,SIZE,MOUNTPOINT df -h mount | grep -E "/(boot|nix|home)"
Machine: MSI laptop with Intel Tiger Lake + NVIDIA RTX 3050 Ti
Storage: Samsung 870 EVO 500GB
Current filesystem: ext4 on root
Boot: systemd-boot (511M EFI partition)
Expected UUIDs:
- Root:
b89f5dca-4b37-4062-bf1d-9e4ebfd61916 - Boot:
8824-4C5F - Swap:
c570ec29-6025-456b-99d1-8f16b677835a
You'll know recovery worked when:
- ✅ System boots to desktop without emergency mode
- ✅ All applications work normally
- ✅
systemctl statusshows no critical failures - ✅ You're on master branch:
git branchin dotfiles shows* master
| Problem | Fix | Time |
|---|---|---|
| Emergency mode | Boot previous generation | 1 min |
| + Want to prevent | Switch to master branch | 5 min |
| + Want automated fix | Run fix-emergency-auto.sh | 10 min |
Bottom line: Boot an older generation from the boot menu. Problem solved! 🎉