From cc2adb3aa803350b9fb6ae9f041f19b96a2feee3 Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Mon, 5 May 2025 17:26:44 +1000 Subject: [PATCH] services/syncthing: use tmpfile rules to create data directories --- modules/services/syncthing.nix | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/modules/services/syncthing.nix b/modules/services/syncthing.nix index 4586d84..2316f9f 100644 --- a/modules/services/syncthing.nix +++ b/modules/services/syncthing.nix @@ -1,4 +1,14 @@ -{ ... }: { +{ config, ... }: +let + dir = "/persist/shared/.syncthing"; + uid = toString config.users.users.rin.uid; + gid = toString config.users.groups.users.gid; +in +{ + systemd.tmpfiles.rules = [ + "d ${dir}/config 700 ${uid} ${gid}" + "d ${dir}/data 700 ${uid} ${gid}" + ]; systemd.services.syncthing.environment.STNODEFAULTFOLDER = "true"; services.syncthing = { enable = true; @@ -7,16 +17,5 @@ group = "users"; dataDir = "/persist/shared/.syncthing/data"; configDir = "/persist/shared/.syncthing/config"; - settings = { - devices = { - #"anemone".id = ""; - }; - # folders = { - # "Obby" = { - # path = "/home/rin/Documents/Obby/Obby"; - # devices = []; - # }; - # }; - }; }; }