From f2ca4c8f1d237bc88b769f80332efcc4d0b531e5 Mon Sep 17 00:00:00 2001 From: Daniel Nagy Date: Fri, 25 Dec 2020 22:54:05 +0100 Subject: [PATCH] nixos/httpd: set lua paths We conditionally set the lua paths for the Apache mod_lua module. This allows executing Lua script handlers to require modules, that have been packaged with the supplied Lua derivation of Apache. For more information, see: https://httpd.apache.org/docs/2.4/mod/mod_lua.html#luapackagecpath https://httpd.apache.org/docs/2.4/mod/mod_lua.html#luapackagepath --- .../services/web-servers/apache-httpd/default.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/nixos/modules/services/web-servers/apache-httpd/default.nix b/nixos/modules/services/web-servers/apache-httpd/default.nix index dc78728d663..de3c7d693d4 100644 --- a/nixos/modules/services/web-servers/apache-httpd/default.nix +++ b/nixos/modules/services/web-servers/apache-httpd/default.nix @@ -126,6 +126,13 @@ let ''; + luaSetPaths = '' + + LuaPackageCPath ${cfg.package.lua5}/lib/lua/${cfg.package.lua5.lua.luaversion}/?.so + LuaPackagePath ${cfg.package.lua5}/share/lua/${cfg.package.lua5.lua.luaversion}/?.lua + + ''; + mkVHostConf = hostOpts: let adminAddr = if hostOpts.adminAddr != null then hostOpts.adminAddr else cfg.adminAddr; @@ -326,6 +333,8 @@ let ${sslConf} + ${if cfg.package.luaSupport then luaSetPaths else ""} + # Fascist default - deny access to everything. Options FollowSymLinks