diff --git a/system/options.nix b/system/options.nix index 551d4f5d3a2a..5fd90329e2b2 100644 --- a/system/options.nix +++ b/system/options.nix @@ -1467,12 +1467,17 @@ sharedLibFrom = mkOption { default = ""; - description ="Location where shared libraries are stored. Leave empty to use the baseDir."; + description = "Location where shared libraries are stored. Leave empty to use the baseDir."; }; commonLibFrom = mkOption { default = ""; - description ="Location where common libraries are stored. Leave empty to use the baseDir."; + description = "Location where common libraries are stored. Leave empty to use the baseDir."; + }; + + contextXML = mkOption { + default = ""; + description = "Location of the context.xml to use. Leave empty to use the default."; }; }; diff --git a/upstart-jobs/tomcat.nix b/upstart-jobs/tomcat.nix index 6ad47607c215..503d1cf3963c 100644 --- a/upstart-jobs/tomcat.nix +++ b/upstart-jobs/tomcat.nix @@ -38,6 +38,15 @@ in cp -av ${pkgs.tomcat6}/{conf,temp,logs} ${cfg.baseDir} fi + # Deploy context.xml + + if test "${cfg.contextXML}" = "" + then + cp ${pkgs.tomcat6}/conf/context.xml.default ${cfg.baseDir}/conf/context.xml + else + cp ${cfg.contextXML} ${cfg.baseDir}/conf/context.xml + fi + # Deploy all webapplications if ! test "${cfg.deployFrom}" = ""