From 3a6342409871a165157c19f77e79ee6e95ad5c77 Mon Sep 17 00:00:00 2001 From: dm Date: Sat, 13 Jan 2024 23:20:04 +0100 Subject: [PATCH] feat: Add backup configuration --- configuration.nix | 41 +++++++++++++++++++++++++++++++++++++++++ home.nix | 1 - 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/configuration.nix b/configuration.nix index 7d266a1..5ad1733 100644 --- a/configuration.nix +++ b/configuration.nix @@ -117,6 +117,47 @@ services.pcscd.enable = true; + services.restic.backups = { + backblaze = { + passwordFile = "/home/dm/secrets/restic-password"; + paths = [ + "/home/dm/" + ]; + exclude = [ + "/home/dm/.cache/" + "/home/dm/.local/" + "/home/dm/.mozilla/" + + "*.pyc" + + # Backups + "/home/dm/Vacances/Sabbatique/Backup" + "/home/dm/Phones/Mi4S/PhoneBackUp" + + # Random large files + "/home/dm/Vacances/Sabbatique/Maps/" + + # Secrets + "/home/dm/secrets/" + ]; + repository = "s3:s3.us-east-005.backblazeb2.com/dm-backups"; + extraBackupArgs = [ + "--one-file-system" + ]; + user = "dm"; + initialize = true; + environmentFile = "/home/dm/secrets/restic-environment"; + timerConfig.OnCalendar = "daily"; + backupCleanupCommand = "${pkgs.curl}/bin/curl https://hc-ping.com/571e1b3a-10b2-4bcb-bdef-3c2683ab72b5"; + pruneOpts = [ + "--keep-daily 7" + "--keep-weekly 4" + "--keep-yearly 10" + ]; + }; + }; + + # Hardware hardware = { bluetooth = { diff --git a/home.nix b/home.nix index 2379474..17f9cf9 100644 --- a/home.nix +++ b/home.nix @@ -336,7 +336,6 @@ in enableSshSupport = true; # enableZshIntegration = true; }; - }; xdg.configFile = {