diff --git a/upstart-jobs/default.nix b/upstart-jobs/default.nix index 09ecf3d6b546..9e2b8281fd89 100644 --- a/upstart-jobs/default.nix +++ b/upstart-jobs/default.nix @@ -26,8 +26,8 @@ let services = getAttr [ "servicesProposal" ] {} config; nameToJobs = name : ( ( - let p = ./newProposal + "/${name}.nix"; - p2 = ./newProposal + "/${name}/default.nix"; + let p = ./new-proposal + "/${name}.nix"; + p2 = ./new-proposal + "/${name}/default.nix"; thisConfig = getAttr [ name ] {} services; path = [name]; args = confgiV : { diff --git a/upstart-jobs/new-proposal/synergyc.nix b/upstart-jobs/new-proposal/synergyc.nix new file mode 100644 index 000000000000..bc880dbdc2c2 --- /dev/null +++ b/upstart-jobs/new-proposal/synergyc.nix @@ -0,0 +1,31 @@ +{ path, thisConfig, config, lib, pkgs, upstartHelpers } : with upstartHelpers; { + options = { + description = "synergy client lets you use a shared keyboard, mouse and clipboard"; + screenName = mkOption { + default = ""; + description = " + use screen-name instead the hostname to identify + ourselfs to the server. + "; + apply = x: "-n '${x}'"; + }; + address = mkOption { + default = ""; + description = "server address to connect to"; + }; + }; + jobs = [ ( rec { + name = "synergyc"; + + # TODO start only when X Server has started as well + job = " +description \"${name}\" + +start on network-interfaces/started +stop on network-interfaces/stop + +exec ${pkgs.synergy}/bin/synergyc -f ${configV "adress"} ${configV "screenName"} + "; + +} ) ]; +} diff --git a/upstart-jobs/new-proposal/synergys.nix b/upstart-jobs/new-proposal/synergys.nix new file mode 100644 index 000000000000..8c320a07d6f0 --- /dev/null +++ b/upstart-jobs/new-proposal/synergys.nix @@ -0,0 +1,69 @@ +{ path, thisConfig, config, lib, pkgs, upstartHelpers } : with upstartHelpers; { + options = { + description = "synergy client lets you use a shared keyboard, mouse and clipboard"; + + configuration = mkOption { + description = " + The synergy server configuration file + "; + }; + screenName = mkOption { + default = ""; + description = " + use screen-name instead the hostname to identify + this screen in the configuration. + "; + apply = x: "-n '${x}'"; + }; + address = mkOption { + default = ""; + description = "listen for clients on the given address"; + apply = x: "-a '${x}'"; + }; + }; + + jobs = + [ ( rec { + name = "synergys"; + + extraEtc = [ (autoGeneratedEtcFile { name = name + ".conf"; content = thisConfig.configuration; }) ]; + + # TODO start only when X Server has started as well + job = " +description \"${name}\" + +start on network-interfaces/started and xserver/started +stop on network-interfaces/stop or xserver/stop + +exec ${pkgs.synergy}/bin/synergys -c /etc/${name}.conf -f ${configV "address"} ${configV "screenName"} + "; + +} ) ]; +} + +/* Example configuration + +section: screens + laptop: + dm: + win: +end +section: aliases + laptop: + 192.168.5.5 + dm: + 192.168.5.78 + win: + 192.168.5.54 +end +section: links + laptop: + left = dm + dm: + right = laptop + left = win + win: + right = dm +end + +*/