From ddfff957b6cc1b147db79518b32e8bb48676bb90 Mon Sep 17 00:00:00 2001 From: Lilac Date: Mon, 31 Aug 2026 15:35:49 -0400 Subject: [PATCH] backups with restic integrated --- hosts/backup/default.nix | 12 ++++++++++++ hosts/desktop/default.nix | 10 ++++++++++ 2 files changed, 22 insertions(+) diff --git a/hosts/backup/default.nix b/hosts/backup/default.nix index e29d007..e200ad8 100644 --- a/hosts/backup/default.nix +++ b/hosts/backup/default.nix @@ -94,4 +94,16 @@ networking = { nixpkgs.config.allowUnfree = true; nix.settings.experimental-features = [ "nix-command" "flakes" ]; system.stateVersion = "26.05"; + + + + services.restic.server = { + enable = true; + listenAddress = "10.0.0.4:8000"; + dataDir = "/var/lib/restic"; + appendOnly = true; + extraFlags = [ "--no-auth" ]; + }; + + networking.firewall.interfaces.wg0.allowedTCPPorts = [ 8000 ]; } diff --git a/hosts/desktop/default.nix b/hosts/desktop/default.nix index c2b8296..e07fdaa 100644 --- a/hosts/desktop/default.nix +++ b/hosts/desktop/default.nix @@ -103,6 +103,7 @@ whipper flac tor-browser + restic ]; programs.steam.enable = true; @@ -130,4 +131,13 @@ nixpkgs.config.allowUnfree = true; nix.settings.experimental-features = [ "nix-command" "flakes" ]; system.stateVersion = "26.05"; + + services.restic.backups.backup = { + repository = "rest:http://10.0.0.4:8000/backup"; + initialize = true; + passwordFile = "/home/lilac/test-password"; + paths = [ "/var/lib/immich" "/var/lib/music" "/var/lib/gitea" ]; + timerConfig.OnCalendar = "03:30"; + pruneOpts = [ "--keep-daily 7" "--keep-weekly 4" "--keep-monthly 12" ]; + }; }