I am trying to set up a nix-shell script which contains lua 5.2, the lua sockets library, and a few other libraries. However, when I load the shell, only Lua ends up being present.
with import <nixpkgs> {}; stdenv.mkDerivation rec { name = "lua-env"; buildInputs = [ lua52Packages.lua lua52Packages.luasocket lua52Packages.luasec lua52Packages.cjson ]; }
When I run the shell, this is what I get:
savanni@lapis:~ $ nix-shell lua.nix [nix-shell:~]$ lua Lua 5.2.3 Copyright (C) 1994-2013 Lua.org, PUC-Rio > require 'socket' stdin:1: module 'socket' not found: no field package.preload['socket'] no file '/usr/share/lua/5.2/socket.lua' no file '/usr/share/lua/5.2/socket/init.lua' no file '/usr/lib/lua/5.2/socket.lua' no file '/usr/lib/lua/5.2/socket/init.lua' no file './socket.lua' no file '/usr/lib/lua/5.2/socket.so' no file '/usr/lib/lua/5.2/loadall.so' no file './socket.so' stack traceback: [C]: in function 'require' stdin:1: in main chunk [C]: in ? > [nix-shell:~]$ exit savanni@lapis:~ $