summaryrefslogtreecommitdiff
path: root/misc/nix-lua-shell.nix
blob: 1bf881ec449a0124b1ce1d3f87bcb98f78e667f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
with import <nixpkgs> {};
with lua53Packages;

let
  libs = [
    lua5_3
    lua53Packages.lpeg
    lua53Packages.cjson
    lua53Packages.luaposix
  ];
in
stdenv.mkDerivation rec {
  name = "lua-env";
  buildInputs = libs;

  shellHook = ''
    export LUA_CPATH="${lib.concatStringsSep ";" (map getLuaCPath libs)};./?.so"
    export LUA_PATH="${lib.concatStringsSep ";" (map getLuaPath libs)};./?.lua"
  '';
}