Skip to content

Commit

Permalink
Merge pull request #3192 from prisma/prisma-engines-derivation-in-flake
Browse files Browse the repository at this point in the history
  • Loading branch information
tomhoule committed Sep 15, 2022
2 parents 0827b8d + 13aa8a6 commit 06b6b4b
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions flake.nix
Expand Up @@ -14,8 +14,63 @@
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs { inherit system overlays; };
shell = import ./shell.nix { inherit pkgs; };
inherit (pkgs) lib rustPlatform;
in
{
packages = {
prisma-engines = rustPlatform.buildRustPackage
{
name = "prisma-engines";
src = builtins.path {
path = ./.;
name = "prisma-engines-workspace-root-path";
};
cargoLock = {
lockFile = ./Cargo.lock;
# Hashes are required for git dependencies.
outputHashes = {
"barrel-0.6.6-alpha.0" = "sha256-USh0lQ1z+3Spgc69bRFySUzhuY79qprLlEExTmYWFN8=";
"graphql-parser-0.3.0" = "sha256-0ZAsj2mW6fCLhwTETucjbu4rPNzfbNiHu2wVTBlTNe4=";
"mobc-0.7.3" = "sha256-88jSFqOyMy2E7TP1HtMcE4CQXoKhBpO8XuSFKGtfgqA=";
"mysql_async-0.30.0" = "sha256-I1Q9G3H3BW/Paq9aOYGcxQf4JVwN/ZNhGuHwTqbuxWc=";
"postgres-native-tls-0.5.0" = "sha256-kwqHalfwrvNQYUdAqObTAab3oWzBLl6hab2JGXVyJ3k=";
"quaint-0.2.0-alpha.13" = "sha256-8vaYhXSFTibNLt+yTj+RQepzJ8CzWthhgQXVtSl+DhI=";
"tokio-native-tls-0.3.0" = "sha256-ayH3TJ1iUQeZicR2nrsuxLykMoPL1fYBqRb21ValR5Q=";
};
};

cargoBuildFlags = ''
--package introspection-core
--package migration-engine-cli
--package prisma-fmt
--package query-engine
--package query-engine-node-api
'';

# Exclude the test suites that rely on a live database.
cargoTestFlags = ''
--workspace
--exclude query-engine-tests
--exclude migration-engine-tests
--exclude introspection-engine-tests
--exclude migration-engine-cli
--exclude mongodb-introspection-connector
--exclude mongodb-migration-connector
--exclude sql-schema-describer
'';

buildInputs = with pkgs; [
openssl
];

nativeBuildInputs = with pkgs; [
pkg-config
protobuf
rust-bin.stable.latest.minimal
];
};
};

devShell = shell;
}
);
Expand Down

0 comments on commit 06b6b4b

Please sign in to comment.