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