diff options
author | Karel Kočí <cynerd@email.cz> | 2024-10-17 15:37:56 +0200 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2024-10-17 15:37:56 +0200 |
commit | 846e847fee79cc54b0ad5284020f46ecd79ded21 (patch) | |
tree | 2ed8067ce13186b52d3f5ab22e0377ad079b0376 /nixos/configurations | |
parent | 0662c2dc1955b07f64f641edecfb2278e10dd3f1 (diff) | |
download | nixos-personal-846e847fee79cc54b0ad5284020f46ecd79ded21.tar.gz nixos-personal-846e847fee79cc54b0ad5284020f46ecd79ded21.tar.bz2 nixos-personal-846e847fee79cc54b0ad5284020f46ecd79ded21.zip |
nixos/backup: add backup configuration
Diffstat (limited to 'nixos/configurations')
-rw-r--r-- | nixos/configurations/errol.nix | 6 | ||||
-rw-r--r-- | nixos/configurations/lipwig.nix | 26 | ||||
-rw-r--r-- | nixos/configurations/ridcully.nix | 6 |
3 files changed, 37 insertions, 1 deletions
diff --git a/nixos/configurations/errol.nix b/nixos/configurations/errol.nix index fd348e8..407cf82 100644 --- a/nixos/configurations/errol.nix +++ b/nixos/configurations/errol.nix @@ -26,6 +26,7 @@ in { "encroot" = "/dev/disk/by-uuid/7c412ae6-6016-45af-8c2a-8fcc394dbbe6"; "enchdd1" = "/dev/disk/by-uuid/87f16080-5ff6-43dd-89f3-307455a46fbe"; "enchdd2" = "/dev/disk/by-uuid/be4a33fa-8bc6-431d-a3ac-787668f223ed"; + #"encback" = "/dev/disk/by-uuid/1bd8c637-f71e-4fb0-96de-b660c4f1afaf"; }; fileSystems = { "/" = { @@ -53,6 +54,11 @@ in { fsType = "btrfs"; options = ["compress=lzo" "subvol=@home"]; }; + #"/back" = { + # device = "/dev/mapper/encback"; + # fsType = "btrfs"; + # options = ["compress=lzo"]; + #}; }; services.btrfs.autoScrub = { enable = true; 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"; diff --git a/nixos/configurations/ridcully.nix b/nixos/configurations/ridcully.nix index 2be1a7a..ff3b5a0 100644 --- a/nixos/configurations/ridcully.nix +++ b/nixos/configurations/ridcully.nix @@ -26,6 +26,7 @@ in { cynerd.autounlock = { "encroot" = "/dev/disk/by-uuid/bc7d2ba4-6e04-4c49-b40c-3aecd1a86c71"; "enchdd" = "/dev/disk/by-uuid/7fee3cda-efa0-47cd-8832-fdead9a7e6db"; + "encback" = "/dev/disk/by-uuid/b426cbe7-fba2-473b-90f9-9ebe3e34b76e"; }; fileSystems = { "/" = { @@ -48,6 +49,11 @@ in { fsType = "btrfs"; options = ["compress=lzo" "subvol=@home"]; }; + "/back" = { + device = "/dev/mapper/encback"; + fsType = "btrfs"; + options = ["compress=lzo"]; + }; }; services.btrfs.autoScrub = { enable = true; |