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;
|
2023-12-12 06:23:58 +01:00
|
|
|
|
2023-12-26 12:54:01 +01:00
|
|
|
# You need to make the snapshot directories manually:
|
|
|
|
# sudo rm -rf /.snapshots /home/.snapshots /nix/.snapshots
|
|
|
|
# sudo btrfs subvolume create /.snapshots
|
|
|
|
# sudo btrfs subvolume create /nix/.snapshots
|
|
|
|
# sudo btrfs subvolume create /home/.snapshots
|
|
|
|
|
2023-12-12 06:23:58 +01:00
|
|
|
services.snapper = {
|
|
|
|
snapshotRootOnBoot = true;
|
|
|
|
cleanupInterval = "1d";
|
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;
|
2023-12-25 08:45:46 +01:00
|
|
|
SUBVOLUME = "/";
|
2023-12-24 03:02:20 +01:00
|
|
|
};
|
|
|
|
home = {
|
|
|
|
TIMELINE_CREATE = true;
|
|
|
|
TIMELINE_CLEANUP = true;
|
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;
|
2023-12-25 09:21:55 +01:00
|
|
|
SUBVOLUME = "/nix";
|
2023-12-24 03:02:20 +01:00
|
|
|
};
|
|
|
|
};
|
2023-12-12 06:23:58 +01:00
|
|
|
};
|
|
|
|
}
|