Luarocks doesn't exist in lua environment

{
  environment.systemPackages = with pkgs;
  [
        lua.withPackages (
          p: with p; [
            luarocks
          ]
        )
  ]
}

However,

$ luarocks
The program 'luarocks' is not in your PATH.
$ lua
> require "luarocks"
stdin:1: module 'luarocks' not found:

luarocks doesn’t exist in /nix/store/knfzdpy6kjpi6d2ig299cjm6420sz5fs-lua-5.2.4-env/share/lua, it only exists in /nix/store/va71vml2bjcmv2ydkwf9iixyi1zj852c-luarocks-3.9.1/share/lua.

I guess this is because luarocks use stdenv.mkDerivation not buildLuarocksPackage?

this should be solved on master