nix/nixos/common/services/snapper.nix
2024-11-21 16:05:14 +01:00

44 lines
1.6 KiB
Nix

{ lib, pkgs, desktop, ... }: {
environment.systemPackages = [ pkgs.snapper ] ++ lib.optional (builtins.isString desktop) pkgs.snapper-gui;
services.snapper = {
snapshotRootOnBoot = true;
cleanupInterval = "1d";
snapshotInterval = "hourly";
configs = {
root = {
TIMELINE_CREATE = true;
TIMELINE_CLEANUP = true;
# TIMELINE_LIMIT_YEARLY = 0;
# TIMELINE_LIMIT_QUARTERLY = 2;
# TIMELINE_LIMIT_MONTHLY = 3;
# TIMELINE_LIMIT_WEEKLY = 4;
# TIMELINE_LIMIT_DAILY = 7;
# TIMELINE_LIMIT_HOURLY = 24;
SUBVOLUME = "/";
};
home = {
TIMELINE_CREATE = true;
TIMELINE_CLEANUP = true;
# TIMELINE_LIMIT_YEARLY = 0;
# TIMELINE_LIMIT_QUARTERLY = 2;
# TIMELINE_LIMIT_MONTHLY = 3;
# TIMELINE_LIMIT_WEEKLY = 4;
# TIMELINE_LIMIT_DAILY = 7;
# TIMELINE_LIMIT_HOURLY = 24;
SUBVOLUME = "/home";
};
nix = {
TIMELINE_CREATE = true;
TIMELINE_CLEANUP = true;
# TIMELINE_LIMIT_YEARLY = 0;
# TIMELINE_LIMIT_QUARTERLY = 2;
# TIMELINE_LIMIT_MONTHLY = 3;
# TIMELINE_LIMIT_WEEKLY = 4;
# TIMELINE_LIMIT_DAILY = 7;
# TIMELINE_LIMIT_HOURLY = 24;
SUBVOLUME = "/nix";
};
};
};
}