about summary refs log tree commit diff stats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--hm/soispha/conf/unison/default.nix21
1 files changed, 21 insertions, 0 deletions
diff --git a/hm/soispha/conf/unison/default.nix b/hm/soispha/conf/unison/default.nix
index 13535cb7..dee32d8e 100644
--- a/hm/soispha/conf/unison/default.nix
+++ b/hm/soispha/conf/unison/default.nix
@@ -15,6 +15,18 @@
     auto = "true";
     # This is useless, with hm links
     links = "false";
+
+    backupdir = "${unisonPath}/backups";
+    backuploc = "central";
+    backupcurr = paths_to_merge;
+    merge =
+      builtins.map (x: ''${x} -> diff3 -m CURRENT1 CURRENTARCH CURRENT2 > NEW || echo "differences detected"'')
+      paths_to_merge;
+  };
+
+  paths_to_merge = mkPathName {
+    file_names = [];
+    extensions = ["history"];
   };
 
   paths_to_keep = [
@@ -47,6 +59,15 @@
     then "tiamat"
     else builtins.throw "Host (${hn}) not yet covered in the unison host mapping.";
 
+  mkPathName = {
+    file_names,
+    extensions,
+  }:
+    builtins.map (x: ''Name ${x}'') (
+      (builtins.map (x: ''*.${x}'') file_names)
+      ++ extensions
+    );
+
   unitName = name: builtins.replaceStrings ["/"] ["-"] name;
 
   mkPath = path: