mirror of
https://github.com/phfroidmont/self-hosting.git
synced 2025-12-25 05:36:59 +01:00
Backup hcloud instances with borg
This commit is contained in:
parent
59cb6ac9b9
commit
292619386b
6 changed files with 87 additions and 6 deletions
12
flake.nix
12
flake.nix
|
|
@ -27,10 +27,16 @@
|
|||
system = "x86_64-linux";
|
||||
modules = common.modules ++ [
|
||||
./modules/postgresql.nix
|
||||
./modules/custom-backup-job.nix
|
||||
({
|
||||
networking.hostName = "db1";
|
||||
networking.domain = "banditlair.com";
|
||||
networking.firewall.interfaces."enp7s0".allowedTCPPorts = [ 5432 ];
|
||||
services.custom-backup-job = {
|
||||
additionalReadWritePaths = [ "/nix/var/data/postgresql" ];
|
||||
additionalPreHook = "${pkgs.postgresql_12}/bin/pg_dump -U synapse synapse > /nix/var/data/postgresql/synapse.dmp";
|
||||
startAt = "03:00";
|
||||
};
|
||||
})
|
||||
];
|
||||
};
|
||||
|
|
@ -39,11 +45,17 @@
|
|||
modules = common.modules ++ [
|
||||
./modules/murmur.nix
|
||||
./modules/synapse.nix
|
||||
./modules/custom-backup-job.nix
|
||||
({
|
||||
networking.hostName = "backend1";
|
||||
networking.domain = "banditlair.com";
|
||||
networking.firewall.allowedTCPPorts = [ 80 443 64738 ];
|
||||
networking.firewall.allowedUDPPorts = [ 64738 ];
|
||||
services.custom-backup-job = {
|
||||
additionalReadWritePaths = [ "/nix/var/data/murmur" ];
|
||||
additionalPreHook = "cp /var/lib/murmur/murmur.sqlite /nix/var/data/murmur/murmur.sqlite";
|
||||
startAt = "03:30";
|
||||
};
|
||||
})
|
||||
];
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue