

Last week I accidentally overwrite my configuration.nix file with garbage. If you use NixOS this should fill you with horror. If you don’t, that file contains a description of your entire system – all the packages as well as many settings tweaks to anything from GUI apps to core kernel & systemd options.
I have now learned my lesson and started using git to track my changes. Tbh, I was naively expecting to be able to roll back to a previous config and pull out my configuration file, but that’s not how it works. Happily I had already split out the most difficult to reproduce sections into their own files (mostly networking stuff), so it wasn’t that catastrophic, but it still turned a few minutes of tinkering into a couple hours of forehead-smacking.
See my top-level comment; even if they’re ready for the complexity, it doesn’t protect you from a similar mistake!