2014-04-14 16:26:48 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
2009-10-12 18:36:19 +02:00
|
|
|
|
2014-04-14 16:26:48 +02:00
|
|
|
with 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-09-14 20:20:50 +02:00
|
|
|
|
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 = {
|
2011-09-14 20:20:50 +02:00
|
|
|
|
2009-10-12 18:36:19 +02:00
|
|
|
services.jboss = {
|
2011-09-14 20:20:50 +02:00
|
|
|
|
2009-10-12 18:36:19 +02:00
|
|
|
enable = mkOption {
|
|
|
|
default = false;
|
2017-03-09 21:02:16 +01:00
|
|
|
description = "Whether to enable JBoss. WARNING : this package is outdated and is known to have vulnerabilities.";
|
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";
|
2011-10-30 16:19:58 +01:00
|
|
|
default = "/nix/var/nix/profiles/default/server/default/deploy/";
|
2009-10-12 18:36:19 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
libUrl = mkOption {
|
2011-10-30 16:19:58 +01:00
|
|
|
default = "file:///nix/var/nix/profiles/default/server/default/lib";
|
2009-10-12 18:36:19 +02: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 20:20:50 +02: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
|
|
|
|
|
|
|
|
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 {
|
2016-01-06 07:50:18 +01:00
|
|
|
systemd.services.jboss = {
|
|
|
|
description = "JBoss server";
|
|
|
|
script = "${jbossService}/bin/control start";
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
};
|
2009-03-06 13:26:31 +01:00
|
|
|
};
|
2008-01-28 16:16:14 +01:00
|
|
|
}
|