diff options
author | Utku Demir <me@utdemir.com> | 2017-07-17 08:10:15 +0000 |
---|---|---|
committer | Robert Helgesson <robert@rycee.net> | 2017-07-18 12:50:30 +0200 |
commit | dd5061d73bacf62b56325d74efa9b261d3930bfd (patch) | |
tree | a094aabca387686e15529a90ab20e83f1676bf1c /modules/services/syncthing.nix | |
parent | 7a18a0fb348393a4d4cb9aaff39626d63351edc3 (diff) |
Add syncthing service
Diffstat (limited to 'modules/services/syncthing.nix')
-rw-r--r-- | modules/services/syncthing.nix | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/modules/services/syncthing.nix b/modules/services/syncthing.nix new file mode 100644 index 00000000000..3a6bf023e86 --- /dev/null +++ b/modules/services/syncthing.nix @@ -0,0 +1,28 @@ +{ config, lib, pkgs, ... }: + +with lib; + +{ + options = { + services.syncthing = { + enable = mkEnableOption "Syncthing"; + }; + }; + + config = mkIf config.services.syncthing.enable { + systemd.user.services.syncthing = { + Unit = { + Description = "Syncthing"; + After = [ "network.target" ]; + }; + + Install = { + WantedBy = [ "default.target" ]; + }; + + Service = { + ExecStart = "${pkgs.syncthing}/bin/syncthing -no-browser"; + }; + }; + }; +} |