From 0f7c15bf36236c12c6646263c2516243cb9f8de0 Mon Sep 17 00:00:00 2001 From: Noah Masur <7386960+nmasur@users.noreply.github.com> Date: Tue, 14 Jan 2025 04:25:37 +0000 Subject: [PATCH] backup paperless and adjust restic bucket --- hosts/swan/default.nix | 2 +- modules/nixos/services/backups.nix | 8 ++++---- modules/nixos/services/paperless.nix | 4 ++++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/hosts/swan/default.nix b/hosts/swan/default.nix index c5e3ee9..efb9029 100644 --- a/hosts/swan/default.nix +++ b/hosts/swan/default.nix @@ -134,7 +134,7 @@ inputs.nixpkgs.lib.nixosSystem rec { endpoint = "s3.us-west-002.backblazeb2.com"; bucket = "noahmasur-backup"; accessKeyId = "0026b0e73b2e2c80000000005"; - glacierBucket = "noahmasur-archive"; + resticBucket = "noahmasur-restic"; }; # Disable passwords, only use SSH key diff --git a/modules/nixos/services/backups.nix b/modules/nixos/services/backups.nix index ac95659..f9220ae 100644 --- a/modules/nixos/services/backups.nix +++ b/modules/nixos/services/backups.nix @@ -22,9 +22,9 @@ description = "S3 access key ID for backups"; default = null; }; - glacierBucket = lib.mkOption { + resticBucket = lib.mkOption { type = lib.types.nullOr lib.types.str; - description = "S3 bucket for glacier backups"; + description = "S3 bucket for restic backups"; default = null; }; }; @@ -84,9 +84,9 @@ dest = "${config.secretsDirectory}/restic"; }; - services.restic.backups = lib.mkIf (config.backup.s3.glacierBucket != null) { + services.restic.backups = lib.mkIf (config.backup.s3.resticBucket != null) { default = { - repository = "s3:s3.us-east-1.amazonaws.com/${config.backup.s3.glacierBucket}/restic"; + repository = "s3:s3.us-east-1.amazonaws.com/${config.backup.s3.resticBucket}/restic"; paths = [ ]; environmentFile = config.secrets.s3-glacier.dest; passwordFile = config.secrets.restic.dest; diff --git a/modules/nixos/services/paperless.nix b/modules/nixos/services/paperless.nix index 3478b19..7f40603 100644 --- a/modules/nixos/services/paperless.nix +++ b/modules/nixos/services/paperless.nix @@ -57,5 +57,9 @@ systemd.services.paperless-web.serviceConfig.UMask = lib.mkForce "0026"; systemd.services.paperless-scheduler.serviceConfig.UMask = lib.mkForce "0026"; systemd.services.paperless-task-queue.serviceConfig.UMask = lib.mkForce "0026"; + + # Backups + services.restic.backups.default.paths = [ "/data/generic/paperless/documents" ]; + }; }