How does Preservation compare to impermanence

Preservation does not attempt to be a very generic solution

Preservation tries to fill a specific niche. For instance, Preservation does not support non-NixOS systems via home-manager, which is supported by impermanence. See Migration for more technical details.

Preservation only generates static configuration

That is configuration for systemd-tmpfiles and systemd mount units. This makes Preservation a potential candidate for state management on interpreter-less NixOS systems.

Impermanence makes use of NixOS activation scripts and custom systemd services with bash (at the point of writing this), to create files and directories, setup mounts and configure ownership and permissions (see next point).

Preservation must be precisely configured

There is no special runtime logic in place. This means that the user must define:

  • when the preservation should be set up: either in the initrd, or after (the default)
  • how the preservation should be set up: either by symlink, or bindmount (the default)
  • whether or not parent directories of the persisted files require special permissions

See Migration for specifics that need to be considered when coming from an impermanence setup.

Similar configuration

Preservation's configuration is based on, and very similar to that of impermanence. See Migration for technical details.

Global enable option

Preservation uses a global enable option, impermanence does not.

For thoughts on the enable option, see the discussion at https://github.com/nix-community/impermanence/pull/171 and for available configuration options see Configuration Options.