From 9b7de0b4e01408f01067dc4ddb356231bc382e8b Mon Sep 17 00:00:00 2001 From: FredzyW Date: Tue, 25 Jun 2024 18:01:58 +0200 Subject: [PATCH] Syncthin --- config/base.nix | 6 ------ maskiner/desktop/configuration.nix | 25 ++++++++++++++++++++++++- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/config/base.nix b/config/base.nix index dc90952..aea7616 100644 --- a/config/base.nix +++ b/config/base.nix @@ -120,12 +120,6 @@ services = { - syncthing = { - enable = true; - user = "fw"; - dataDir = "/home/fw/docs"; # Default folder for new synced folders - configDir = "/home/fw/.config/syncthing"; # Folder for Syncthing's settings and keys - }; openssh = { enable = true; }; diff --git a/maskiner/desktop/configuration.nix b/maskiner/desktop/configuration.nix index a93858f..4c7fe19 100644 --- a/maskiner/desktop/configuration.nix +++ b/maskiner/desktop/configuration.nix @@ -21,12 +21,14 @@ ]; networking.firewall = { enable = true; - allowedTCPPorts = [ 80 443 ]; + allowedTCPPorts = [ 80 443 8384 22000]; allowedUDPPortRanges = [ { from = 4000; to = 4007; } { from = 8000; to = 8010; } ]; }; + networking.firewall.allowedUDPPorts = [ 22000 21027 ]; + services = { openssh = { enable = true; @@ -40,6 +42,27 @@ networking.firewall = { AllowUsers fw ios ''; }; + syncthing = { + enable = true; + user = "fw"; + dataDir = "/home/fw/syncthing"; + configDir = "/home/fw/.config/syncthing"; + overrideDevices = true; # overrides any devices added or deleted through the WebUI + overrideFolders = true; # overrides any folders added or deleted through the WebUI + guiAddress = "0.0.0.0:8384"; + settings = { + devices = { + # "device1" = { id = "DEVICE-ID-GOES-HERE"; }; + # "device2" = { id = "DEVICE-ID-GOES-HERE"; }; + }; + folders = { + "Documents" = { # Name of folder in Syncthing, also the folder ID + path = "/home/fw/docs"; # Which folder to add to Syncthing + # devices = [ "device1" "device2" ]; # Which devices to share the folder with + }; + }; + }; + }; };