mirror of
https://github.com/nmasur/dotfiles
synced 2025-07-05 16:10:14 +00:00
add restic backups to s3 for immich
This commit is contained in:
@ -22,6 +22,11 @@
|
||||
description = "S3 access key ID for backups";
|
||||
default = null;
|
||||
};
|
||||
glacierBucket = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
description = "S3 bucket for glacier backups";
|
||||
default = null;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@ -69,5 +74,30 @@
|
||||
# timerConfig = { OnCalendar = "00:05:00"; };
|
||||
# environmentFile = backup.s3File;
|
||||
# };
|
||||
|
||||
secrets.s3-glacier = {
|
||||
source = ../../../private/s3-glacier.age;
|
||||
dest = "${config.secretsDirectory}/s3-glacier";
|
||||
};
|
||||
secrets.restic = {
|
||||
source = ../../../private/restic.age;
|
||||
dest = "${config.secretsDirectory}/restic";
|
||||
};
|
||||
|
||||
services.restic.backups = {
|
||||
default = {
|
||||
repository = "s3:s3.us-east-1.amazonaws.com/${config.backup.s3.glacierBucket}/restic";
|
||||
paths = [ "/data/images" ];
|
||||
environmentFile = config.secrets.s3-glacier.dest;
|
||||
passwordFile = config.secrets.restic.dest;
|
||||
pruneOpts = [
|
||||
"--keep-daily 14"
|
||||
"--keep-weekly 6"
|
||||
"--keep-monthly 12"
|
||||
"--keep-yearly 100"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
|
@ -40,6 +40,9 @@
|
||||
# Point localhost to the local domain
|
||||
networking.hosts."127.0.0.1" = [ config.hostnames.photos ];
|
||||
|
||||
# Backups
|
||||
services.restic.backups.default.paths = [ "/data/images" ];
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user