From 8c5f0522e753669b0cec072574820057dcd51642 Mon Sep 17 00:00:00 2001 From: Marc Weber Date: Thu, 5 Mar 2009 17:11:40 +0000 Subject: [PATCH] removed new proposal jobs the fix-style branch makes them obsolete It was broken anyway. I'll readd synergy (client, server) jobs again later svn path=/nixos/branches/fix-style/; revision=14353 --- system/options.nix | 8 --- upstart-jobs/default.nix | 57 +---------------- upstart-jobs/new-proposal/synergyc.nix | 31 --------- upstart-jobs/new-proposal/synergys.nix | 69 -------------------- upstart-jobs/new-proposal/tightvnc.nix | 89 -------------------------- 5 files changed, 1 insertion(+), 253 deletions(-) delete mode 100644 upstart-jobs/new-proposal/synergyc.nix delete mode 100644 upstart-jobs/new-proposal/synergys.nix delete mode 100644 upstart-jobs/new-proposal/tightvnc.nix diff --git a/system/options.nix b/system/options.nix index 34ae64a3c51b..af2801c83d07 100644 --- a/system/options.nix +++ b/system/options.nix @@ -380,14 +380,6 @@ in "; }; - servicesProposal = { - # see upstart-jobs/default.nix - # the option declarations can be found in the upstart-jobs/newProposal/*.nix files - # one way to include the declarations here is adding kind of glob "*.nix" - # file function to builtins to get all jobs - # then the checking in upstart-jobs/default.nix can be removed again (together with passing arg optionDeclarations) - }; - services = { diff --git a/upstart-jobs/default.nix b/upstart-jobs/default.nix index ea5d8fcdbe02..39bc6b3b8493 100644 --- a/upstart-jobs/default.nix +++ b/upstart-jobs/default.nix @@ -71,63 +71,8 @@ let ++ config.boot.extraTTYs ++ [config.services.syslogd.tty]; - # looks for a job file foreach attr name found in services from config - # passes { thisConfig, config, pkgs } - # a job must return { options = {}; job =; } - # options is the same format as options.nix, but only contains documentation for this job - # TODO check validation - newProposalJobs = - ( - let - inherit (pkgs.lib) getAttr; - inherit (builtins) attrNames pathExists map; - services = getAttr [ "servicesProposal" ] {} config; - nameToJobs = name : ( - ( - let p = ./new-proposal + "/${name}.nix"; - p2 = ./new-proposal + "/${name}/default.nix"; - thisConfig = getAttr [ name ] {} services; - path = [name]; - args = confgiV : { - inherit config pkgs thisConfig path; - lib = pkgs.lib; - upstartHelpers = { # some useful functions - inherit configV; # the first time a error function is passed to get the option list - # the second time a function is passed getting the option for you automatically, - # either returning the default option or the user supplied value (the function apply is applied when given) - # maybe this is complicated, but easy to use (IMHO) - mkOption = pkgs.lib.mkOption; # the same function used in options.nix - autoGeneratedEtcFile = { name, commentChar ? "#", content } : - { source = pkgs.writeText name - ("${commentChar} nixos autogenerated etc file based on /etc/nixos/configuration.nix\n" + content); - target = name; - }; - }; - }; - jobFunc = if pathExists p - then import p - else if pathExists p2 then import p2 - else abort "service ${name} requested but there is no ${p}.nix or ${p}/default.nix file!"; - options = (jobFunc (args (abort "you can't use configV within options!"))).options; - errorWhere = name : "${name} of service ${builtins.toString path}"; - configV = name : if (__hasAttr name options ) then - let opt = (__getAttr name options ); # this config option description - in if (__hasAttr name thisConfig ) - then let v = (__getAttr name thisConfig); in if opt ? apply then opt.apply v else v - else if opt ? default then opt.default else abort "you need to specify the configuration option ${errorWhere name}" - else abort "unkown option ${errorWhere name}"; - checkConfig = config.environment.checkConfigurationOptions; - in # TODO: pass path to checker so it can show full path in the abort case - pkgs.checker ( (jobFunc (args configV)).jobs ) - checkConfig - options - thisConfig - - )); - in pkgs.lib.concatLists ( map nameToJobs (attrNames services))); - jobs = map makeJob - (newProposalJobs ++ [ + ([ # Syslogd. (import ../upstart-jobs/syslogd.nix { diff --git a/upstart-jobs/new-proposal/synergyc.nix b/upstart-jobs/new-proposal/synergyc.nix deleted file mode 100644 index 57da073cd75e..000000000000 --- a/upstart-jobs/new-proposal/synergyc.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ 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 "screenName"} ${configV "address"} - "; - -} ) ]; -} diff --git a/upstart-jobs/new-proposal/synergys.nix b/upstart-jobs/new-proposal/synergys.nix deleted file mode 100644 index 8c320a07d6f0..000000000000 --- a/upstart-jobs/new-proposal/synergys.nix +++ /dev/null @@ -1,69 +0,0 @@ -{ 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 - -*/ diff --git a/upstart-jobs/new-proposal/tightvnc.nix b/upstart-jobs/new-proposal/tightvnc.nix deleted file mode 100644 index 054828a5230a..000000000000 --- a/upstart-jobs/new-proposal/tightvnc.nix +++ /dev/null @@ -1,89 +0,0 @@ -{ path, thisConfig, config, lib, pkgs, upstartHelpers } : with upstartHelpers; rec { - options = { - description = "tightvnc vnc server (share virtual desktop over network"; - - geometry = mkOption { - default = "-geometry 800x600"; - example = "800x600"; - description = '' - size of virtual screen - ''; - apply = x : "-geometry '${x}'"; - }; - depth = mkOption { - default = "-depth 24"; - description = '' - use screen-name instead the hostname to identify - this screen in the configuration. - value must be something between 8 and 32 - ''; - apply = x: "-depth '${x}'"; - check = x: (__lessThan x 33) && (7 __lessThan x); # not yet used - }; - display = mkOption { - default = ":8"; - example = 8; - description = "display to use"; - apply = x: ":${builtins.toString x}"; - }; - authFile = mkOption { - default = "-auth /etc/tightvnc-pwd"; - description = '' - The file containing authentication passwords. - Can be created using vncpasswd - ''; - apply = x: "-auth '${x}'"; - check = __pathExists; - }; - httpPort = mkOption { - default = "-httpport 5900"; - example = 5901; - description = "http port to listen to (Java applet remote interface)"; - apply = x: "-httpport '${builtins.toString x}'"; - }; - desktopName = mkOption { - description = '' - Set VNC desktop name ("x11" by default) - ''; - apply = x: "-desktop '${x}'"; - }; - viewOnly = mkOption { - default = ""; - description = '' - Don't accept keboard and pointer events from clients. All clients will be able to see - the desktop but won't be able to control it. - ''; - apply = x: "-viewonly '${x}'"; - }; - interface = mkOption { - default = ""; - description = '' - Listen for client connections only on the network interface with given ipaddr - ''; - apply = x: "-interface '${x}'"; - }; - extras = mkOption { - default = ""; - description = '' - additional params, see man Xvnc - ''; - }; - }; - - jobs = if (lib.getAttr ["services" "xfs" "enable"] false config) != true - then abort "you need to enable xfs services = { xfs = { enable = true; }; } within your nixos/configuration.nix file" - else - [ ( rec { - name = "tightvnc"; - - job = " -description \"${name}\" - -start on network-interfaces/started and xserver/started -stop on network-interfaces/stop or xserver/stop - -exec ${pkgs.tightvnc}/bin/Xvnc -fp unix/:7100 ${lib.concatStringsSep " " (lib.mapIf (x : x != "description") configV (__attrNames options ) ) } - "; -} ) ]; -} -#