10 # Updating this package will force an update for prisma. The
11 # version of prisma-engines and prisma must be the same for them to
13 rustPlatform.buildRustPackage rec {
14 pname = "prisma-engines";
17 src = fetchFromGitHub {
19 repo = "prisma-engines";
21 hash = "sha256-aCzm7pEsgbZ4ZNir3DLNnUlmiydOpLNcW2FpIQ44B6E=";
25 OPENSSL_NO_VENDOR = 1;
28 lockFile = ./Cargo.lock;
30 "barrel-0.6.6-alpha.0" = "sha256-USh0lQ1z+3Spgc69bRFySUzhuY79qprLlEExTmYWFN8=";
31 "cuid-1.3.2" = "sha256-qBu1k/dJiA6rWBwk4nOOqouIneD9h2TTBT8tvs0TDfA=";
32 "graphql-parser-0.3.0" = "sha256-0ZAsj2mW6fCLhwTETucjbu4rPNzfbNiHu2wVTBlTNe4=";
33 "mysql_async-0.31.3" = "sha256-2wOupQ/LFV9pUifqBLwTvA0tySv+XWbxHiqs7iTzvvg=";
34 "postgres-native-tls-0.5.0" = "sha256-pzMPNZzlvMaQqBu/V3ExPYVnoIaALeUaYJ4oo/hY9lA=";
35 "mongodb-3.0.0" = "sha256-1WQgY0zSZhFjt1nrLYTUBrpqBxpCCgKRSeGJLtkE6pw=";
39 nativeBuildInputs = [ pkg-config ];
47 export OPENSSL_DIR=${lib.getDev openssl}
48 export OPENSSL_LIB_DIR=${lib.getLib openssl}/lib
50 export PROTOC=${protobuf}/bin/protoc
51 export PROTOC_INCLUDE="${protobuf}/include";
53 export SQLITE_MAX_VARIABLE_NUMBER=250000
54 export SQLITE_MAX_EXPR_DEPTH=10000
56 export GIT_HASH=0000000000000000000000000000000000000000
61 "-p" "query-engine-node-api"
62 "-p" "schema-engine-cli"
67 mv $out/lib/libquery_engine${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib/libquery_engine.node
70 # Tests are long to compile
74 description = "Collection of engines that power the core stack for Prisma";
75 homepage = "https://www.prisma.io/";
76 license = licenses.asl20;
77 platforms = platforms.unix;
78 mainProgram = "prisma";
79 maintainers = with maintainers; [ pimeys tomhoule aqrln ];
84 # Here's an example application using Prisma with Nix: https://github.com/pimeys/nix-prisma-example
85 # At example's `flake.nix` shellHook, notice the requirement of defining environment variables for prisma, it's values will show on `prisma --version`.
86 # Read the example's README: https://github.com/pimeys/nix-prisma-example/blob/main/README.md
87 # Prisma requires 2 packages, `prisma-engines` and `prisma`, to be at *exact* same versions.
88 # Certify at `package.json` that dependencies "@prisma/client" and "prisma" are equal, meaning no caret (`^`) in version.
89 # Configure NPM to use exact version: `npm config set save-exact=true`
90 # Delete `package-lock.json`, delete `node_modules` directory and run `npm install`.
91 # Run prisma client from `node_modules/.bin/prisma`.
92 # Run `./node_modules/.bin/prisma --version` and check if both prisma packages versions are equal, current platform is `linux-nixos`, and other keys equal to the prisma environment variables you defined for prisma.
93 # Test prisma with `generate`, `db push`, etc. It should work. If not, open an issue.