aboutsummaryrefslogtreecommitdiff
path: root/modules/storage/syncthing.nix
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2025-06-13 15:02:58 +0530
committerAkshay Nair <phenax5@gmail.com>2025-06-13 15:02:58 +0530
commitfb3c68a676643e60e396daf4076684e12d157677 (patch)
tree16a6ee14a9d745079e99a066ad30efda1f947e72 /modules/storage/syncthing.nix
parente6b171f9f1d975ffe34e7a34743b5e92e8593847 (diff)
downloadhomeserver-nixos-config-fb3c68a676643e60e396daf4076684e12d157677.tar.gz
homeserver-nixos-config-fb3c68a676643e60e396daf4076684e12d157677.zip
Syncthing + service router refactor
Diffstat (limited to 'modules/storage/syncthing.nix')
-rw-r--r--modules/storage/syncthing.nix44
1 files changed, 44 insertions, 0 deletions
diff --git a/modules/storage/syncthing.nix b/modules/storage/syncthing.nix
new file mode 100644
index 0000000..5291182
--- /dev/null
+++ b/modules/storage/syncthing.nix
@@ -0,0 +1,44 @@
+{ lib, ... }:
+let
+ settings = import ../../settings.nix { inherit lib; };
+ group = "syncthing";
+in
+{
+ systemd.tmpfiles.rules = [
+ "d ${settings.syncthing.baseDir} 0770 - ${group} - -"
+ "d ${settings.syncthing.photosDir} 0770 - ${group} - -"
+ ];
+ users.groups.${group} = { };
+ users.users.bacchus.extraGroups = [ group ];
+
+ networking.firewall.allowedTCPPorts = [ settings.network.ports.syncthing ];
+
+ services.syncthing = {
+ enable = true;
+ user = "bacchus";
+ group = group;
+ dataDir = settings.syncthing.baseDir;
+ guiAddress = "0.0.0.0:${toString settings.network.ports.syncthing}";
+ overrideFolders = true;
+
+ settings = {
+ folders = {
+ artemis-photos = {
+ label = "Photos";
+ path = settings.syncthing.photosDir;
+ };
+ };
+
+ options.urAccepted = -1;
+
+ extraOptions = {
+ gui = {
+ enabled = true;
+ theme = "black";
+ user = settings.syncthing.username;
+ password = settings.syncthing.password;
+ };
+ };
+ };
+ };
+}