[Nix] lux-lua and lua.withPackages #1131
-
|
Normally with languages I like using (python313.withPackages (
p: with p; [
playwright
pip
uv
]
))This wraps the interpreter and sets it's path which simplifies setting things up but when I try to do this with lua and the lux-lua module it doesn't seem to work. e.g lux-cli
(luajit.withPackages (
p: with p; [
luarocks
lux-lua
busted
inspect
]
))I can access lx and lua, and it says it's running luajit 2.1 but running lx commands will return a warning 🕒 10:05 PM ❯ lx run "Hello World\!"
⚠️ WARNING: lux-lua library not found.
Cannot use the `lux.loader`.
To suppress this warning, set the `--no-loader` option.
Your input has the word 'hello' in it!If I create a file with this local inspect = require("inspect")
print(inspect({ 1, 2, 3, { a = "hello", b = "world" } }))and run Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 10 replies
-
|
This totally could be pebcak too, I just haven't had any luck getting this to work |
Beta Was this translation helpful? Give feedback.
-
|
Hey 👋 How are you setting up your environment? Lux uses pkg-config to detect lux-lua. lux-lua is a Lua package, but it's not a luarocks package, and iirc Transferring this issue to discussions, as this is not a Lux bug. I've also opened a feature request that may eliminate the need for pkg-config when using |
Beta Was this translation helpful? Give feedback.
Hey 👋
How are you setting up your environment?
Using
nix developornix shell?Lux uses pkg-config to detect lux-lua.
So you need to add that to your
buildInputs.With Nix, pkg-config gets setup via the shell hook when you use
nix developto enter a devShell, but not when you usenix shell.I'm don't know if a package is included if it's behind
lua.withPackages.lux-lua is a Lua package, but it's not a luarocks package, and iirc
lua.withPackagescurrently assumes that packages are luarocks packages (this would be a nixpkgs issue though).Transferring this issue to discussions, as this is not a Lux bug.
I've also opened a feature request that may eliminate the need for pkg-config when using
…