Files
nix-dotfiles-v2/modules/restic-client.nix
T

65 lines
1.2 KiB
Nix

{
config,
lib,
...
}:
{
sops.secrets."restic/repository" = {
mode = "0400";
restartUnits = [ "restic-backups-main.service" ];
};
sops.secrets."restic/repo_password" = {
mode = "0400";
restartUnits = [ "restic-backups-main.service" ];
};
services.restic.backups.main = {
initialize = true;
repositoryFile = config.sops.secrets."restic/repository".path;
passwordFile = config.sops.secrets."restic/repo_password".path;
paths = lib.mkDefault [
"/var/lib"
"/var/backups"
"/home/gunalx"
];
exclude = [
".cache"
"__pycache__"
"*.pyc"
"*.pyo"
".pytest_cache"
".mypy_cache"
".ruff_cache"
"node_modules"
".cargo"
".rustup"
".platformio"
".ipython"
".config"
".gitconfig"
".bashrc"
".bash_history"
".zsh_history"
".atuin"
".history.db*"
".tmp"
"*.tmp"
"*.swp"
".Trash-*"
"Trash"
".zcompdump*"
".nix-defexpr"
".steam"
".SteamCloud"
"Steam"
"/var/lib/containers"
".local/share/containers"
];
timerConfig = {
OnCalendar = "daily";
Persistent = true;
};
};
}