From 47800e4173fe9c6c76923d98501b7614b617fcd2 Mon Sep 17 00:00:00 2001 From: derped Date: Sat, 21 Dec 2024 21:18:16 +0100 Subject: [PATCH] btrbk: base config for snapshots. --- services/btrbk.nix | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 services/btrbk.nix diff --git a/services/btrbk.nix b/services/btrbk.nix new file mode 100644 index 0000000..70fb7dc --- /dev/null +++ b/services/btrbk.nix @@ -0,0 +1,26 @@ +{ + config, + lib, + ... +}: + +with lib; + +mkIf (elem "btrbk" config.machine.services) { + services.btrbk.instances = { + "persist" = { + onCalendar = "hourly"; + settings = { + timestamp_format = "long"; + snapshot_preserve_min = "1w"; + volume = { + "/" = { + snapshot_preserve = "20d 10w *m"; + snapshot_dir = "/snapshots"; + subvolume = "/persist"; + }; + }; + }; + }; + }; +}