72 lines
2.2 KiB
Nix
Raw Normal View History

2024-01-19 17:58:20 +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-nas-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-11-16 03:45:22 +03:00
nas-backup = {
backup = true;
prune = false;
initialize = false;
environmentFile = config.sops.secrets.rustic-backups-s3-env.path;
2024-01-19 17:58:20 +03:00
extraEnvironment = { https_proxy = "http://192.168.0.6:8888"; };
pruneOpts = [ "--repack-cacheable-only=false" ];
2023-11-16 03:45:22 +03:00
timerConfig = {
OnCalendar = "05:00";
Persistent = true;
};
2024-01-19 17:58:20 +03:00
settings = let
label = "hypervisor-nas";
in {
2023-11-16 03:45:22 +03:00
repository = {
repository = "opendal:s3";
2024-01-19 17:58:20 +03:00
password-file = config.sops.secrets.rustic-nas-pass.path;
options = {
root = label;
bucket = "rustic-backups";
region = "de-fra";
endpoint = "https://c5c0.fra2.idrivee2-53.com";
};
2023-11-16 03:45:22 +03:00
};
backup = {
2024-01-12 23:52:30 +03:00
host = config.device;
2023-11-24 00:17:53 +03:00
label = label;
2023-11-16 03:45:22 +03:00
ignore-devid = true;
2024-01-19 17:58:20 +03:00
group-by = "label";
skip-identical-parent = true;
2023-11-16 03:45:22 +03:00
glob = [
"!/media/nas/**/cache"
"!/media/nas/**/.cache"
"!/media/nas/**/log"
"!/media/nas/**/logs"
"!/media/nas/media-stack/configs/lidarr/config/MediaCover"
"!/media/nas/media-stack/configs/qbittorrent/downloads"
"!/media/nas/media-stack/configs/recyclarr/repositories"
"!/srv/gitea"
2023-12-18 02:08:29 +03:00
"!/srv/wiki"
2023-11-16 03:45:22 +03:00
];
sources = [{
source = "/srv /media/nas/containers /media/nas/media-stack/configs";
}];
};
forget = {
2023-11-24 00:17:53 +03:00
filter-label = [ label ];
2024-01-19 17:58:20 +03:00
group-by = "label";
2023-11-16 03:45:22 +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;
2024-01-19 17:58:20 +03:00
keep-monthly = 0;
2023-11-16 03:45:22 +03:00
};
};
};
nas-prune = nas-backup // {
backup = false;
prune = true;
2023-11-24 00:17:53 +03:00
createWrapper = false;
2023-11-16 03:45:22 +03:00
timerConfig = {
2024-01-19 17:58:20 +03:00
OnCalendar = "Mon, 06:00";
2023-11-16 03:45:22 +03:00
Persistent = true;
};
2023-11-11 03:14:37 +03:00
};
};
}