nixos/synergy: Restart services on failure.
Synergy seems to get more and more unstable in recent versions, so we
might want to debug this properly. However, it makes sense to restart
the service nevertheless, because synergy is about keyboard and mouse
sharing and it's quite annoying to either SSH in to restart the service
or even needing to unplug the keyboard and plug in into the machine with
the failing service.
Signed-off-by: aszlig <aszlig@redmoonstudios.org>
commite4caf0fde09146000f4b7b0c29413a059704d9c3
authoraszlig <aszlig@redmoonstudios.org>
dateTue 13 Oct 2015, 02:46 (11 years ago)
parent2a1bf2a
nixos/modules/services/misc/synergy.nix+2
@@ -89,6 +89,7 @@ in
8989 wantedBy = optional cfgC.autoStart "multi-user.target";
9090 path = [ pkgs.synergy ];
9191 serviceConfig.ExecStart = ''${pkgs.synergy}/bin/synergyc -f ${optionalString (cfgC.screenName != "") "-n ${cfgC.screenName}"} ${cfgC.serverAddress}'';
92+ serviceConfig.Restart = "on-failure";
9293 };
9394 })
9495 (mkIf cfgS.enable {
@@ -98,6 +99,7 @@ in
9899 wantedBy = optional cfgS.autoStart "multi-user.target";
99100 path = [ pkgs.synergy ];
100101 serviceConfig.ExecStart = ''${pkgs.synergy}/bin/synergys -c ${cfgS.configFile} -f ${optionalString (cfgS.address != "") "-a ${cfgS.address}"} ${optionalString (cfgS.screenName != "") "-n ${cfgS.screenName}" }'';
102+ serviceConfig.Restart = "on-failure";
101103 };
102104 })
103105 ];