Skip to content

Commit

Permalink
Fix and update nix flake
Browse files Browse the repository at this point in the history
  • Loading branch information
aqrln committed Sep 11, 2023
1 parent 73113d0 commit dac5af4
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 43 deletions.
24 changes: 12 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 18 additions & 18 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 8 additions & 5 deletions nix/all-engines.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ pkgs, flakeInputs, lib, self', ... }:
{ pkgs, flakeInputs, lib, self', rustToolchain, ... }:

let
stdenv = pkgs.clangStdenv;
Expand All @@ -15,7 +15,7 @@ let
src = srcPath;
name = "prisma-engines-source";
};
craneLib = flakeInputs.crane.mkLib pkgs;
craneLib = (flakeInputs.crane.mkLib pkgs).overrideToolchain rustToolchain.default;
deps = craneLib.vendorCargoDeps { inherit src; };
libSuffix = stdenv.hostPlatform.extensions.sharedLibrary;
in
Expand All @@ -34,6 +34,7 @@ in
] ++ lib.optionals stdenv.isDarwin [
perl # required to build openssl
darwin.apple_sdk.frameworks.Security
iconv
];

configurePhase = ''
Expand All @@ -53,13 +54,15 @@ in
cp target/release/prisma-fmt $out/bin/
cp target/release/libquery_engine${libSuffix} $out/lib/libquery_engine.node
'';

dontStrip = true;
};

packages.test-cli = lib.makeOverridable
({ profile }: stdenv.mkDerivation {
name = "test-cli";
inherit src;
inherit (self'.packages.prisma-engines) buildInputs nativeBuildInputs configurePhase;
inherit (self'.packages.prisma-engines) buildInputs nativeBuildInputs configurePhase dontStrip;

buildPhase = "cargo build --profile=${profile} --bin=test-cli";

Expand All @@ -76,7 +79,7 @@ in
({ profile }: stdenv.mkDerivation {
name = "query-engine-bin";
inherit src;
inherit (self'.packages.prisma-engines) buildInputs nativeBuildInputs configurePhase;
inherit (self'.packages.prisma-engines) buildInputs nativeBuildInputs configurePhase dontStrip;

buildPhase = "cargo build --profile=${profile} --bin=query-engine";

Expand All @@ -96,7 +99,7 @@ in
({ profile }: stdenv.mkDerivation {
name = "query-engine-bin-and-lib";
inherit src;
inherit (self'.packages.prisma-engines) buildInputs nativeBuildInputs configurePhase;
inherit (self'.packages.prisma-engines) buildInputs nativeBuildInputs configurePhase dontStrip;

buildPhase = ''
cargo build --profile=${profile} --bin=query-engine
Expand Down
10 changes: 5 additions & 5 deletions nix/args.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
let
overlays = [
flakeInputs.rust-overlay.overlays.default
(self: super:
let toolchain = super.rust-bin.stable.latest; in
{ cargo = toolchain.minimal; rustc = toolchain.minimal; rustToolchain = toolchain; })
];
in
{ pkgs = import flakeInputs.nixpkgs { inherit system overlays; }; };
in rec
{
pkgs = import flakeInputs.nixpkgs { inherit system overlays; };
rustToolchain = pkgs.rust-bin.stable.latest;
};
}
4 changes: 2 additions & 2 deletions nix/shell.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ self', pkgs, ... }:
{ self', pkgs, rustToolchain, ... }:

let
devToolchain = pkgs.rustToolchain.default.override { extensions = [ "rust-analyzer" "rust-src" ]; };
devToolchain = rustToolchain.default.override { extensions = [ "rust-analyzer" "rust-src" ]; };
nodejs = pkgs.nodejs_latest;
in
{
Expand Down
2 changes: 1 addition & 1 deletion prisma-schema-wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ edition = "2021"
crate-type = ["cdylib"]

[dependencies]
wasm-bindgen = "=0.2.84"
wasm-bindgen = "=0.2.87"
wasm-logger = { version = "0.2.0", optional = true }
prisma-fmt = { path = "../prisma-fmt" }

0 comments on commit dac5af4

Please sign in to comment.