1
Fork 0
satellite/hosts/nixos/calypso/services/snapper.nix

44 lines
1.1 KiB
Nix
Raw Normal View History

2024-08-27 16:28:49 +02:00
{ config, lib, ... }:
2024-08-26 17:38:47 +02:00
{
2024-08-27 16:28:49 +02:00
# Why is this not part of the nixos module...
systemd.tmpfiles.rules = lib.mapAttrsToList (
_: c: "Q ${c.SUBVOLUME}/.snapshots"
) config.services.snapper.configs;
2024-08-26 17:38:47 +02:00
services.snapper = {
snapshotInterval = "hourly";
cleanupInterval = "1d";
# http://snapper.io/manpages/snapper-configs.html
configs = {
# {{{ Data
data = {
2024-08-26 23:30:04 +02:00
SUBVOLUME = "/persist/data";
2024-08-26 17:38:47 +02:00
TIMELINE_CREATE = true;
TIMELINE_CLEANUP = true;
BACKGROUND_COMPARISON = "yes";
TIMELINE_LIMIT_HOURLY = "24";
TIMELINE_LIMIT_DAILY = "7";
TIMELINE_LIMIT_WEEKLY = "4";
TIMELINE_LIMIT_MONTHLY = "12";
TIMELINE_LIMIT_YEARLY = "0";
};
# }}}
# {{{ State
state = {
2024-08-26 23:30:04 +02:00
SUBVOLUME = "/persist/state";
2024-08-26 17:38:47 +02:00
TIMELINE_CREATE = true;
TIMELINE_CLEANUP = true;
BACKGROUND_COMPARISON = "yes";
TIMELINE_LIMIT_HOURLY = "6";
TIMELINE_LIMIT_DAILY = "3";
TIMELINE_LIMIT_WEEKLY = "1";
TIMELINE_LIMIT_MONTHLY = "1";
TIMELINE_LIMIT_YEARLY = "0";
};
# }}}
};
};
}