aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/misc/news.nix10
-rw-r--r--modules/modules.nix1
-rw-r--r--modules/services/qsyncthingtray.nix29
-rw-r--r--modules/services/syncthing.nix67
4 files changed, 58 insertions, 49 deletions
diff --git a/modules/misc/news.nix b/modules/misc/news.nix
index 31ebe55262a..202ab915e30 100644
--- a/modules/misc/news.nix
+++ b/modules/misc/news.nix
@@ -1,4 +1,4 @@
-{ config, lib, pkgs, ... }:
+{ config, lib, options, pkgs, ... }:
with lib;
@@ -534,9 +534,13 @@ in
}
{
- time = "2018-01-20T10:36:12+00:00";
+ time = "2018-01-25T11:35:08+00:00";
+ condition = options.services.qsyncthingtray.enable.isDefined;
message = ''
- A new module is available: 'services.qsyncthingtray'
+ 'services.qsyncthingtray' has been merged into 'services.syncthing'.
+ Please, use 'services.syncthing.tray' option to activate the tray service.
+
+ The old module will be removed on February 25, 2018.
'';
}
];
diff --git a/modules/modules.nix b/modules/modules.nix
index 529350143f2..7fd76147b71 100644
--- a/modules/modules.nix
+++ b/modules/modules.nix
@@ -53,7 +53,6 @@ let
./services/owncloud-client.nix
./services/parcellite.nix
./services/polybar.nix
- ./services/qsyncthingtray.nix
./services/random-background.nix
./services/redshift.nix
./services/screen-locker.nix
diff --git a/modules/services/qsyncthingtray.nix b/modules/services/qsyncthingtray.nix
deleted file mode 100644
index fb9dc287389..00000000000
--- a/modules/services/qsyncthingtray.nix
+++ /dev/null
@@ -1,29 +0,0 @@
-{ config, lib, pkgs, ... }:
-
-with lib;
-
-{
- options = {
- services.qsyncthingtray = {
- enable = mkEnableOption "QSyncthingTray";
- };
- };
-
- config = mkIf config.services.qsyncthingtray.enable {
- systemd.user.services.qsyncthingtray = {
- Unit = {
- Description = "QSyncthingTray";
- After = [ "graphical-session-pre.target" ];
- PartOf = [ "graphical-session.target" ];
- };
-
- Install = {
- WantedBy = [ "graphical-session.target" ];
- };
-
- Service = {
- ExecStart = "${pkgs.qsyncthingtray}/bin/QSyncthingTray";
- };
- };
- };
-}
diff --git a/modules/services/syncthing.nix b/modules/services/syncthing.nix
index f722208d1a3..5b34d9aa5e1 100644
--- a/modules/services/syncthing.nix
+++ b/modules/services/syncthing.nix
@@ -3,32 +3,67 @@
with lib;
{
+ imports = [
+ (mkRenamedOptionModule
+ [ "services" "qsyncthingtray" "enable" ]
+ [ "services" "syncthing" "tray" ])
+ ];
+
meta.maintainers = [ maintainers.rycee ];
options = {
services.syncthing = {
enable = mkEnableOption "Syncthing continuous file synchronization";
+
+ tray = mkOption {
+ type = types.bool;
+ default = false;
+ description = "Whether to enable QSyncthingTray service.";
+ };
};
};
- config = mkIf config.services.syncthing.enable {
- systemd.user.services.syncthing = {
- Unit = {
- Description = "Syncthing - Open Source Continuous File Synchronization";
- Documentation = "man:syncthing(1)";
- After = [ "network.target" ];
- };
+ config = mkIf config.services.syncthing.enable (mkMerge [
+ {
+ systemd.user.services = {
+ syncthing = {
+ Unit = {
+ Description = "Syncthing - Open Source Continuous File Synchronization";
+ Documentation = "man:syncthing(1)";
+ After = [ "network.target" ];
+ };
- Service = {
- ExecStart = "${pkgs.syncthing}/bin/syncthing -no-browser -no-restart -logflags=0";
- Restart = "on-failure";
- SuccessExitStatus = [ 3 4 ];
- RestartForceExitStatus = [ 3 4 ];
+ Service = {
+ ExecStart = "${pkgs.syncthing}/bin/syncthing -no-browser -no-restart -logflags=0";
+ Restart = "on-failure";
+ SuccessExitStatus = [ 3 4 ];
+ RestartForceExitStatus = [ 3 4 ];
+ };
+
+ Install = {
+ WantedBy = [ "default.target" ];
+ };
+ };
};
+ }
+ (mkIf config.services.syncthing.tray {
+ systemd.user.services = {
+ qsyncthingtray = {
+ Unit = {
+ Description = "QSyncthingTray";
+ After = [ "graphical-session-pre.target" ];
+ PartOf = [ "graphical-session.target" ];
+ };
+
+ Service = {
+ ExecStart = "${pkgs.qsyncthingtray}/bin/QSyncthingTray";
+ };
- Install = {
- WantedBy = [ "default.target" ];
+ Install = {
+ WantedBy = [ "graphical-session.target" ];
+ };
+ };
};
- };
- };
+ })
+ ]);
}