backup paperless and adjust restic bucket

This commit is contained in:
Noah Masur 2025-01-14 04:25:37 +00:00
parent d31a083ed6
commit 0f7c15bf36
No known key found for this signature in database
3 changed files with 9 additions and 5 deletions

View File

@ -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

View File

@ -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;

View File

@ -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" ];
};
}