mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-03-27 11:51:32 +01:00
feat(modules/nixos/base,hosts): add btrbk for filesystem backup
This commit is contained in:
24
modules/nixos/base/btrbk.nix
Normal file
24
modules/nixos/base/btrbk.nix
Normal 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";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user