2011-04-27 15:33:06 +02:00
|
|
|
{ config, pkgs, ... }:
|
2009-10-12 18:36:19 +02:00
|
|
|
|
|
|
|
with pkgs.lib;
|
2008-01-28 16:16:14 +01:00
|
|
|
|
2009-03-06 13:26:31 +01:00
|
|
|
let
|
2009-10-12 18:36:19 +02:00
|
|
|
|
|
|
|
cfg = config.services.jboss;
|
|
|
|
|
2011-04-27 15:33:06 +02:00
|
|
|
jbossService = pkgs.stdenv.mkDerivation {
|
|
|
|
name = "jboss-server";
|
|
|
|
builder = ./builder.sh;
|
|
|
|
inherit (pkgs) jboss su;
|
2009-10-12 18:36:19 +02:00
|
|
|
inherit (cfg) tempDir logDir libUrl deployDir serverDir user useJK;
|
|
|
|
};
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
###### interface
|
2009-03-06 13:26:31 +01:00
|
|
|
|
|
|
|
options = {
|
2009-10-12 18:36:19 +02:00
|
|
|
|
|
|
|
services.jboss = {
|
|
|
|
|
|
|
|
enable = mkOption {
|
|
|
|
default = false;
|
|
|
|
description = "Whether to enable jboss";
|
2009-03-06 13:26:31 +01:00
|
|
|
};
|
2009-10-12 18:36:19 +02:00
|
|
|
|
|
|
|
tempDir = mkOption {
|
|
|
|
default = "/tmp";
|
|
|
|
description = "Location where JBoss stores its temp files";
|
|
|
|
};
|
|
|
|
|
|
|
|
logDir = mkOption {
|
|
|
|
default = "/var/log/jboss";
|
|
|
|
description = "Location of the logfile directory of JBoss";
|
|
|
|
};
|
|
|
|
|
|
|
|
serverDir = mkOption {
|
|
|
|
description = "Location of the server instance files";
|
|
|
|
default = "/var/jboss/server";
|
|
|
|
};
|
|
|
|
|
|
|
|
deployDir = mkOption {
|
|
|
|
description = "Location of the deployment files";
|
|
|
|
default = "/nix/var/nix/profiles/default/server/default/deploy/";
|
|
|
|
};
|
|
|
|
|
|
|
|
libUrl = mkOption {
|
|
|
|
default = "file:///nix/var/nix/profiles/default/server/default/lib";
|
|
|
|
description = "Location where the shared library JARs are stored";
|
|
|
|
};
|
|
|
|
|
|
|
|
user = mkOption {
|
|
|
|
default = "nobody";
|
|
|
|
description = "User account under which jboss runs.";
|
|
|
|
};
|
|
|
|
|
|
|
|
useJK = mkOption {
|
|
|
|
default = false;
|
|
|
|
description = "Whether to use to connector to the Apache HTTP server";
|
|
|
|
};
|
|
|
|
|
2009-03-06 13:26:31 +01:00
|
|
|
};
|
|
|
|
|
2009-10-12 18:36:19 +02:00
|
|
|
};
|
2008-01-28 16:16:14 +01:00
|
|
|
|
|
|
|
|
2009-10-12 18:36:19 +02:00
|
|
|
###### implementation
|
2008-01-28 16:16:14 +01:00
|
|
|
|
2009-10-12 18:36:19 +02:00
|
|
|
config = mkIf config.services.jboss.enable {
|
2009-03-06 13:26:31 +01:00
|
|
|
|
2009-10-12 20:09:34 +02:00
|
|
|
jobs.jboss =
|
2009-10-12 18:36:19 +02:00
|
|
|
{ description = "JBoss server";
|
2009-03-06 13:26:31 +01:00
|
|
|
|
2009-10-12 18:36:19 +02:00
|
|
|
exec = "${jbossService}/bin/control start";
|
|
|
|
};
|
2008-01-28 16:16:14 +01:00
|
|
|
|
2009-03-06 13:26:31 +01:00
|
|
|
};
|
2009-10-12 18:36:19 +02:00
|
|
|
|
2008-01-28 16:16:14 +01:00
|
|
|
}
|