aboutsummaryrefslogtreecommitdiff
path: root/modules/services/syncthing.nix
diff options
context:
space:
mode:
authorUtku Demir <me@utdemir.com>2017-07-17 08:10:15 +0000
committerRobert Helgesson <robert@rycee.net>2017-07-18 12:50:30 +0200
commitdd5061d73bacf62b56325d74efa9b261d3930bfd (patch)
treea094aabca387686e15529a90ab20e83f1676bf1c /modules/services/syncthing.nix
parent7a18a0fb348393a4d4cb9aaff39626d63351edc3 (diff)
Add syncthing service
Diffstat (limited to 'modules/services/syncthing.nix')
-rw-r--r--modules/services/syncthing.nix28
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";
+ };
+ };
+ };
+}