diff --git a/modules/module-list.nix b/modules/module-list.nix index f67dbb29384c..cf0940b49f14 100644 --- a/modules/module-list.nix +++ b/modules/module-list.nix @@ -135,7 +135,7 @@ ./services/ttys/gpm.nix ./services/ttys/mingetty.nix ./services/web-servers/apache-httpd/default.nix - #./services/web-servers/jboss.nix + ./services/web-servers/jboss/default.nix ./services/web-servers/tomcat.nix ./services/x11/desktop-managers/default.nix ./services/x11/display-managers/auto.nix diff --git a/modules/services/web-servers/jboss/builder.sh b/modules/services/web-servers/jboss/builder.sh new file mode 100644 index 000000000000..2eb89a90f67d --- /dev/null +++ b/modules/services/web-servers/jboss/builder.sh @@ -0,0 +1,72 @@ +set -e + +source $stdenv/setup + +mkdir -p $out/bin + +cat > $out/bin/control <false|true|' default/deploy/jboss-web.deployer/META-INF/jboss-service.xml + sed -i -e 's|||' default/deploy/jboss-web.deployer/server.xml + fi + + # Make files accessible for the server user + + chown -R $user $serverDir + for i in \`find $serverDir -type d\` + do + chmod 755 \$i + done + for i in \`find $serverDir -type f\` + do + chmod 644 \$i + done +fi +EOF + +chmod +x $out/bin/* diff --git a/modules/services/web-servers/jboss.nix b/modules/services/web-servers/jboss/default.nix similarity index 91% rename from modules/services/web-servers/jboss.nix rename to modules/services/web-servers/jboss/default.nix index bf7a8090b193..a1bdce50eee1 100644 --- a/modules/services/web-servers/jboss.nix +++ b/modules/services/web-servers/jboss/default.nix @@ -1,4 +1,4 @@ -{ config, pkgs, servicesPath, ... }: +{ config, pkgs, ... }: with pkgs.lib; @@ -6,8 +6,10 @@ let cfg = config.services.jboss; - jbossService = import (servicesPath + /jboss) { - inherit (pkgs) stdenv jboss su; + jbossService = pkgs.stdenv.mkDerivation { + name = "jboss-server"; + builder = ./builder.sh; + inherit (pkgs) jboss su; inherit (cfg) tempDir logDir libUrl deployDir serverDir user useJK; };