From b832ea4f294d378809c28b40b1913424c224530e Mon Sep 17 00:00:00 2001 From: sefidel Date: Tue, 1 Aug 2023 21:49:57 +0900 Subject: feat(nixos/alpha): use borg backup --- nixos/alpha/configuration.nix | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'nixos/alpha/configuration.nix') diff --git a/nixos/alpha/configuration.nix b/nixos/alpha/configuration.nix index 7e685d5..4c12ee9 100644 --- a/nixos/alpha/configuration.nix +++ b/nixos/alpha/configuration.nix @@ -105,6 +105,30 @@ } ]; + sops.secrets.borg-alpha-rolling-pass = { }; + services.borgbackup.jobs.alpha-rolling = { + paths = [ + "/persist" + "/home" + ]; + + exclude = [ + # Rust build files + "**/target" + ]; + repo = "20963@hk-s020.rsync.net:rolling/alpha"; + encryption.mode = "repokey-blake2"; + encryption.passCommand = "cat ${config.sops.secrets.borg-alpha-rolling-pass.path}"; + + environment.BORG_RSH = "ssh -i /persist/ssh/ssh_host_ed25519_key"; + # use borg 1.0+ on rsync.net + environment.BORG_REMOTE_PATH="/usr/local/bin/borg1/borg1"; + extraCreateArgs = "--verbose --stats --checkpoint-interval 600"; + compression = "auto,zstd"; + startAt = "daily"; + persistentTimer = true; + }; + sound.enable = false; services.pipewire = { -- cgit 1.4.1