Open teto opened 2 years ago
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
I can help testing if @teto or someone else can give some guidance on how/where to start. Fixing wrapLuaProgram would be great.
@pinpox that would be awesome ! https://discourse.nixos.org/t/using-lua-modules/19769 looks simple One should be able to create a shell containing
lua = pkgs.lua5_3.withPackages(ps: with ps; [
cjson
http
]);
and require the package afterwards. As I explained in the discourse what I would do is to look at the wrapper and what its LUA_PATH value is. It should be wrong, then we need to cleanup the code as I had started in https://github.com/NixOS/nixpkgs/pull/177556 . You can DM me on matrix if you have questions.
I can also gladly help with further testing. I have described my setup in the linked issue.
Issue description
One problem is that handling of LUA_PATH across nixpkgs is very heterogeneous, and so it makes harder to make some global changes. I think it's heterogeneous partly because lua utilities are broken. For instance the LUA_PATH generation hook removes the defaults from the lua interpreter (";;"). Many modules hardcode the different lua paths instead of using e.g. wrapLuaProgram, luaPathList from pkgs/development/lua-modules/lib.nix . I believe wrapLuaProgram is broken so let's first fix this and add some tests. any help welcome.
Technical details
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.