2022-11-08 13:46:01 +00:00
|
|
|
{ config, pkgs, ... }: rec {
|
2022-08-20 10:13:25 +01:00
|
|
|
|
|
|
|
environment.systemPackages = with pkgs; [ restic ];
|
|
|
|
|
|
|
|
sops.secrets."restic-backups-b2-repo-password" = {
|
|
|
|
sopsFile = ./restic.sops.yaml;
|
|
|
|
};
|
|
|
|
sops.secrets."restic-backups-b2-environment" = {
|
|
|
|
sopsFile = ./restic-environment.sops;
|
|
|
|
format = "binary";
|
|
|
|
path = "/etc/nixos/secrets/b2-env";
|
|
|
|
};
|
|
|
|
services = {
|
|
|
|
restic.backups.b2 = {
|
|
|
|
passwordFile = "/run/secrets/restic-backups-b2-repo-password";
|
2022-11-26 22:07:20 +00:00
|
|
|
paths = [ "/var/lib/foundryvtt" "/var/lib/gitea" "/var/lib/mastodon" ];
|
2022-08-20 10:13:25 +01:00
|
|
|
repository = "b2:cyplo-restic-vpsfree";
|
|
|
|
timerConfig = { OnCalendar = "hourly"; };
|
2022-11-08 13:46:01 +00:00
|
|
|
environmentFile =
|
|
|
|
"${config.sops.secrets.restic-backups-b2-environment.path}";
|
2022-08-20 10:13:25 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
systemd.services.restic-backups-b2.serviceConfig = {
|
|
|
|
Nice = 19;
|
|
|
|
IOSchedulingClass = "idle";
|
|
|
|
};
|
|
|
|
}
|