nix/nixos/common/services/snapper.nix

45 lines
1.6 KiB
Nix
Raw Normal View History

2023-12-12 06:26:36 +01:00
{ lib, pkgs, desktop, ... }: {
2023-12-12 06:49:35 +01:00
environment.systemPackages = [ pkgs.snapper ] ++ lib.optional (builtins.isString desktop) pkgs.snapper-gui;
services.snapper = {
snapshotRootOnBoot = true;
2024-11-21 16:14:24 +01:00
cleanupInterval = "1h";
2023-12-25 10:02:53 +01:00
snapshotInterval = "hourly";
2023-12-24 03:02:20 +01:00
configs = {
root = {
TIMELINE_CREATE = true;
TIMELINE_CLEANUP = true;
2024-11-21 16:14:24 +01:00
TIMELINE_LIMIT_YEARLY = 0;
TIMELINE_LIMIT_QUARTERLY = 2;
TIMELINE_LIMIT_MONTHLY = 3;
TIMELINE_LIMIT_WEEKLY = 4;
TIMELINE_LIMIT_DAILY = 7;
TIMELINE_LIMIT_HOURLY = 24;
2023-12-25 08:45:46 +01:00
SUBVOLUME = "/";
2023-12-24 03:02:20 +01:00
};
home = {
TIMELINE_CREATE = true;
TIMELINE_CLEANUP = true;
2024-11-21 16:14:24 +01:00
TIMELINE_LIMIT_YEARLY = 0;
TIMELINE_LIMIT_QUARTERLY = 2;
TIMELINE_LIMIT_MONTHLY = 3;
TIMELINE_LIMIT_WEEKLY = 4;
TIMELINE_LIMIT_DAILY = 7;
TIMELINE_LIMIT_HOURLY = 24;
2023-12-25 09:21:55 +01:00
SUBVOLUME = "/home";
2023-12-24 03:02:20 +01:00
};
nix = {
TIMELINE_CREATE = true;
TIMELINE_CLEANUP = true;
2024-11-21 16:14:24 +01:00
TIMELINE_LIMIT_YEARLY = 0;
TIMELINE_LIMIT_QUARTERLY = 2;
TIMELINE_LIMIT_MONTHLY = 3;
TIMELINE_LIMIT_WEEKLY = 4;
TIMELINE_LIMIT_DAILY = 7;
TIMELINE_LIMIT_HOURLY = 24;
2023-12-25 09:21:55 +01:00
SUBVOLUME = "/nix";
2023-12-24 03:02:20 +01:00
};
};
};
2024-11-21 16:05:14 +01:00
}