2009-10-12 18:36:19 +02:00
|
|
|
{ config, pkgs, servicesPath, ... }:
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
jbossService = import (servicesPath + /jboss) {
|
|
|
|
inherit (pkgs) stdenv jboss su;
|
|
|
|
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
|
|
|
}
|