Expanding Lua for Prosody


Im recently trying to migrate my prosody server to NixOS, and I’ve come up to a problem Im unsure how to fix.

I’m hoping to enable the PostgreSQL storage option for the server, however it says that only SQLite is avaliable.

I believe that I need luadbi-postgresql in order for the driver to be avaliable. I tried adding it to environment.systemPackages but that didnt seem to make a change, so now Im wondering whether I need to override lua within the prosody package, to have that lua package avaliable?

Im unsure how to do this, or if this is even what i need to do.

Any help on the matter would be appreciated (I havent had to override packages like this before so Im new to how to do it).

Thank you!

1 Like

there is a module there nixos/modules/services/networking/prosody.nix and man configuration.nix shows how to add lua packages to the environements. (search for withExtraLibs = [ pkgs.luaPackages.lpty ];). I hope that will be ok (never used prosody)

I know this is a bit old, but I I couldn’t find an answer to this issue. After a bit I came up with this solution while looking at nixpkgs’s prosody default.nix:

services.prosody = {
  package = pkgs.callPackage <nixpkgs/pkgs/servers/xmpp/prosody> {                                                           
    withExtraLuaPackages = lua: [ lua.luadbi-postgresql ];

You can’t simply add luadbi-postgresql to your systemPackages, because the closure will not see it.