1 { version, hash, outputHashes, cargoLock, patches }:
3 { lib, stdenv, fetchFromGitHub
4 , cargo, rustPlatform, rustc, napi-rs-cli, nodejs, libiconv
7 stdenv.mkDerivation rec {
8 pname = "matrix-sdk-crypto-nodejs";
9 inherit version patches;
11 src = fetchFromGitHub {
13 repo = "matrix-rust-sdk";
14 rev = "${pname}-v${version}";
19 cargoDeps = rustPlatform.importCargoLock {
25 rustPlatform.cargoSetupHook
32 buildInputs = lib.optionals stdenv.isDarwin [ libiconv ];
38 npm run release-build --offline
46 local -r outPath="$out/lib/node_modules/@matrix-org/${pname}"
48 cp package.json index.js index.d.ts matrix-sdk-crypto.*.node "$outPath"
54 description = "A no-network-IO implementation of a state machine that handles E2EE for Matrix clients";
55 homepage = "https://github.com/matrix-org/matrix-rust-sdk/tree/${src.rev}/bindings/matrix-sdk-crypto-nodejs";
56 license = licenses.asl20;
57 maintainers = with maintainers; [ winter ];
58 inherit (nodejs.meta) platforms;