Haproxy path to Lua scripts

I want to do forward auth in haproxy using lua scripts mentioned in this tutorial.

I put the scripts in the same directory as suggested in the tutorial (/usr/local/share/lua/5.3/)

config in haproxy:

lua-load /usr/local/share/lua/5.3/json.lua
lua-load /usr/local/share/lua/5.3/http.lua
lua-load /usr/local/share/lua/5.3/auth-request.lua

But when I check my configuration with sudo -u haproxy /run/haproxy/haproxy -c -f /etc/nixos/haproxy/haproxy.cfg, I get this error:

[ALERT]    (42253) : config : parsing [/etc/nixos/haproxy/haproxy.cfg:7] : Lua runtime error: /usr/local/share/lua/5.3/http.lua:33: module 'json' not found:
	no field package.preload['json']
	no file '/nix/store/jn8sg733y044z4b83hf2mj9ak2mk8m7l-lua-5.4.7/share/lua/5.4/json.lua'
	no file '/nix/store/jn8sg733y044z4b83hf2mj9ak2mk8m7l-lua-5.4.7/share/lua/5.4/json/init.lua'
	no file '/nix/store/jn8sg733y044z4b83hf2mj9ak2mk8m7l-lua-5.4.7/lib/lua/5.4/json.lua'
	no file '/nix/store/jn8sg733y044z4b83hf2mj9ak2mk8m7l-lua-5.4.7/lib/lua/5.4/json/init.lua'
	no file './json.lua'
	no file './json/init.lua'
	no file '/nix/store/jn8sg733y044z4b83hf2mj9ak2mk8m7l-lua-5.4.7/lib/lua/5.4/json.so'
	no file '/nix/store/jn8sg733y044z4b83hf2mj9ak2mk8m7l-lua-5.4.7/lib/lua/5.4/loadall.so'
	no file './json.so'
[ALERT]    (42253) : config : parsing [/etc/nixos/haproxy/haproxy.cfg:8] : Lua runtime error: /usr/local/share/lua/5.3/auth-request.lua:25: module 'haproxy-lua-http' not found:
	no field package.preload['haproxy-lua-http']
	no file '/nix/store/jn8sg733y044z4b83hf2mj9ak2mk8m7l-lua-5.4.7/share/lua/5.4/haproxy-lua-http.lua'
	no file '/nix/store/jn8sg733y044z4b83hf2mj9ak2mk8m7l-lua-5.4.7/share/lua/5.4/haproxy-lua-http/init.lua'
	no file '/nix/store/jn8sg733y044z4b83hf2mj9ak2mk8m7l-lua-5.4.7/lib/lua/5.4/haproxy-lua-http.lua'
	no file '/nix/store/jn8sg733y044z4b83hf2mj9ak2mk8m7l-lua-5.4.7/lib/lua/5.4/haproxy-lua-http/init.lua'
	no file './haproxy-lua-http.lua'
	no file './haproxy-lua-http/init.lua'
	no file '/nix/store/jn8sg733y044z4b83hf2mj9ak2mk8m7l-lua-5.4.7/lib/lua/5.4/haproxy-lua-http.so'
	no file '/nix/store/jn8sg733y044z4b83hf2mj9ak2mk8m7l-lua-5.4.7/lib/lua/5.4/loadall.so'
	no file './haproxy-lua-http.so'

Now I believe this is an issue where the special way NixOS handles dependencies (and other directory stuff I don‘t understand) doesn‘t let haproxy access the path I set for the scripts. I tried installing the lua53Packages.http and json library packages also for Lua54, but this did not resolve the issue. Now how do I get the lua files in any of the directories? Is it possible to do this within my nix config?
./ would be /run/haproxy/ when run as service I believe, so I think thats not suitable
Also I couldn‘t find any reference to “/nix/store/jn8sg733y044z4b83hf2mj9ak2mk8m7l-lua-5.4.7/” in the unit file “/etc/systemd/system/haproxy.service” or with “sudo -u haproxy echo $PATH | grep jn8s”.

Help is much appreciated

EDIT:
I was able to do this within haproxy:
lua-prepend-path /usr/local/share/lua/5.3/?.lua
lua-load /usr/local/share/lua/5.3/auth-request.lua
and rename http.lua to haproxy-lua-http.lua in /usr/local/share/lua/5.3/