summary refs log tree commit diff
path: root/nixos/modules/services/web-servers/apache-httpd/default.nix
diff options
context:
space:
mode:
authorDaniel Nagy <danielnagy@posteo.de>2020-12-25 22:54:05 +0100
committerDaniel Nagy <danielnagy@posteo.de>2020-12-25 22:54:05 +0100
commitf2ca4c8f1d237bc88b769f80332efcc4d0b531e5 (patch)
treeeb2c11f489987f28974ee901805d5d7b9bd979e0 /nixos/modules/services/web-servers/apache-httpd/default.nix
parentf20d8091d4b05298bb2376ca930110b1c1ae07a7 (diff)
downloadnixpkgs-f2ca4c8f1d237bc88b769f80332efcc4d0b531e5.tar
nixpkgs-f2ca4c8f1d237bc88b769f80332efcc4d0b531e5.tar.gz
nixpkgs-f2ca4c8f1d237bc88b769f80332efcc4d0b531e5.tar.bz2
nixpkgs-f2ca4c8f1d237bc88b769f80332efcc4d0b531e5.tar.lz
nixpkgs-f2ca4c8f1d237bc88b769f80332efcc4d0b531e5.tar.xz
nixpkgs-f2ca4c8f1d237bc88b769f80332efcc4d0b531e5.tar.zst
nixpkgs-f2ca4c8f1d237bc88b769f80332efcc4d0b531e5.zip
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
Diffstat (limited to 'nixos/modules/services/web-servers/apache-httpd/default.nix')
-rw-r--r--nixos/modules/services/web-servers/apache-httpd/default.nix9
1 files changed, 9 insertions, 0 deletions
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
     </IfModule>
   '';
 
+  luaSetPaths = ''
+    <IfModule mod_lua.c>
+      LuaPackageCPath ${cfg.package.lua5}/lib/lua/${cfg.package.lua5.lua.luaversion}/?.so
+      LuaPackagePath  ${cfg.package.lua5}/share/lua/${cfg.package.lua5.lua.luaversion}/?.lua
+    </IfModule>
+  '';
+
   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.
     <Directory />
         Options FollowSymLinks