2022-10-11 18:31:17 +03:00
|
|
|
{ pkgs }:
|
|
|
|
let
|
|
|
|
versions = import ./versions.nix { inherit pkgs; };
|
|
|
|
|
|
|
|
# Unix ODBC Support
|
|
|
|
freetdsWithODBC = pkgs.freetds.override {
|
|
|
|
odbcSupport = true;
|
2023-03-25 23:54:21 +03:00
|
|
|
inherit unixODBC;
|
2022-10-11 18:31:17 +03:00
|
|
|
};
|
|
|
|
|
2022-10-21 19:23:01 +03:00
|
|
|
msodbcsql = pkgs.unixODBCDrivers.msodbcsql18;
|
|
|
|
|
2022-10-11 18:31:17 +03:00
|
|
|
# Verify this works by running `odbcinst -q -d`.
|
|
|
|
# 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.
|
2023-03-25 23:54:21 +03:00
|
|
|
odbcConfiguration = pkgs.writeTextFile {
|
|
|
|
name = "odbc-configuration";
|
2022-10-21 19:23:01 +03:00
|
|
|
text = ''
|
|
|
|
[${msodbcsql.fancyName}]
|
|
|
|
Description = ${msodbcsql.meta.description}
|
|
|
|
Driver = ${msodbcsql}/${msodbcsql.driver}
|
|
|
|
'';
|
2023-03-25 23:54:21 +03:00
|
|
|
destination = "/odbcinst.ini";
|
2022-10-21 19:23:01 +03:00
|
|
|
};
|
2022-10-11 18:31:17 +03:00
|
|
|
|
2023-03-25 23:54:21 +03:00
|
|
|
unixODBC = pkgs.unixODBC.overrideAttrs (oldAttrs: {
|
|
|
|
configureFlags = [ "--disable-gui" "--sysconfdir=${odbcConfiguration}" ];
|
|
|
|
});
|
|
|
|
|
2022-10-11 18:31:17 +03:00
|
|
|
baseInputs = [
|
|
|
|
pkgs.stdenv
|
|
|
|
pkgs.jq
|
|
|
|
];
|
|
|
|
|
|
|
|
consoleInputs = [
|
|
|
|
pkgs.google-cloud-sdk
|
|
|
|
pkgs."nodejs-${versions.nodejsVersion}_x"
|
2023-03-24 00:28:10 +03:00
|
|
|
pkgs."nodejs-${versions.nodejsVersion}_x".pkgs.typescript-language-server
|
2022-10-11 18:31:17 +03:00
|
|
|
];
|
|
|
|
|
|
|
|
docsInputs = [
|
|
|
|
pkgs.yarn
|
|
|
|
];
|
|
|
|
|
|
|
|
integrationTestInputs = [
|
|
|
|
pkgs.python3
|
2023-03-24 00:28:10 +03:00
|
|
|
pkgs.pyright # Python type checker
|
2022-10-11 18:31:17 +03:00
|
|
|
];
|
|
|
|
|
|
|
|
# The version of GHC in `ghcName` is set in nix/overlays/ghc.nix.
|
|
|
|
#
|
|
|
|
# We list top-level packages before packages scoped to the GHC version, so
|
|
|
|
# that they appear first in the PATH. Otherwise we might end up with older
|
|
|
|
# versions of transitive dependencies (e.g. HLS depending on Ormolu).
|
|
|
|
haskellInputs = [
|
|
|
|
pkgs.cabal2nix
|
|
|
|
|
|
|
|
# The correct version of GHC.
|
|
|
|
pkgs.haskell.compiler.${pkgs.ghcName}
|
|
|
|
|
|
|
|
pkgs.haskell.packages.${pkgs.ghcName}.alex
|
|
|
|
pkgs.haskell.packages.${pkgs.ghcName}.apply-refact
|
|
|
|
pkgs.haskell.packages.${pkgs.ghcName}.cabal-install
|
|
|
|
pkgs.haskell.packages.${pkgs.ghcName}.ghcid
|
|
|
|
pkgs.haskell.packages.${pkgs.ghcName}.happy
|
|
|
|
pkgs.haskell.packages.${pkgs.ghcName}.haskell-language-server
|
2022-10-12 22:13:46 +03:00
|
|
|
(versions.ensureVersion pkgs.haskell.packages.${pkgs.ghcName}.hlint)
|
2022-10-11 18:31:17 +03:00
|
|
|
pkgs.haskell.packages.${pkgs.ghcName}.hoogle
|
|
|
|
pkgs.haskell.packages.${pkgs.ghcName}.hspec-discover
|
2022-11-02 23:53:23 +03:00
|
|
|
(versions.ensureVersion pkgs.haskell.packages.${pkgs.ghcName}.ormolu)
|
2022-10-11 18:31:17 +03:00
|
|
|
];
|
|
|
|
|
|
|
|
devInputs = [
|
|
|
|
pkgs.nixpkgs-fmt
|
|
|
|
pkgs.shellcheck
|
2022-11-24 17:14:30 +03:00
|
|
|
pkgs.terraform
|
2022-12-20 21:45:40 +03:00
|
|
|
pkgs.gopls
|
2022-10-11 18:31:17 +03:00
|
|
|
];
|
|
|
|
|
|
|
|
ciInputs = [
|
|
|
|
pkgs.go
|
2022-10-18 16:25:59 +03:00
|
|
|
pkgs.gox
|
2022-10-11 18:31:17 +03:00
|
|
|
];
|
|
|
|
|
|
|
|
dynamicLibraries = [
|
|
|
|
pkgs.gmp
|
|
|
|
pkgs.libkrb5 # Includes required `gssapi` headers.
|
2022-10-21 19:23:01 +03:00
|
|
|
pkgs.libiconv
|
2022-10-11 18:31:17 +03:00
|
|
|
pkgs.ncurses
|
|
|
|
pkgs.openssl_3
|
|
|
|
pkgs.pcre
|
|
|
|
pkgs.zlib
|
|
|
|
pkgs.zstd
|
|
|
|
|
|
|
|
# PostgreSQL, Microsoft SQL Server, & MySQL dependencies.
|
|
|
|
freetdsWithODBC
|
|
|
|
pkgs.libmysqlclient
|
|
|
|
pkgs.mariadb
|
2022-11-17 16:53:04 +03:00
|
|
|
pkgs.postgresql_15
|
2023-03-25 23:54:21 +03:00
|
|
|
unixODBC
|
2022-10-21 19:23:01 +03:00
|
|
|
msodbcsql
|
2022-10-11 18:31:17 +03:00
|
|
|
]
|
|
|
|
# Linux-specific libraries.
|
|
|
|
++ pkgs.lib.optionals pkgs.stdenv.targetPlatform.isLinux [
|
|
|
|
pkgs.stdenv.cc.cc.lib
|
|
|
|
];
|
|
|
|
|
|
|
|
includeLibraries = [
|
|
|
|
pkgs.libkrb5.dev
|
|
|
|
pkgs.ncurses.dev
|
|
|
|
pkgs.openssl_3.dev
|
|
|
|
pkgs.pcre.dev
|
|
|
|
pkgs.zlib.dev
|
|
|
|
];
|
|
|
|
|
|
|
|
serverDeps =
|
|
|
|
haskellInputs
|
|
|
|
++ dynamicLibraries
|
|
|
|
++ includeLibraries
|
|
|
|
++ integrationTestInputs;
|
|
|
|
in
|
|
|
|
pkgs.mkShell {
|
|
|
|
buildInputs = baseInputs ++ consoleInputs ++ docsInputs ++ serverDeps ++ devInputs ++ ciInputs;
|
|
|
|
|
|
|
|
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.
|
|
|
|
export DYLD_LIBRARY_PATH="$LD_LIBRARY_PATH";
|
|
|
|
'';
|
|
|
|
}
|