diff --git a/nix/shell.nix b/nix/shell.nix index 3ef614ddb15..df8193d5fed 100644 --- a/nix/shell.nix +++ b/nix/shell.nix @@ -5,7 +5,7 @@ let # Unix ODBC Support freetdsWithODBC = pkgs.freetds.override { odbcSupport = true; - inherit (pkgs) unixODBC; + inherit unixODBC; }; msodbcsql = pkgs.unixODBCDrivers.msodbcsql18; @@ -14,15 +14,20 @@ let # The output should be the headings from the odbcinst.ini file. # (You can easily see the generated file by running `cat $ODBCINSTINI`.) # If you see any errors, please contact your friendly MSSQL and/or Nix expert. - odbcinstFile = pkgs.writeTextFile { - name = "odbcinst.ini"; + odbcConfiguration = pkgs.writeTextFile { + name = "odbc-configuration"; text = '' [${msodbcsql.fancyName}] Description = ${msodbcsql.meta.description} Driver = ${msodbcsql}/${msodbcsql.driver} ''; + destination = "/odbcinst.ini"; }; + unixODBC = pkgs.unixODBC.overrideAttrs (oldAttrs: { + configureFlags = [ "--disable-gui" "--sysconfdir=${odbcConfiguration}" ]; + }); + baseInputs = [ pkgs.stdenv pkgs.jq @@ -93,7 +98,7 @@ let pkgs.libmysqlclient pkgs.mariadb pkgs.postgresql_15 - pkgs.unixODBC + unixODBC msodbcsql ] # Linux-specific libraries. @@ -118,11 +123,6 @@ in pkgs.mkShell { buildInputs = baseInputs ++ consoleInputs ++ docsInputs ++ serverDeps ++ devInputs ++ ciInputs; - # We set the ODBCINSTINI to the file defined above, which points to the MSSQL ODBC driver. - # The path is relative to `ODBCSYSINI`, which we set to empty. - ODBCSYSINI = ""; - ODBCINSTINI = "${odbcinstFile}"; - LD_LIBRARY_PATH = pkgs.lib.strings.makeLibraryPath dynamicLibraries; shellHook = pkgs.lib.strings.optionalString pkgs.stdenv.targetPlatform.isDarwin '' # Without this, GHC will use the system `libcrypto` and `libssl` libraries, which fail.