{ config, lib, ... }:
let
  cfg = config.niriwm;
in
{
  config = lib.mkIf cfg.enable {
    services.syncthing = {
      enable = true;
      dataDir = "/home/${cfg.user}/.syncthing";
      openDefaultPorts = true;
      user = cfg.user;
    };
    systemd.services.syncthing.environment.STNODEFAULTFOLDER = "true";
  };
}
