nixos/snapper: improve config example #109607
Merged
+2
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation for this change
In the default snapper module configuration we have timers for creating and deleting snapper snapshots, and it looks like if we just create configs with correct mountpoints we will get automatic snapshots. This either used to be true, or seems to be only true on Archlinux according to their wiki: https://wiki.archlinux.org/index.php/Snapper#Enable/disable , "If you have a cron daemon, this feature should start automatically. To disable it, edit the configuration file corresponding with the subvolume you do not want to have this feature and set TIMELINE_CREATE=no"). It is not true on current NixOS.
Options TIMELINE_CREATE and TIMELINE_CLEANUP are set to "no" by default (according to snapper-configs(5)), so just providing configs won't be enough for having automatic backups, which are the main use case for snapper. It is especially important to have it in our docs, as on other linux distributions you would use
snapper create-config
to generate configs for partitions, and you'd see that TIMELINE_CREATE and TIMELINE_CLEANUP are set to no. Also, my guess is that it might be set to no by default purely for safety reasons in regular distros, so that the config won't be actioned upon until the user finishes customizing it.Things done
Added TIMELINE_CREATE=yes and TIMELINE_CLEANUP=yes into snapper service config example.
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)