Syncthing: Difference between revisions
m Add note about forwarding web GUI with SSH |
Configuration can be partly in Nix and the rest in the GUI |
||
| Line 1: | Line 1: | ||
Syncthing is a decentralized file | Syncthing is a decentralized file synchronization service. You can use it to safely sync all files in a folder between different desktops/servers. In other Linux distributions you configure it via its own web-GUI. In NixOS you can partly or fully configure it using Nix. | ||
== Install == | == Install == | ||
Syncthing is available as a standalone package: <code>nix-env -iA nixos.syncthing</code> | Syncthing is available as a standalone package: <code>nix-env -iA nixos.syncthing</code> | ||
| Line 67: | Line 67: | ||
</syntaxHighlight> | </syntaxHighlight> | ||
It is also a good idea to protect the web GUI with a username and password | It is also a good idea to protect the web GUI with a username and password: | ||
<syntaxHighlight lang="nix"> | <syntaxHighlight lang="nix"> | ||
services.syncthing.settings.gui = { | services.syncthing.settings.gui = { | ||
| Line 100: | Line 100: | ||
== Disable default sync folder == | == Disable default sync folder == | ||
Syncthing creates a | 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: | ||
<syntaxhighlight lang="nix">systemd.services.syncthing.environment.STNODEFAULTFOLDER = "true"; # Don't create default ~/Sync folder</syntaxhighlight> | |||
== Home-manager service == | == Home-manager service == | ||