From 68f0ed58c16a83dfed8d17101d7cc27e83de78c3 Mon Sep 17 00:00:00 2001 From: Utku Demir Date: Mon, 17 Jul 2017 08:10:15 +0000 Subject: [PATCH] Add syncthing service (cherry picked from commit dd5061d73bacf62b56325d74efa9b261d3930bfd) --- modules/default.nix | 1 + modules/services/syncthing.nix | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 modules/services/syncthing.nix diff --git a/modules/default.nix b/modules/default.nix index 107aab0d2..9cc55afe0 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -31,6 +31,7 @@ let ./services/network-manager-applet.nix ./services/random-background.nix ./services/redshift.nix + ./services/syncthing.nix ./services/taffybar.nix ./services/tahoe-lafs.nix ./services/udiskie.nix diff --git a/modules/services/syncthing.nix b/modules/services/syncthing.nix new file mode 100644 index 000000000..3a6bf023e --- /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"; + }; + }; + }; +}