Timeshifting
NixOS is attractive mainly because it has instant rollbacks and up-to-date packages. It’s like a marriage of Arch / bleeding edge and Debian / stability. The problem is that maintaining a NixOS installation is a huge time sink. It’s better to be able to edit system files in a straightforward way and also have a stable system. That’s where Timeshift comes in.
NixOS-like Boot Menu (a List of Snapshots)
For this example, we’ll use Archlinux on btrfs with GRUB as the bootloader. The other two packages we need are timeshift (which includes timeshift-gtk) and grub-btrfs.
First, setup timeshift-gtk to use btrfs mode. After this, you’ll be able to instantly create or delete backup snapshots. These snapshots are like checkpoints on btrfs, so they don’t take up double storage space.
Feel free to add a label to the created snapshots (or don’t). Run this command to add the snapshots to the GRUB boot menu:
1sudo grub-mkconfig -o /boot/grub/grub.cfg
Check grub-btrfs.cfg to make sure that your snapshots are indeed in the GRUB menu config. You should be able to see the timestamps and the labels in the cfg file:
1head /boot/grub/grub-btrfs.cfg
grub-btrfs does have the grub-btrfsd daemon for running the grub-mkconfig command automatically, but it hasn’t been working very well in my experiments. You can enable the systemd service if you’d like to.
After reboot, in the GRUB menu, you should be able to see a boot option where you can boot into one of the backup snapshots.
System Rescue
Whenever you encounter a problem, just boot into one of the snapshots. When you are in, mount the volumes manually at a mount point like /mnt/btrfs and fix them there. If chroot-and-fixing is too much for you, you can always restore a snapshot with timeshift-gtk in the booted snapshot environment, and continue from there.