summary refs log tree commit diff
path: root/nixos/modules/services/networking
diff options
context:
space:
mode:
authorJakub Sokołowski <jakub@status.im>2021-08-29 11:20:02 +0200
committerJakub Sokołowski <jakub@status.im>2021-08-29 12:26:06 +0200
commit972a3654888f23f67caefa817889a0033d88a755 (patch)
tree4715eb898315a4c4100adf9cc23825cf066f07bd /nixos/modules/services/networking
parentb991f1e4483a2356b351d97dcaafe7bfc9822331 (diff)
downloadnixpkgs-972a3654888f23f67caefa817889a0033d88a755.tar
nixpkgs-972a3654888f23f67caefa817889a0033d88a755.tar.gz
nixpkgs-972a3654888f23f67caefa817889a0033d88a755.tar.bz2
nixpkgs-972a3654888f23f67caefa817889a0033d88a755.tar.lz
nixpkgs-972a3654888f23f67caefa817889a0033d88a755.tar.xz
nixpkgs-972a3654888f23f67caefa817889a0033d88a755.tar.zst
nixpkgs-972a3654888f23f67caefa817889a0033d88a755.zip
syncthing: add extraFlags option that adjust service
This is useful for situations in which you might want to reset certain
things using `--reset-database` or `--reset-deltas` or debug certain
things using any of the debug options like `--debug-perf-stats`.

Signed-off-by: Jakub Sokołowski <jakub@status.im>
Diffstat (limited to 'nixos/modules/services/networking')
-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 2efb7a9ed93..d7756270149 100644
--- a/nixos/modules/services/networking/syncthing.nix
+++ b/nixos/modules/services/networking/syncthing.nix
@@ -434,6 +434,15 @@ in {
         defaultText = literalExample "dataDir${optionalString cond " + \"/.config/syncthing\""}";
       };
 
+      extraFlags = mkOption {
+        type = types.listOf types.str;
+        default = [];
+        example = [ "--reset-deltas" ];
+        description = ''
+          Extra flags passed to the syncthing command in the service definition.
+        '';
+      };
+
       openDefaultPorts = mkOption {
         type = types.bool;
         default = false;
@@ -526,7 +535,7 @@ in {
             ${cfg.package}/bin/syncthing \
               -no-browser \
               -gui-address=${cfg.guiAddress} \
-              -home=${cfg.configDir}
+              -home=${cfg.configDir} ${escapeShellArgs cfg.extraFlags}
           '';
           MemoryDenyWriteExecute = true;
           NoNewPrivileges = true;