laptop-nix-config/configuration/backups.nix

40 lines
973 B
Nix
Raw Normal View History

2025-02-16 16:15:35 -05:00
{pkgs, ...}: {
services.btrbk = {
instances = {
home-daily = {
onCalendar = "daily";
settings = {
ssh_identity = builtins.toString ../../id_ed25519;
ssh_user = "btrbk";
snapshot_preserve_min = "1m";
snapshot_preserve = "3m";
# target = "raw ssh://shared-vm-nixos/mnt/tank/home/aubrey/btrfsSnapshots";
volume = {
"/" = {
subvolume = "home";
snapshot_dir = "/snapshots";
};
};
};
};
home = {
onCalendar = "hourly";
settings = {
timestamp_format = "long";
snapshot_preserve_min = "1w";
snapshot_preserve = "2w";
volume = {
"/" = {
snapshot_dir = "/snapshots";
subvolume = "home";
};
};
};
};
};
};
systemd.tmpfiles.rules = [
"d /snapshots 0755 root root"
];
}