Skip to content

Instantly share code, notes, and snippets.

@Thomashrb
Created June 5, 2018 07:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Thomashrb/d67ae419527ed59762cbcf7d32046254 to your computer and use it in GitHub Desktop.
Save Thomashrb/d67ae419527ed59762cbcf7d32046254 to your computer and use it in GitHub Desktop.
What I am missing is:
```
$ luarocks install luasql-postgres --local
Installing https://luarocks.org/luasql-postgres-2.3.5-2.rockspec
Error: Could not find header file for PGSQL
No file libpq-fe.h in /usr/local/include
No file libpq-fe.h in /usr/include
You may have to install PGSQL in your system and/or pass PGSQL_DIR or PGSQL_INCDIR to the luarocks command.
Example: luarocks install luasql-postgres PGSQL_DIR=/usr/local
```
with import <nixpkgs> {};
with luaPackages;
let
libs = [lua cjson luasocket luasec];
in
stdenv.mkDerivation {
name = "streamstore-env";
buildInputs = [
nginx
ffmpeg
libs
luarocks
libpqxx
];
shellHook = ''
export LUA_CPATH="${lib.concatStringsSep ";" (map getLuaCPath libs)}"
export LUA_PATH="${lib.concatStringsSep ";" (map getLuaPath libs)}"
export PGSQL_INCDIR=${postgresql}/include
export PGSQL_LIBDIR=${postgresql.lib}/lib
luarocks install penlight --local
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment