selfprivacy-nixos-config/backup/restic.nix

30 lines
574 B
Nix
Raw Normal View History

2021-11-15 12:02:05 +02:00
{ config, pkgs, ... }:
let
cfg = config.services.userdata;
in
{
services.restic.backups = {
options = {
passwordFile = "/etc/restic/resticPasswd";
2022-11-08 01:49:12 +02:00
repository = "s3:s3.anazonaws.com/${cfg.backup.bucket}";
2021-11-15 12:02:05 +02:00
initialize = true;
paths = [
"/var/dkim"
"/var/vmail"
];
timerConfig = {
OnCalendar = [ "daily" ];
};
user = "restic";
pruneOpts = [
"--keep-daily 5"
];
};
};
users.users.restic = {
isNormalUser = false;
isSystemUser = true;
2022-04-20 13:22:16 +03:00
group = "restic";
2021-11-15 12:02:05 +02:00
};
}