diff --git a/nixos/doc/manual/release-notes/rl-1903.xml b/nixos/doc/manual/release-notes/rl-1903.xml
index 163819194ecf..29520a0188db 100644
--- a/nixos/doc/manual/release-notes/rl-1903.xml
+++ b/nixos/doc/manual/release-notes/rl-1903.xml
@@ -97,6 +97,16 @@
start org.nixos.nix-daemon.
+
+
+ The Syncthing state and configuration data has been moved from
+ services.syncthing.dataDir to the newly defined
+ services.syncthing.configDir, which default to
+ /var/lib/syncthing/.config/syncthing.
+ This change makes possible to share synced directories using ACLs
+ without Syncthing resetting the permission on every start.
+
+
diff --git a/nixos/modules/services/networking/syncthing.nix b/nixos/modules/services/networking/syncthing.nix
index fd31b2a67687..b2ef1885a955 100644
--- a/nixos/modules/services/networking/syncthing.nix
+++ b/nixos/modules/services/networking/syncthing.nix
@@ -62,9 +62,21 @@ in {
dataDir = mkOption {
type = types.path;
default = "/var/lib/syncthing";
+ description = ''
+ Path where synced directories will exist.
+ '';
+ };
+
+ configDir = mkOption {
+ type = types.path;
description = ''
Path where the settings and keys will exist.
'';
+ default =
+ let
+ nixos = config.system.stateVersion;
+ cond = versionAtLeast nixos "19.03";
+ in cfg.dataDir + (optionalString cond "/.config/syncthing");
};
openDefaultPorts = mkOption {
@@ -144,7 +156,7 @@ in {
${cfg.package}/bin/syncthing \
-no-browser \
-gui-address=${cfg.guiAddress} \
- -home=${cfg.dataDir}
+ -home=${cfg.configDir}
'';
};
};