{ config, lib, username, ... }: let cfg = config.os.srv.syncthing; in { options.os.srv.syncthing.enable = lib.mkEnableOption "enables syncthing syncing"; config = lib.mkIf cfg.enable { services.syncthing = { enable = true; user = "${username}"; dataDir = "/home/${username}/.local/share/syncthing"; configDir = "/home/${username}/.config/syncthing"; guiPasswordFile = "/run/secrets/syncthing/gui_password"; settings = { devices = { "desktop" = { id = "YGMWGOB-LTJUDM7-CY25MAF-NPE7J4J-KYRNPB5-ZHD5DBI-VNRAXI6-LIP2DQP"; }; "laptop" = { id = ""; }; "thinkpad" = { id = ""; }; }; folders = { "game-saves" = { path = "/home/${username}/.saves"; id = "shared-saves-v1"; devices = [ "desktop" "laptop" "thinkpad" ]; versioning = { type = "staggered"; params = { cleanInterval = "3600"; maxAge = "2592000"; }; }; }; }; }; }; }; }