64 lines
1.7 KiB
Nix
Raw Normal View History

2023-12-23 01:26:18 +03:00
{ config, inputs, ... }: {
2024-02-01 22:48:57 +03:00
imports = [ inputs.ataraxiasjel-nur.nixosModules.rustic ];
2024-01-24 17:28:12 +03:00
sops.secrets.rustic-vps-pass.sopsFile = inputs.self.secretsDir + /rustic.yaml;
sops.secrets.rustic-backups-s3-env.sopsFile = inputs.self.secretsDir + /rustic.yaml;
2024-01-19 17:58:20 +03:00
services.rustic.backups = rec {
2023-12-23 01:26:18 +03:00
vps-backup = {
backup = true;
prune = false;
2024-01-19 17:58:20 +03:00
initialize = false;
pruneOpts = [ "--repack-cacheable-only=false" ];
environmentFile = config.sops.secrets.rustic-backups-s3-env.path;
2023-12-23 01:26:18 +03:00
timerConfig = {
OnCalendar = "01:00";
Persistent = true;
};
2024-01-19 17:58:20 +03:00
settings = let
label = "vps-containers";
in {
2023-12-23 01:26:18 +03:00
repository = {
repository = "opendal:s3";
2024-01-19 17:58:20 +03:00
password-file = config.sops.secrets.rustic-vps-pass.path;
options = {
root = label;
bucket = "rustic-backups";
region = "de-fra";
endpoint = "https://c5c0.fra2.idrivee2-53.com";
};
2023-12-23 01:26:18 +03:00
};
repository.options = {
2024-01-19 17:58:20 +03:00
timeout = "5min";
retry = "10";
2023-12-23 01:26:18 +03:00
};
backup = {
2024-01-12 23:52:30 +03:00
host = config.device;
2023-12-23 01:26:18 +03:00
label = label;
ignore-devid = true;
2024-01-19 17:58:20 +03:00
group-by = "label";
skip-identical-parent = true;
2023-12-23 01:26:18 +03:00
sources = [{
2024-02-01 22:48:57 +03:00
source = "/srv/marzban";
2023-12-23 01:26:18 +03:00
}];
};
forget = {
filter-label = [ label ];
2024-01-19 17:58:20 +03:00
group-by = "label";
2023-12-23 01:26:18 +03:00
prune = true;
2024-01-19 17:58:20 +03:00
keep-daily = 4;
2024-01-12 23:52:30 +03:00
keep-weekly = 2;
keep-monthly = 1;
2023-12-23 01:26:18 +03:00
};
};
};
vps-prune = vps-backup // {
backup = false;
prune = true;
createWrapper = false;
timerConfig = {
2024-01-19 17:58:20 +03:00
OnCalendar = "Mon, 02:00";
2023-12-23 01:26:18 +03:00
Persistent = true;
};
};
};
}