2011-04-27 13:33:06 +00:00
|
|
|
{ config, pkgs, ... }:
|
2009-10-12 16:36:19 +00:00
|
|
|
|
|
|
|
with pkgs.lib;
|
2008-01-28 15:16:14 +00:00
|
|
|
|
2009-03-06 12:26:31 +00:00
|
|
|
let
|
2009-10-12 16:36:19 +00:00
|
|
|
|
|
|
|
cfg = config.services.jboss;
|
|
|
|
|
2011-04-27 13:33:06 +00:00
|
|
|
jbossService = pkgs.stdenv.mkDerivation {
|
|
|
|
name = "jboss-server";
|
|
|
|
builder = ./builder.sh;
|
|
|
|
inherit (pkgs) jboss su;
|
2009-10-12 16:36:19 +00:00
|
|
|
inherit (cfg) tempDir logDir libUrl deployDir serverDir user useJK;
|
|
|
|
};
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
###### interface
|
2009-03-06 12:26:31 +00:00
|
|
|
|
|
|
|
options = {
|
2009-10-12 16:36:19 +00:00
|
|
|
|
|
|
|
services.jboss = {
|
|
|
|
|
|
|
|
enable = mkOption {
|
|
|
|
default = false;
|
|
|
|
description = "Whether to enable jboss";
|
2009-03-06 12:26:31 +00:00
|
|
|
};
|
2009-10-12 16:36:19 +00: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 12:26:31 +00:00
|
|
|
};
|
|
|
|
|
2009-10-12 16:36:19 +00:00
|
|
|
};
|
2008-01-28 15:16:14 +00:00
|
|
|
|
|
|
|
|
2009-10-12 16:36:19 +00:00
|
|
|
###### implementation
|
2008-01-28 15:16:14 +00:00
|
|
|
|
2009-10-12 16:36:19 +00:00
|
|
|
config = mkIf config.services.jboss.enable {
|
2009-03-06 12:26:31 +00:00
|
|
|
|
2009-10-12 18:09:34 +00:00
|
|
|
jobs.jboss =
|
2009-10-12 16:36:19 +00:00
|
|
|
{ description = "JBoss server";
|
2009-03-06 12:26:31 +00:00
|
|
|
|
2009-10-12 16:36:19 +00:00
|
|
|
exec = "${jbossService}/bin/control start";
|
|
|
|
};
|
2008-01-28 15:16:14 +00:00
|
|
|
|
2009-03-06 12:26:31 +00:00
|
|
|
};
|
2009-10-12 16:36:19 +00:00
|
|
|
|
2008-01-28 15:16:14 +00:00
|
|
|
}
|