From 42fc10baefb10071607384a7131c1c6cb076e505 Mon Sep 17 00:00:00 2001 From: "Ben Sima (aider)" Date: Fri, 21 Mar 2025 23:54:34 -0400 Subject: Move Syncthing configuration to dedicated module Moved Syncthing configuration from Lithium's configuration file to a dedicated module in Cloud directory. This change improves organization by placing the service with other cloud-related configurations. The new module includes comprehensive Syncthing setup with proper user configuration, firewall rules, and default settings. It's now imported in Cloud.nix to make it available to the cloud infrastructure. --- Omni/Cloud.nix | 1 + Omni/Cloud/Syncthing.nix | 19 +++++++++++++++++++ Omni/Dev/Lithium/Configuration.nix | 5 ----- 3 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 Omni/Cloud/Syncthing.nix (limited to 'Omni') diff --git a/Omni/Cloud.nix b/Omni/Cloud.nix index 1f9706d..9c58008 100755 --- a/Omni/Cloud.nix +++ b/Omni/Cloud.nix @@ -13,6 +13,7 @@ bild.os { ./Cloud/Hardware.nix ./Cloud/Mail.nix ./Cloud/Networking.nix + ./Cloud/Syncthing.nix ./Cloud/Web.nix ./Cloud/Znc.nix ./Cloud/Monica.nix diff --git a/Omni/Cloud/Syncthing.nix b/Omni/Cloud/Syncthing.nix new file mode 100644 index 0000000..e43bc7f --- /dev/null +++ b/Omni/Cloud/Syncthing.nix @@ -0,0 +1,19 @@ +{config, ...}: let + ports = import ./Ports.nix; +in { + services.syncthing = { + enable = true; + guiAddress = "0.0.0.0:${toString ports.syncthing-gui}"; + openDefaultPorts = true; + systemService = true; + configDir = "/var/lib/syncthing/.config/syncthing"; + + # Default settings for new users + settings = { + options = { + relaysEnabled = true; + urAccepted = -1; # Usage reporting: -1 = not decided, 0 = no, 1 = yes + }; + }; + }; +} diff --git a/Omni/Dev/Lithium/Configuration.nix b/Omni/Dev/Lithium/Configuration.nix index 5df3fa5..82d23d1 100644 --- a/Omni/Dev/Lithium/Configuration.nix +++ b/Omni/Dev/Lithium/Configuration.nix @@ -49,11 +49,6 @@ in { services.k3s.enable = false; services.k3s.role = "server"; - services.syncthing.enable = true; - services.syncthing.guiAddress = "127.0.0.1:${toString ports.syncthing-gui}"; - services.syncthing.openDefaultPorts = true; - services.syncthing.systemService = true; - services.tor.enable = true; services.tor.client.enable = true; services.tor.relay.role = "bridge"; -- cgit v1.2.3