diff options
| -rw-r--r-- | flake.nix | 1 | ||||
| -rw-r--r-- | machines/ettves/backup.nix | 47 | ||||
| -rw-r--r-- | machines/ettves/default.nix | 2 | ||||
| m--------- | secrets | 0 |
4 files changed, 49 insertions, 1 deletions
@@ -88,6 +88,7 @@ (import ./machines/ettves) inputs.authentik-nix.nixosModules.default zfs + backup teamspeak postgresql quassel diff --git a/machines/ettves/backup.nix b/machines/ettves/backup.nix new file mode 100644 index 0000000..03c381d --- /dev/null +++ b/machines/ettves/backup.nix @@ -0,0 +1,47 @@ +{ config, ... }: + +{ + services.kopia = { + enable = true; + instances = { + b2 = { + enable = true; + environmentFile = config.secrets.b2.dest; + repository.b2.bucket = "ettves-vapor-systems"; + + snapshots = { + schedule = "daily"; + paths = [ + # Game Servers + "/var/lib/private/factorio" + "/var/lib/satisfactory" + "/var/lib/minecraft" + "/var/lib/minecraft_mods" + "/var/lib/acc-server/cfg" + + # Others + "/var/lib/git" + "/var/lib/teamspeak6-server" + ]; + }; + + policy = [{ + retention = { + keepLatest = 5; + keepDaily = 30; + keepWeekly = 4; + keepMonthly = 3; + keepAnnual = 0; + }; + }]; + }; + }; + }; + + secrets = { + b2 = { + source = ../../secrets/backup/ettves.vapor.systems.env; + dest = "/etc/secrets/b2.env"; + }; + }; +} diff --git a/machines/ettves/default.nix b/machines/ettves/default.nix index 549990a..dc90eb7 100644 --- a/machines/ettves/default.nix +++ b/machines/ettves/default.nix @@ -2,7 +2,7 @@ let endpoint = "195.201.245.25"; in { - imports = [ ./fs.nix ]; + imports = [ ./fs.nix ./backup.nix ]; boot.initrd.availableKernelModules = [ "ahci" "nvme" ]; boot.kernelModules = [ "kvm-amd" ]; diff --git a/secrets b/secrets -Subproject ba100958ff3b2295e812a2bd1e8f14e3db0d06c +Subproject bb6cfb47fc1e1d26444fb93ecfe03868bc74462 |
