about summary refs log tree commit diff
path: root/hosts/aptos
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2023-04-23 19:18:37 -0700
committerFranck Cuny <franck@fcuny.net>2023-04-29 15:07:03 -0700
commit0a964150707b9aa579dd5aa0962e90bfeea16c49 (patch)
tree1ef93ef5581d2bf872269b08f424e0c1ffad0a8d /hosts/aptos
parentmodules/restic: handle extra options and remove unused settings (diff)
downloadworld-0a964150707b9aa579dd5aa0962e90bfeea16c49.tar.gz
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.
Diffstat (limited to '')
-rw-r--r--hosts/aptos/services.nix24
1 files changed, 16 insertions, 8 deletions
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" ];
     };
   };
 }