MyNixOS website logo
option

services.syncthing.settings.folders.<name>.versioning

How to keep changed/deleted files with Syncthing. There are 4 different types of versioning with different parameters. See https://docs.syncthing.net/users/versioning.html.

Declarations
Type
null or (JSON value)
Default
null
Example
[
  {
    versioning = {
      type = "simple";
      params.keep = "10";
    };
  }
  {
    versioning = {
      type = "trashcan";
      params.cleanoutDays = "1000";
    };
  }
  {
    versioning = {
      type = "staggered";
      fsPath = "/syncthing/backup";
      params = {
        cleanInterval = "3600";
        maxAge = "31536000";
      };
    };
  }
  {
    versioning = {
      type = "external";
      params.versionsPath = pkgs.writers.writeBash "backup" ''
        folderpath="$1"
        filepath="$2"
        rm -rf "$folderpath/$filepath"
      '';
    };
  }
]