From 28820da6cc5d1dc8fe68f53d10e771538923a78a Mon Sep 17 00:00:00 2001 From: FredzyW Date: Wed, 26 Jun 2024 08:47:53 +0200 Subject: [PATCH] Added work laptop to syncthing --- maskiner/desktop/configuration.nix | 2 +- maskiner/jobb/configuration.nix | 28 ++++++++++++++++++++++++++++ maskiner/laptop/configuration.nix | 2 +- 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/maskiner/desktop/configuration.nix b/maskiner/desktop/configuration.nix index 96be0ca..0ec86cc 100644 --- a/maskiner/desktop/configuration.nix +++ b/maskiner/desktop/configuration.nix @@ -53,7 +53,7 @@ networking.firewall = { settings = { devices = { "laptop" = { id = "2VEN7O3-PB3G2MK-XJI7R5Z-6MHTNN2-WMXERIX-6G7QWSK-VKSWOSH-Q5WFDAI"; }; - # "device2" = { id = "DEVICE-ID-GOES-HERE"; }; + "jobb" = { id = "XRKVC74-UNJDQSW-4G3RHC3-5I4W5UT-D2MRMBZ-R4A4MMT-4XB4W47-LFLFBAV"; }; }; folders = { "Documents" = { # Name of folder in Syncthing, also the folder ID diff --git a/maskiner/jobb/configuration.nix b/maskiner/jobb/configuration.nix index c3e3f3c..2d56b82 100644 --- a/maskiner/jobb/configuration.nix +++ b/maskiner/jobb/configuration.nix @@ -16,6 +16,34 @@ ]; networking.hostName = myhostname; + networking.firewall = { + enable = true; + allowedTCPPorts = [ 80 443 8384 22000]; + }; + networking.firewall.allowedUDPPorts = [ 22000 21027 ]; + services = { + 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 = { + "desktop" = { id = "BGEQVAA-JZM7DQB-7NFEDQ6-K7Q3HQL-P6OSNJ2-TMA3N7B-E6RP3HQ-OAMWJQL"; }; + "laptop" = { id = "2VEN7O3-PB3G2MK-XJI7R5Z-6MHTNN2-WMXERIX-6G7QWSK-VKSWOSH-Q5WFDAI"; }; + }; + folders = { + "Documents" = { # Name of folder in Syncthing, also the folder ID + path = "/home/fw/docs"; # Which folder to add to Syncthing + devices = [ "desktop" ]; # Which devices to share the folder with + }; + }; + }; + }; + }; services.xserver.dpi = 140; diff --git a/maskiner/laptop/configuration.nix b/maskiner/laptop/configuration.nix index 481625b..7209f41 100644 --- a/maskiner/laptop/configuration.nix +++ b/maskiner/laptop/configuration.nix @@ -30,7 +30,7 @@ settings = { devices = { "desktop" = { id = "BGEQVAA-JZM7DQB-7NFEDQ6-K7Q3HQL-P6OSNJ2-TMA3N7B-E6RP3HQ-OAMWJQL"; }; - # "device2" = { id = "DEVICE-ID-GOES-HERE"; }; + "jobb" = { id = "XRKVC74-UNJDQSW-4G3RHC3-5I4W5UT-D2MRMBZ-R4A4MMT-4XB4W47-LFLFBAV"; }; }; folders = { "Documents" = { # Name of folder in Syncthing, also the folder ID