aboutsummaryrefslogtreecommitdiff
path: root/nixos/configurations/lipwig.nix
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2024-10-17 15:37:56 +0200
committerKarel Kočí <cynerd@email.cz>2024-10-17 15:37:56 +0200
commit846e847fee79cc54b0ad5284020f46ecd79ded21 (patch)
tree2ed8067ce13186b52d3f5ab22e0377ad079b0376 /nixos/configurations/lipwig.nix
parent0662c2dc1955b07f64f641edecfb2278e10dd3f1 (diff)
downloadnixos-personal-846e847fee79cc54b0ad5284020f46ecd79ded21.tar.gz
nixos-personal-846e847fee79cc54b0ad5284020f46ecd79ded21.tar.bz2
nixos-personal-846e847fee79cc54b0ad5284020f46ecd79ded21.zip
nixos/backup: add backup configuration
Diffstat (limited to 'nixos/configurations/lipwig.nix')
-rw-r--r--nixos/configurations/lipwig.nix26
1 files changed, 25 insertions, 1 deletions
diff --git a/nixos/configurations/lipwig.nix b/nixos/configurations/lipwig.nix
index 7d00a37..167f1a3 100644
--- a/nixos/configurations/lipwig.nix
+++ b/nixos/configurations/lipwig.nix
@@ -25,6 +25,31 @@
};
wireguard = true;
openvpn.oldpersonal = true;
+ borgjobs = {
+ postgresql = {
+ preHook = ''
+ /run/current-system/sw/bin/nextcloud-occ maintenance:mode --on
+ '';
+ dumpCommand = pkgs.writeScript "postgreqsl-backup.sh" ''
+ /run/wrappers/bin/sudo -u postgres /run/current-system/sw/bin/pg_dumpall
+ '';
+ postHook = ''
+ /run/current-system/sw/bin/nextcloud-occ maintenance:mode --off
+ '';
+ };
+ nextcloud_data = {
+ preHook = ''
+ /run/current-system/sw/bin/nextcloud-occ maintenance:mode --on
+ '';
+ paths = "/nas/nextcloud/data";
+ postHook = ''
+ /run/current-system/sw/bin/nextcloud-occ maintenance:mode --off
+ '';
+ };
+ sync_data = {
+ paths = "/nas/sync";
+ };
+ };
};
boot.loader.systemd-boot.enable = false;
@@ -200,7 +225,6 @@
adminpassFile = "/run/secrets/nextcloud.admin.pass";
dbtype = "pgsql";
dbhost = "/run/postgresql";
- dbtableprefix = "oc_";
};
settings = {
#log_type = "systemd";