Setting up Bitmagnet with local PostgreSQL (DHT torrent search indexer)

I am trying to get the bitmagnet nixos module to run, but stumbled across a ton of issues.

It needs a Postgres database and everything should work fine, automatic default user and db creation etc. But I got access issues and couldnt make bitmagnet use the unix socket rathet than TCP, which should make more sense for local connections and allow secure and fast connections without encryption.

If someone could share the needed config to get Bitmagnet with local default Postgres working, that would be great.

Containerizing might be even better, or at least restricting filesystem access heavily, as the search engine should only be accessed over its local IP via Jackett or so.