Commit 1682fa46fb24

Vincent Demeester <vincent@sbr.pm>
2026-01-27 18:45:39
feat(syncthing): add staggered versioning for org folder
- Protect org files from accidental overwrites with 6-month history - Enable versioning passthrough in syncthing folder configuration Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent 45d70b3
Changed files (2)
lib/functions.nix
@@ -233,6 +233,8 @@ let
         rescanIntervalS = 3600 * 6; # TODO: make it configurable
         # Apply default ignores if not specified in globals
         ignores = folders."${name}".ignores or defaultIgnores;
+        # Pass through versioning configuration if present
+        versioning = folders."${name}".versioning or null;
       }
     ) (lib.attrsets.attrByPath [ "syncthing" "folders" ] { } machine);
 
globals.nix
@@ -22,6 +22,13 @@ _: {
     org = {
       id = "sjpsr-xfwdu";
       path = "/home/vincent/desktop/org";
+      versioning = {
+        type = "staggered";
+        params = {
+          cleanInterval = "3600"; # cleanup every hour
+          maxAge = "15768000"; # keep for ~6 months (182 days in seconds)
+        };
+      };
     };
     screenshots = {
       id = "prpsz-azlz9";