Move backup to Hetzner's storage box

This commit is contained in:
Paul-Henri Froidmont 2023-04-22 02:46:55 +02:00
parent 8c4e559348
commit ff0abf6309
Signed by: phfroidmont
GPG key ID: BE948AFD7E7873BE
4 changed files with 32 additions and 18 deletions

View file

@ -1,5 +1,4 @@
{ config, lib, pkgs, ... }:
{
{ config, lib, pkgs, ... }: {
imports = [
../environment.nix
../hardware/hcloud.nix
@ -8,7 +7,10 @@
../modules/monitoring-exporters.nix
];
networking.firewall.interfaces."eth1".allowedTCPPorts = [ config.services.prometheus.exporters.node.port config.services.postgresql.port ];
networking.firewall.interfaces."eth1".allowedTCPPorts = [
config.services.prometheus.exporters.node.port
config.services.postgresql.port
];
sops.secrets = {
borgSshKey = {
@ -20,6 +22,7 @@
custom = {
services.backup-job = {
enable = true;
repoName = "db1";
readWritePaths = [ "/nix/var/data/postgresql" "/nix/var/data/backup/" ];
preHook = ''
${pkgs.postgresql_12}/bin/pg_dump -U synapse synapse > /nix/var/data/postgresql/synapse.dmp