From 0be51781026d1437244417391f94cbdb0a1fee86 Mon Sep 17 00:00:00 2001 From: sils Date: Sat, 6 Jan 2024 22:57:48 +0100 Subject: fix(sys/services/restic): backup btrfs snapshot --- sys/services/restic/default.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'sys/services/restic') diff --git a/sys/services/restic/default.nix b/sys/services/restic/default.nix index f79f734..77ff40e 100644 --- a/sys/services/restic/default.nix +++ b/sys/services/restic/default.nix @@ -1,11 +1,18 @@ -{config, ...}: { +{ + config, + pkgs, + ... +}: { services.restic.backups = let - homeDir = "/home/sils"; + homeDir = "/srv/snapshots/home/sils"; srvDir = "${homeDir}/srv"; boxUser = "u384702-sub1"; in { storagebox = { initialize = true; + backupPrepareCommand = '' + [ -d /srv/snapshots/home ] && ${pkgs.btrfs-progs}/bin/btrfs subvolume delete /srv/snapshots/home; ${pkgs.btrfs-progs}/bin/btrfs subvolume snapshot -r /home /srv/snapshots/home; + ''; paths = [ srvDir "${homeDir}/schule" -- cgit 1.4.1