BTW, there is a Firefox module in Home Manager for those who want a customizable Firefox. Like, I set my custom `about:config` flags there and every time I reinstall my system I am sure that I didn't forget that random config to enable hardware acceleration again. You can also manage extensions with it, but for this part I prefer to use Firefox Sync itself.
At least for me, this is even better than backup/restore. Generally I don't want to preserve cache or cookies between installations, I just want my config there.