Only sync(thing) over tailscale

This commit is contained in:
SebastianStork 2025-03-18 01:20:44 +01:00
parent f71c958316
commit d8226d7eb1

View file

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