diff options
author | sils <sils@sils.li> | 2024-01-06 22:57:48 +0100 |
---|---|---|
committer | sils <sils@sils.li> | 2024-01-06 22:57:48 +0100 |
commit | 0be51781026d1437244417391f94cbdb0a1fee86 (patch) | |
tree | c48a3f6501078c104bf545541999532d8b0243ed | |
parent | feat(sys/services): add restic (diff) | |
download | nix-config-0be51781026d1437244417391f94cbdb0a1fee86.tar.gz nix-config-0be51781026d1437244417391f94cbdb0a1fee86.zip |
fix(sys/services/restic): backup btrfs snapshot
Diffstat (limited to '')
-rw-r--r-- | sys/services/restic/default.nix | 11 |
1 files changed, 9 insertions, 2 deletions
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" |