From 02cf7054827258d30d3e2b3dcd0bc6b4433e0e02 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 15 Aug 2024 14:48:50 -0400 Subject: [PATCH] thelio76: setup syncthing --- config/hosts/thelio76/default.nix | 6 +++ config/modules/system76-pc.nix | 64 ++++++++++++++++--------------- 2 files changed, 40 insertions(+), 30 deletions(-) diff --git a/config/hosts/thelio76/default.nix b/config/hosts/thelio76/default.nix index 0d96bd9..6e19803 100644 --- a/config/hosts/thelio76/default.nix +++ b/config/hosts/thelio76/default.nix @@ -106,6 +106,12 @@ allowedTCPPorts = [ 8081 # for expo android ]; + allowedTCPPortRanges = [ + { from = 1714; to = 1764; } # KDE Connect + ]; + allowedUDPPortRanges = [ + { from = 1714; to = 1764; } # KDE Connect + ]; }; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking diff --git a/config/modules/system76-pc.nix b/config/modules/system76-pc.nix index dd6d009..b4e6468 100644 --- a/config/modules/system76-pc.nix +++ b/config/modules/system76-pc.nix @@ -94,36 +94,40 @@ }; # Enable Syncthing - # service.syncthing = { - # enable = true; - # dataDir = "/home/alex"; - # openDefaultPorts = true; - # configDir = "/home/alex/.config/syncthing"; - # user = "alex"; - # group = "users"; - # guiAddress = "127.0.0.1:8384"; - # declarative = { - # overrideDevices = true; - # overrideFolders = true; - # devices = { - # "laptop" = { id = "REALLY-LONG-LAPTOP-SYNCTHING-KEY-HERE"; }; - # "coredns-server" = { id = "REALLY-LONG-COREDNS-SERVER-SYNCTHING-KEY-HERE"; }; - # }; - # folders = { - # "code" = { - # path = "/home/alex/code"; - # devices = [ "laptop" ]; - # versioning = { - # type = "staggered"; - # params = { - # cleanInterval = "3600"; - # maxAge = "15768000"; - # }; - # }; - # }; - # }; - # }; - # }; + services.syncthing = { + enable = true; + dataDir = "/home/alex"; + openDefaultPorts = true; + configDir = "/home/alex/.config/syncthing"; + user = "alex"; + group = "users"; + guiAddress = "127.0.0.1:8384"; + settings = { + overrideDevices = true; + overrideFolders = true; + devices = { + "atauno" = { id = "TXSURD2-XCKOLDG-DJ76OOK-JZXOE3Q-XXTNOIM-XR5LB2B-YWBV2ER-6KRFIQN"; }; + "iphone15" = { id = "2K2CIOJ-KAV5QM6-BOYO6LX-HTK2BHM-4TFFST4-2VMSRBB-ZFML6VT-WOL5NAX"; }; + "nixos76" = { id = "------"; }; + "oneplus8t" = { id = "JIYG5UP-UHTO7KA-FDSIGQV-ON7YJXO-3JDAUNV-V6NJMCH-HWNOPBS-MXHHLAG"; }; + "thelio76" = { id = "PZGASVL-XWQRFHI-MD2YC2I-UAJIR5B-KC34AA7-3BXN322-2IB7AO4-JPYIQAD"; }; + }; + folders = { + "vaults" = { + id = "bbqnm-caya2"; + path = "/home/alex/Git/obsidian-vaults"; + devices = [ "atauno" "iphone15" "oneplus8t" ]; + versioning = { + type = "staggered"; + params = { + cleanInterval = "3600"; + maxAge = "15768000"; + }; + }; + }; + }; + }; + }; # Define a user account. Don't forget to set a password with ‘passwd’. users.users.alex = {