What does HackerNews think of impermanence?

Modules to help you handle persistent state on systems with ephemeral root storage [maintainer=@talyz]

Language: Nix

I'd say yes, to an extent, although you don't get all of the benefits of immutable Linux this way. A good immutable Linux distro does some work to make sure that

  - upgrades/changes are atomic
  - it's very clear whose responsibility it is to track what state, i.e., what parts of the filesystem are snapshotted and when
  - it's easy to revert to any snapshot at boot time
  - you're unlikely to have 'gaps' where you wish there was a snapshot but there isn't one
  - snapshotting applies to configuration changes as well as package (un)installation
You can get most of those benefits of the box on openSUSE or other distros where the default filesystem is copy-on-write and the package manager is configured to take snapshots for you. You can also get something like that for configuration management via etckeeper, which gives you version control for system-wide config files. A distro which only takes these steps may not always be considered 'immutable Linux' as immutable distros typically go further, either in limiting what changes are possible outside the blessed methods (which generate new snapshots) or how what kinds of configuration/persistence it manages. But at some point it's just a question of degrees.

As it happens, snapshotting with automatic reversion is an approach some take with NixOS to better ensure that its configuration management is comprehensive. You can force all of your persistence requirements to be explicit by reverting to an old snapshot on boot.

Blog post which (afaik) first presented this idea to the community: https://grahamc.com/blog/erase-your-darlings/

Common implementation for NixOS: https://github.com/nix-community/impermanence

Presentation on that implementation from NixCon 2023 (just a couple weeks ago!): https://www.youtube.com/watch?v=QtBouFMyrWg

I use colmena[1] to manage one nixos configuration for multiple machines: - laptop - desktop - server - rpi nas

I also wipe my entire rootfs every boot with a zfs snapshot rollback[2] using the impermanence module[3] to keep specific stateful data one one of two datasets with regular snapshots: one is backed up with zfs send, the other is just for cache between reboots.

It took a little puzzling to get started, because I didn’t know about the impermanence module at first, so I built my own hacky solution. But I really love this setup. And the way I don’t have cruft to clean.

Also my backups are so much smaller now :’-)

[1]: https://colmena.cli.rs/

[2]: https://grahamc.com/blog/erase-your-darlings/

[3]: https://github.com/nix-community/impermanence