nix/nixos/common/services/snapper.nix

26 lines
No EOL
769 B
Nix

{ lib, pkgs, desktop, ... }: {
environment.systemPackages = [ pkgs.snapper ] ++ lib.optional (builtins.isString desktop) pkgs.snapper-gui;
services.snapper = {
snapshotRootOnBoot = true;
cleanupInterval = "7d";
snapshotInterval = "hourly";
configs = {
root = {
TIMELINE_CREATE = true;
TIMELINE_CLEANUP = true;
SUBVOLUME = "/";
};
home = {
TIMELINE_CREATE = true;
TIMELINE_CLEANUP = true;
SUBVOLUME = "/home";
};
nix = {
TIMELINE_CREATE = true;
TIMELINE_CLEANUP = true;
SUBVOLUME = "/nix";
};
};
};
}