Syncthing: Difference between revisions

Pigs (talk | contribs)
m Fix typo in category
Disable default sync folder: Simplify code by using command-line argument instead of env var
 
Line 142: Line 142:
=== Disable default sync folder ===
=== Disable default sync folder ===


Syncthing creates a 'Sync' folder in your home directory every time it regenerates a configuration, even if your declarative configuration does not have this folder. You can disable that by setting the STNODEFAULTFOLDER environment variable:
Syncthing creates a 'Sync' folder in your home directory every time it regenerates a configuration, even if your declarative configuration does not have this folder. You can disable that by using the <code>--no-default-folder</code> command-line option<ref>https://docs.syncthing.net/users/syncthing.html#cmdoption-no-default-folder</ref>:
<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
systemd.services.syncthing.environment.STNODEFAULTFOLDER = "true"; # Don't create default ~/Sync folder
services.syncthing.extraFlags = [ "--no-default-folder" ]; # Don't create default ~/Sync folder
</syntaxhighlight>
</syntaxhighlight>