mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 14:54:29 +01:00
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
This commit is contained in:
parent
22f49c3cd2
commit
8c5f0522e7
5 changed files with 1 additions and 253 deletions
|
@ -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 = {
|
||||
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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"}
|
||||
";
|
||||
|
||||
} ) ];
|
||||
}
|
|
@ -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
|
||||
|
||||
*/
|
|
@ -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 ) ) }
|
||||
";
|
||||
} ) ];
|
||||
}
|
||||
#
|
Loading…
Reference in a new issue