From b9cf8dedf82149822bd09825298e8e28f9e69823 Mon Sep 17 00:00:00 2001 From: Nettika Date: Sun, 16 Jun 2024 15:32:20 -0700 Subject: [PATCH] Configure Restic backups to B2 --- backup.nix | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/backup.nix b/backup.nix index c3b942a..f9f8af6 100644 --- a/backup.nix +++ b/backup.nix @@ -1,4 +1,19 @@ -{ pkgs, ... }: +{ pkgs, config, ... }: { - environment.systemPackages = [pkgs.backblaze-b2]; + environment.systemPackages = [pkgs.restic]; + + services.restic.backups = { + b2 = { + initialize = true; + environmentFile = "/etc/restic-env"; + repository = "b2:marauder-backup"; + passwordFile = "/etc/restic-password"; + paths = [config.users.users.nettika.home]; + pruneOpts = [ + "--keep-daily 7" + "--keep-weekly 5" + "--keep-monthly 12" + ]; + }; + }; }