summary refs log tree commit diff
path: root/nixos/modules/services/networking
diff options
context:
space:
mode:
authorrnhmjoj <rnhmjoj@inventati.org>2018-10-08 23:24:36 +0200
committerrnhmjoj <rnhmjoj@inventati.org>2018-10-15 20:34:50 +0200
commit16f67637ba6a27cb61e2f334afc6050114073369 (patch)
treea3c15e3e920b53cb90702b76c6047909b1187c34 /nixos/modules/services/networking
parent01dfe3f56019b0c330bc2e46da90146698844330 (diff)
downloadnixlib-16f67637ba6a27cb61e2f334afc6050114073369.tar
nixlib-16f67637ba6a27cb61e2f334afc6050114073369.tar.gz
nixlib-16f67637ba6a27cb61e2f334afc6050114073369.tar.bz2
nixlib-16f67637ba6a27cb61e2f334afc6050114073369.tar.lz
nixlib-16f67637ba6a27cb61e2f334afc6050114073369.tar.xz
nixlib-16f67637ba6a27cb61e2f334afc6050114073369.tar.zst
nixlib-16f67637ba6a27cb61e2f334afc6050114073369.zip
nixos/syncthing: move configuration to condigDir
fixes #47513 following the upstream recommended settings:
https://github.com/syncthing/syncthing/issues/3434#issuecomment-235401876
Diffstat (limited to 'nixos/modules/services/networking')
-rw-r--r--nixos/modules/services/networking/syncthing.nix14
1 files changed, 13 insertions, 1 deletions
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
@@ -63,8 +63,20 @@ in {
         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}
           '';
         };
       };