Implemented an option to enable to DisnixWebService on Apache Tomcat

svn path=/nixos/trunk/; revision=24560
This commit is contained in:
Sander van der Burg 2010-11-01 17:33:54 +00:00
parent edb5870deb
commit 9359ebf975

View file

@ -6,7 +6,14 @@ with pkgs.lib;
let
cfg = config.services.disnix;
disnix_activation_scripts = pkgs.disnix_activation_scripts.override (origArgs: {
enableApacheWebApplication = config.services.httpd.enable;
enableAxis2WebService = config.services.tomcat.axis2.enable;
enableEjabberdDump = config.services.ejabberd.enable;
enableMySQLDatabase = config.services.mysql.enable;
enableTomcatWebApplication = config.services.tomcat.enable;
});
in
{
@ -20,7 +27,12 @@ in
enable = mkOption {
default = false;
description = "Whether to enable Disnix";
};
};
useWebServiceInterface = mkOption {
default = false;
description = "Whether to enable the DisnixWebService interface running on Apache Tomcat";
};
};
@ -36,6 +48,13 @@ in
services.dbus.enable = true;
services.dbus.packages = [ pkgs.disnix ];
services.tomcat.enable = cfg.useWebServiceInterface;
services.tomcat.javaOpts = "${optionalString cfg.useWebServiceInterface "-Djava.library.path=${pkgs.libmatthew_java}/lib/jni"} ";
services.tomcat.sharedLibs = []
++ optional cfg.useWebServiceInterface "${pkgs.DisnixWebService}/share/java/DisnixConnection.jar"
++ optional cfg.useWebServiceInterface "${pkgs.dbus_java}/share/java/dbus.jar";
services.tomcat.webapps = [] ++ optional cfg.useWebServiceInterface pkgs.DisnixWebService;
users.extraGroups = singleton
{ name = "disnix";
gid = config.ids.gids.disnix;
@ -47,11 +66,8 @@ in
startOn = "started dbus";
script =
''
export PATH=/var/run/current-system/sw/bin:/var/run/current-system/sw/sbin
export HOME=/root
${pkgs.disnix}/bin/disnix-service --activation-modules-dir=${pkgs.disnix_activation_scripts}/libexec/disnix/activation-scripts
''
${pkgs.disnix}/bin/disnix-service --activation-modules-dir=${disnix_activation_scripts}/libexec/disnix/activation-scripts
'';
};