DRY backups

This commit is contained in:
Daniel Flanagan 2023-11-01 13:01:56 -05:00
parent c5b6f2b62b
commit 30ae0e0969
Signed by: lytedev
GPG key ID: 5B2020A0F9921EF4

View file

@ -607,48 +607,49 @@ sudo nix run nixpkgs#ipmitool -- raw 0x30 0x30 0x02 0xff 0x00
# TODO: move previous backups over and put here # TODO: move previous backups over and put here
# clickhouse and plausible analytics once they're up and running? # clickhouse and plausible analytics once they're up and running?
services.restic.backups = rec { services.restic.backups = let
local = { defaults = {
initialize = true;
passwordFile = "/root/restic-localbackup-password"; passwordFile = "/root/restic-localbackup-password";
paths = [ paths = [
"/storage/files.lyte.dev" "/storage/files.lyte.dev"
"/storage/daniel" "/storage/daniel"
"/storage/gitea" # TODO: should maybe use configuration.nix's services.gitea.dump ? "/storage/gitea" # TODO: should maybe use configuration.nix's services.gitea.dump ?
"/var/lib/bitwarden_rs" # does this need any sqlite preprocessing? "/storage/postgres-backups"
# https://github.com/dani-garcia/vaultwarden/wiki/Backing-up-your-vault # https://github.com/dani-garcia/vaultwarden/wiki/Backing-up-your-vault
# specifically, https://github.com/dani-garcia/vaultwarden/wiki/Backing-up-your-vault#sqlite-database-files # specifically, https://github.com/dani-garcia/vaultwarden/wiki/Backing-up-your-vault#sqlite-database-files
# TODO: backup lidarr/radarr configs? "/var/lib/bitwarden_rs" # does this need any sqlite preprocessing?
"/storage/postgres-backups" # TODO: backup *arr configs?
]; ];
initialize = true;
exclude = []; exclude = [];
timerConfig = {
OnCalendar = "04:45";
};
};
in {
local =
defaults
// {
repository = "/storage/backups/local"; repository = "/storage/backups/local";
}; };
rascal = { rascal =
initialize = true; defaults
// {
extraOptions = [ extraOptions = [
"sftp.command='ssh beefcake@rascal -i /root/.ssh/id_ed25519 -s sftp'" "sftp.command='ssh beefcake@rascal -i /root/.ssh/id_ed25519 -s sftp'"
]; ];
passwordFile = local.passwordFile;
paths = local.paths;
repository = "sftp://beefcake@rascal://storage/backups/beefcake"; repository = "sftp://beefcake@rascal://storage/backups/beefcake";
timerConfig = {
OnCalendar = "04:45";
};
}; };
# TODO: add ruby? # TODO: add ruby?
benland = { benland =
initialize = true; defaults
// {
extraOptions = [ extraOptions = [
"sftp.command='ssh daniel@n.benhaney.com -p 10022 -i /root/.ssh/id_ed25519 -s sftp'" "sftp.command='ssh daniel@n.benhaney.com -p 10022 -i /root/.ssh/id_ed25519 -s sftp'"
]; ];
passwordFile = local.passwordFile;
paths = local.paths;
repository = "sftp://daniel@n.benhaney.com://storage/backups/beefcake"; repository = "sftp://daniel@n.benhaney.com://storage/backups/beefcake";
timerConfig = {
OnCalendar = "04:45";
};
}; };
}; };