feat(modules/nixos/base,hosts): add btrbk for filesystem backup

This commit is contained in:
Ryan Yin
2024-03-31 15:18:14 +08:00
parent 56015780e0
commit 4da995fa88
5 changed files with 64 additions and 8 deletions

View File

@@ -0,0 +1,24 @@
{
# Tool for creating snapshots and remote backups of btrfs subvolumes
# https://github.com/digint/btrbk
services.btrbk.instances.btrbk = {
# How often this btrbk instance is started. See systemd.time(7) for more information about the format.
onCalendar = "daily";
settings = {
# keep daily snapshots for 14 days
snapshot_preserve = "14d";
# keep all snapshots for 2 days, no matter how frequently you (or your cron job) run btrbk
snapshot_preserve_min = "2d";
volume = {
"/btr_pool" = {
subvolume = {
"@persistent" = {
snapshot_create = "always";
};
};
target = "/snapshots";
};
};
};
};
}