From 0a964150707b9aa579dd5aa0962e90bfeea16c49 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Sun, 23 Apr 2023 19:18:37 -0700 Subject: hosts/aptos: configure backups properly Configure correctly the systemd unit to run restic on aptos. Be more specific about the paths we want to backup, instead of backing up '/home' and maintaining a large exclusion list. --- hosts/aptos/services.nix | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'hosts/aptos') diff --git a/hosts/aptos/services.nix b/hosts/aptos/services.nix index 1168dc2..3bb56b2 100644 --- a/hosts/aptos/services.nix +++ b/hosts/aptos/services.nix @@ -1,5 +1,7 @@ { config, ... }: -let secrets = config.age.secrets; +let + secrets = config.age.secrets; + ssh-key-path = secrets."restic/ssh-key".path; in { my.services = { @@ -22,20 +24,26 @@ in backup = { enable = true; - user = "fcuny"; - repository = "sftp:192.168.6.40:/"; + repository = "sftp:192.168.6.40:/aptos"; exclude = [ - "/home/fcuny/.cache" - "/home/fcuny/downloads" - "/home/fcuny/workspace/linux.git" + # paths that I don't want to backup "/home/fcuny/workspace/tmp" + + # various development related files + "**/target" + "**/.direnv" + "**/result" ]; timerConfig = { OnCalendar = "06:30"; }; passwordFile = secrets."restic/repo-users".path; extraOptions = [ - "sftp.command='ssh fcunybackup@192.168.6.40 -i ${secrets.restic/ssh-key.path} -s sftp'" + "sftp.command='ssh backup@192.168.6.40 -i ${ssh-key-path} -s sftp'" + ]; + paths = [ + "/home/fcuny/workspace" + "/home/fcuny/media" + "/home/fcuny/documents" ]; - paths = [ "/home/fcuny" ]; }; }; } -- cgit 1.4.1