I tried to use vicious in a lua interpreter but was not able to. With some other lua package my test worked fine:
$ nix-shell -p "lua.withPackages (p: [p.busted])" --command "lua -e 'print(require[[busted]])'"
table: 0x58b111eff760
$ nix-shell -p "lua.withPackages (p: [p.vicious])" --command "lua -e 'print(require[[vicious]])'"
/nix/store/0ams9cbjhsb1ccphamccr55sqk4ylds4-lua-5.2.4/bin/lua: (command line):1: module 'vicious' not found:
no field package.preload['vicious']
no file '/nix/store/0ams9cbjhsb1ccphamccr55sqk4ylds4-lua-5.2.4/share/lua/5.2/vicious.lua'
no file '/nix/store/0ams9cbjhsb1ccphamccr55sqk4ylds4-lua-5.2.4/share/lua/5.2/vicious/init.lua'
no file '/nix/store/0ams9cbjhsb1ccphamccr55sqk4ylds4-lua-5.2.4/lib/lua/5.2/vicious.lua'
no file '/nix/store/0ams9cbjhsb1ccphamccr55sqk4ylds4-lua-5.2.4/lib/lua/5.2/vicious/init.lua'
no file './vicious.lua'
no file '/nix/store/0ams9cbjhsb1ccphamccr55sqk4ylds4-lua-5.2.4/lib/lua/5.2/vicious.so'
no file '/nix/store/0ams9cbjhsb1ccphamccr55sqk4ylds4-lua-5.2.4/lib/lua/5.2/loadall.so'
no file './vicious.so'
stack traceback:
[C]: in function 'require'
(command line):1: in main chunk
[C]: in ?
I am not sure if I am doing something wrong or if vicious is kind of broken. I can build vicious and busted just fine but the folder structure is different:
$ for p in vicious busted; do nix build --out-link $p nixpkgs#luaPackages.$p; done
$ ls -d1 {vicious,busted}/*/lua/5.2
busted/share/lua/5.2
vicious/lib/lua/5.2
Is this because vicious is meant to be used by awesome wm?
What can I do to use vicious in a standalone lua interpreter?