nix-config/modules/restic/default.nix

40 lines
999 B
Nix

{ inputs, ... }:
{
flake.modules.nixos.restic =
{ pkgs, config, ... }:
{
# Root SSH for storage box
programs.ssh = {
extraConfig = ''
Host dnsc-storage
AddKeysToAgent yes
Hostname u295965.your-storagebox.de
User u295965
IdentityFile /root/.ssh/id_ed25519
IdentitiesOnly yes
Port 23
'';
};
services.restic.backups = {
"dnsc-storage" = {
initialize = true;
passwordFile = config.age.secrets."restic/password".path;
repository = "sftp:dnsc-storage:restic/dnsc-server";
createWrapper = true;
paths = [
"/main/share"
"/data/actual-server"
];
pruneOpts = [
"--keep-last 3"
];
timerConfig = {
OnCalendar = "daily";
Persistent = true;
RandomizedDelaySec = "5h";
};
};
};
};
}