From a5bab6cae2c4465318f38c3b7f87f4d017268540 Mon Sep 17 00:00:00 2001 From: Ingolf Wagner Date: Tue, 1 Feb 2022 16:20:41 +0100 Subject: [PATCH] update borg backup --- nixos/configs/pepe/syncthing.nix | 1 - nixos/configs/robi/borg.nix | 20 ++++++++++---------- nixos/configs/robi/configuration.nix | 9 +++++++-- nixos/configs/robi/syncthing.nix | 21 --------------------- nixos/system/all/borg-jobs.nix | 4 ++++ 5 files changed, 21 insertions(+), 34 deletions(-) diff --git a/nixos/configs/pepe/syncthing.nix b/nixos/configs/pepe/syncthing.nix index 4599731..573170f 100644 --- a/nixos/configs/pepe/syncthing.nix +++ b/nixos/configs/pepe/syncthing.nix @@ -111,7 +111,6 @@ after = [ "media.mount" ]; }; - backup.dirs = [ config.services.syncthing.folders.finance.path ]; diff --git a/nixos/configs/robi/borg.nix b/nixos/configs/robi/borg.nix index 156d753..09106e4 100644 --- a/nixos/configs/robi/borg.nix +++ b/nixos/configs/robi/borg.nix @@ -1,15 +1,15 @@ { lib, config, pkgs, ... }: { - #services.borgbackup.repos = { - # default = { - # quota = "100G"; - # allowSubRepos = true; - # authorizedKeys = [ - # (lib.fileContents ../../assets/ssh/borg_access.pub) - # (lib.fileContents ../../assets/ssh/card_rsa.pub) - # ]; - # }; - #}; + services.borgbackup.repos = { + default = { + quota = "300G"; + allowSubRepos = true; + authorizedKeys = [ + (lib.fileContents ../../assets/ssh/borg_access.pub) + (lib.fileContents ../../assets/ssh/card_rsa.pub) + ]; + }; + }; # mirror backup folder to /media #systemd.services.borg-mirror-to-media = { diff --git a/nixos/configs/robi/configuration.nix b/nixos/configs/robi/configuration.nix index 18ab159..d7cb6e3 100644 --- a/nixos/configs/robi/configuration.nix +++ b/nixos/configs/robi/configuration.nix @@ -8,11 +8,11 @@ ../../system/all/sshd-known-hosts-public.nix ../../system/all/syncthing.nix ../../system/all/tinc.nix - ../../system/server/netdata.nix ./hetzner.nix + ./borg.nix ./codimd.nix ./gitea.nix ./grocy.nix @@ -29,7 +29,6 @@ #./hardware-configuration.nix #./mail-fetcher.nix - #./borg.nix #./finance.nix #./grafana.nix #./graylog.nix @@ -75,6 +74,12 @@ fsType = "ext4"; }; + fileSystems."/var/lib/borgbackup" = + { + device = "/dev/vg/borg"; + fsType = "ext4"; + }; + fileSystems."/media" = { device = "/dev/vg/media"; diff --git a/nixos/configs/robi/syncthing.nix b/nixos/configs/robi/syncthing.nix index ff224d6..aa679b3 100644 --- a/nixos/configs/robi/syncthing.nix +++ b/nixos/configs/robi/syncthing.nix @@ -20,25 +20,6 @@ folders = { - # on encrypted hard drive - # ----------------------- - #private = { - # enable = true; - # path = "/home/syncthing/private"; - #}; - #desktop = { - # enable = true; - # path = "/home/syncthing/desktop"; - #}; - #finance = { - # enable = true; - # path = "/home/syncthing/finance"; - #}; - #fotos = { - # enable = true; - # path = "/home/syncthing/fotos"; - #}; - # on media hard drive (not encrypted) # ----------------------------------- #borg-mirror = { @@ -107,6 +88,4 @@ after = [ "media.mount" ]; }; - #backup.dirs = [ "/home/syncthing/finance" ]; - } diff --git a/nixos/system/all/borg-jobs.nix b/nixos/system/all/borg-jobs.nix index 7a38cc8..10a01b6 100644 --- a/nixos/system/all/borg-jobs.nix +++ b/nixos/system/all/borg-jobs.nix @@ -29,6 +29,10 @@ let servers = [ + { + name = "robi"; + host = "144.76.13.147"; + } { name = "pepe"; host = "pepe.private";