2021-11-15 10:02:05 +00:00
|
|
|
{ config, pkgs, ... }:
|
|
|
|
let
|
|
|
|
cfg = config.services.userdata;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
services.restic.backups = {
|
2021-12-21 10:01:25 +00:00
|
|
|
varBackup = {
|
|
|
|
passwordFile = "/var/lib/restic/pass";
|
|
|
|
repository = "rclone:backblaze:${cfg.backblaze.bucket}:/sfbackup";
|
|
|
|
extraOptions = [ "rclone.args='serve restic --stdio'" ];
|
|
|
|
rcloneConfigFile = "/root/.config/rclone/rclone.conf";
|
2021-11-15 10:02:05 +00:00
|
|
|
initialize = true;
|
|
|
|
paths = [
|
2021-12-21 10:01:25 +00:00
|
|
|
"/var"
|
2021-11-15 10:02:05 +00:00
|
|
|
];
|
|
|
|
timerConfig = {
|
|
|
|
OnCalendar = [ "daily" ];
|
|
|
|
};
|
|
|
|
user = "restic";
|
|
|
|
pruneOpts = [
|
|
|
|
"--keep-daily 5"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
users.users.restic = {
|
|
|
|
isNormalUser = false;
|
|
|
|
isSystemUser = true;
|
|
|
|
};
|
|
|
|
}
|