about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorBen Wolsieffer <benwolsieffer@gmail.com>2023-12-11 20:41:16 -0500
committerBen Wolsieffer <benwolsieffer@gmail.com>2023-12-11 20:52:37 -0500
commitded54623986c89efa4d6c8e3d95d9f35babd0337 (patch)
tree863f366a93b7869ef0aca0c2a2c3b5598bfc3cb5 /nixos
parentd6a0fea30ee3921729a2d62611cd7f097f4d0409 (diff)
nixos/syncthing: add databaseDir option
#264753 mistakenly used the dataDir option to set the -data argument.
This broke existing configurations because -data used to be set to
configDir (implicitly, using the -home option, which is equivalent to
setting -config and -data to the same value).

Fix this by introducing a new databaseDir option sets -data and defaults
to configDir. This maintains the existing behavior by default while
still allowing users to specify separate config and database
directories.
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/networking/syncthing.nix11
1 files changed, 10 insertions, 1 deletions
diff --git a/nixos/modules/services/networking/syncthing.nix b/nixos/modules/services/networking/syncthing.nix
index 99d4d9eeffcc6..e0425792431e6 100644
--- a/nixos/modules/services/networking/syncthing.nix
+++ b/nixos/modules/services/networking/syncthing.nix
@@ -559,6 +559,15 @@ in {
         '';
       };
 
+      databaseDir = mkOption {
+        type = types.path;
+        description = lib.mdDoc ''
+          The directory containing the database and logs.
+        '';
+        default = cfg.configDir;
+        defaultText = literalExpression "config.${opt.configDir}";
+      };
+
       extraFlags = mkOption {
         type = types.listOf types.str;
         default = [];
@@ -660,7 +669,7 @@ in {
               -no-browser \
               -gui-address=${if isUnixGui then "unix://" else ""}${cfg.guiAddress} \
               -config=${cfg.configDir} \
-              -data=${cfg.dataDir} \
+              -data=${cfg.databaseDir} \
               ${escapeShellArgs cfg.extraFlags}
           '';
           MemoryDenyWriteExecute = true;