diff --git a/hosts/sora/services/default.nix b/hosts/sora/services/default.nix index 90f2765..04a02fe 100644 --- a/hosts/sora/services/default.nix +++ b/hosts/sora/services/default.nix @@ -4,6 +4,7 @@ ./uptimekuma.nix ./ntfy-sh.nix ./tailscale.nix + ./restic.nix ./factorio.nix # ./minecraft.nix # ./foundryvtt.nix diff --git a/hosts/sora/services/restic.nix b/hosts/sora/services/restic.nix new file mode 100644 index 0000000..9803932 --- /dev/null +++ b/hosts/sora/services/restic.nix @@ -0,0 +1,35 @@ +{ + pkgs, + config, + ... +}: { + sops.secrets = { + restic-repo-pwd-sora = {}; + sora-b2 = {}; + }; + environment.systemPackages = [pkgs.restic]; + services.restic = { + backups = { + sora = { + user = "root"; + paths = [ + "/var/lib/uptime-kuma" + "/var/lib/ntfy-sh" + ]; + pruneOpts = [ + "--keep-daily=8" + "--keep-weekly=6" + "--keep-monthly=5" + ]; + repository = "b2:sora-b2"; + initialize = true; + passwordFile = config.sops.secrets.restic-repo-pwd-sora.path; + environmentFile = config.sops.secrets.sora-b2.path; + timerConfig = { + OnCalendar = "daily"; + Persistent = true; + }; + }; + }; + }; +}