{ 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; }; }; }