Using ODBC drivers in nix os

Need to connect to a SQL server database from a python application, installed the client and the drivers but still running into issues when running the application. The application raises the following exception:

('01000', "[01000] [unixODBC][Driver Manager] Can't open lib 'ODBC Driver 18 for SQL Server': file not found (0) (SQLDriverConnect)")

Here’s my home manager configuration where I installed the driver

Do I need to create a file link somewhere or something? I’m supposing this is maybe a problem with relying on binaries on nix os. I’m using pyodbc to connect to the database.

Until someone has a better solution, here’s what I use with iodbc. Maybe it could be similar with odbc.

pkgs.mkShell {
  LD_LIBRARY_PATH = "/run/opengl-driver/lib:${my_driver}:${pkgs.libiodbc}/lib";
}