diff --git a/modules/system/syncthing.nix b/modules/system/syncthing.nix index 0779d0d..4306921 100644 --- a/modules/system/syncthing.nix +++ b/modules/system/syncthing.nix @@ -3,9 +3,10 @@ options.myConfig.syncthing.enable = lib.mkEnableOption ""; config = lib.mkIf config.myConfig.syncthing.enable { + networking.firewall.interfaces.tailscale0.allowedTCPPorts = [ 22000 ]; + services.syncthing = { enable = true; - openDefaultPorts = true; user = "seb"; group = "users"; @@ -13,8 +14,14 @@ settings = { devices = { - fern.id = "Q4YPD3V-GXZPHSN-PT5X4PU-FBG4GX2-IASBX75-7NYMG75-4EJHBMZ-4WGDDAP"; - north.id = "FAJS5WM-UAWGW2U-FXCGPSP-VAUOTGM-XUKSEES-D66PMCJ-WBODJLV-XTNCRA7"; + fern = { + id = "Q4YPD3V-GXZPHSN-PT5X4PU-FBG4GX2-IASBX75-7NYMG75-4EJHBMZ-4WGDDAP"; + addresses = [ "tcp://fern.${config.networking.domain}:22000" ]; + }; + north = { + id = "FAJS5WM-UAWGW2U-FXCGPSP-VAUOTGM-XUKSEES-D66PMCJ-WBODJLV-XTNCRA7"; + addresses = [ "tcp://north.${config.networking.domain}:22000" ]; + }; }; folders = @@ -24,10 +31,7 @@ lib.genAttrs folders (name: { path = "~/${name}"; ignorePerms = false; - devices = [ - "fern" - "north" - ]; + devices = lib.attrNames config.services.syncthing.settings.devices; }); in genFolders [ @@ -38,6 +42,15 @@ "Projects" "Videos" ]; + + options = { + globalAnnounceEnabled = false; + localAnnounceEnabled = false; + relaysEnabled = false; + natEnabled = false; + urAccepted = -1; + autoUpgradeIntervalH = 0; + }; }; }; };