Skip to content

Commit

Permalink
nixos/synergy: Restart services on failure.
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
aszlig committed Oct 13, 2015
1 parent 2a1bf2a commit e4caf0f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions nixos/modules/services/misc/synergy.nix
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ in
wantedBy = optional cfgC.autoStart "multi-user.target";
path = [ pkgs.synergy ];
serviceConfig.ExecStart = ''${pkgs.synergy}/bin/synergyc -f ${optionalString (cfgC.screenName != "") "-n ${cfgC.screenName}"} ${cfgC.serverAddress}'';
serviceConfig.Restart = "on-failure";
};
})
(mkIf cfgS.enable {
Expand All @@ -98,6 +99,7 @@ in
wantedBy = optional cfgS.autoStart "multi-user.target";
path = [ pkgs.synergy ];
serviceConfig.ExecStart = ''${pkgs.synergy}/bin/synergys -c ${cfgS.configFile} -f ${optionalString (cfgS.address != "") "-a ${cfgS.address}"} ${optionalString (cfgS.screenName != "") "-n ${cfgS.screenName}" }'';
serviceConfig.Restart = "on-failure";
};
})
];
Expand Down

0 comments on commit e4caf0f

Please sign in to comment.