From 16f67637ba6a27cb61e2f334afc6050114073369 Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Mon, 8 Oct 2018 23:24:36 +0200 Subject: nixos/syncthing: move configuration to condigDir fixes #47513 following the upstream recommended settings: https://github.com/syncthing/syncthing/issues/3434#issuecomment-235401876 --- nixos/doc/manual/release-notes/rl-1903.xml | 10 ++++++++++ nixos/modules/services/networking/syncthing.nix | 14 +++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) (limited to 'nixos') 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} ''; }; }; -- cgit 1.4.1