From 465a66ab3f5b571ff39381647c1113063f9b86dc Mon Sep 17 00:00:00 2001 From: Marc Weber Date: Sun, 16 Mar 2008 15:52:52 +0000 Subject: [PATCH] renamed newProposal directory added two example jobs svn path=/nixos/trunk/; revision=11146 --- upstart-jobs/default.nix | 4 +- upstart-jobs/new-proposal/synergyc.nix | 31 ++++++++++++ upstart-jobs/new-proposal/synergys.nix | 69 ++++++++++++++++++++++++++ 3 files changed, 102 insertions(+), 2 deletions(-) create mode 100644 upstart-jobs/new-proposal/synergyc.nix create mode 100644 upstart-jobs/new-proposal/synergys.nix 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 + +*/