flake/nixos/profiles/restic/default.nix

28 lines
739 B
Nix
Raw Permalink Normal View History

2024-10-02 07:26:28 +00:00
{ lib, config, ... }:
2024-09-22 08:31:23 +00:00
{
2024-10-02 07:26:28 +00:00
sops.secrets = lib.mapAttrs (_n: v: v // { sopsFile = ./secrets.yaml; }) {
2024-09-22 08:31:23 +00:00
"restic/environment" = { };
"restic/password" = { };
"restic/repository" = { };
};
services.restic.backups.persist = {
environmentFile = config.sops.secrets."restic/environment".path;
passwordFile = config.sops.secrets."restic/password".path;
repositoryFile = config.sops.secrets."restic/repository".path;
paths = [ "/persist" ];
extraBackupArgs = [
"--one-file-system"
"--exclude-caches"
"--no-scan"
"--retry-lock 2h"
];
timerConfig = {
OnCalendar = "daily";
RandomizedDelaySec = "4h";
FixedRandomDelay = true;
Persistent = true;
};
};
}