{ 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"; }; }; }; }; }; }