{ config, pkgs, lib, ... }: let cfg = config.my.services.syncthing; secrets = config.age.secrets; in { options.my.services.syncthing = with lib; { enable = mkEnableOption "syncthing service"; }; config = lib.mkIf cfg.enable { services.syncthing = { enable = true; openDefaultPorts = true; user = "fcuny"; group = "users"; dataDir = "/home/fcuny/.local/state/syncthing"; cert = secrets."syncthing/cert".path; key = secrets."syncthing/key".path; folders.Sync = { path = "/home/fcuny/documents"; devices = attrNames config.services.syncthing.devices; }; devices = { aptos = { id = "JAN5UMH-2FAQQ7S-KLQ2YXM-C7KKK7U-HVHUK7I-CWOZQRM-VLQSO63-ZTP4WAN"; introducer = false; }; tahoe = { id = "4Y36C3Y-LUTO6LD-JXNV73B-FLXSTNP-5Q3CSPY-HESHTPH-EDYA54K-WEICJAJ"; introducer = true; }; }; }; }; }