selfprivacy-nixos-config/backup/restic.nix

35 lines
752 B
Nix
Raw Normal View History

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";
2021-12-21 13:43:05 +00:00
repository = "rclone:${cfg.backblaze.bucket}:/sfbackup";
2021-12-21 10:01:25 +00:00
extraOptions = [ "rclone.args='serve restic --stdio'" ];
2021-12-21 13:24:51 +00:00
rcloneConfig = {
type = "b2";
account = cfg.backblaze.accountId;
key = cfg.backblaze.accountKey;
hard_delete = false;
};
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;
};
}