1{
2 lib,
3 fetchCrate,
4 rustPlatform,
5 pkg-config,
6 openssl,
7 fetchurl,
8}:
9
10let
11 wasiPreviewCommandComponentAdapter = fetchurl {
12 url = "https://github.com/bytecodealliance/wasmtime/releases/download/v22.0.0/wasi_snapshot_preview1.command.wasm";
13 hash = "sha256-UVBFddlI0Yh1ZNs0b2jSnKsHvGGAS5U09yuwm8Q6lxw=";
14 };
15 wasiPreviewReactorComponentAdapter = fetchurl {
16 url = "https://github.com/bytecodealliance/wasmtime/releases/download/v22.0.0/wasi_snapshot_preview1.reactor.wasm";
17 hash = "sha256-oE53IRMZgysSWT7RhrpZJjdaIyzCRf0h4d1yjqj/PSk=";
18 };
19
20in
21rustPlatform.buildRustPackage rec {
22 pname = "wash-cli";
23 version = "0.39.0";
24
25 src = fetchCrate {
26 inherit version pname;
27 hash = "sha256-qOxYBhwkcn4g1cUBHuF0AoecpxN4ukgTjBnzVhWtw7A=";
28 };
29
30 cargoHash = "sha256-dPHzRZh5jBxbPt+1a9wVbsBclAkfrcAXhpZgTw7e4Qo=";
31
32 nativeBuildInputs = [ pkg-config ];
33
34 buildInputs = [ openssl ];
35
36 preBuild = "
37 export WASI_PREVIEW1_COMMAND_COMPONENT_ADAPTER=${wasiPreviewCommandComponentAdapter}
38 export WASI_PREVIEW1_REACTOR_COMPONENT_ADAPTER=${wasiPreviewReactorComponentAdapter}
39 ";
40
41 # Tests require the internet and don't work when running in nix
42 doCheck = false;
43
44 meta = with lib; {
45 description = "wasmCloud Shell (wash) CLI tool";
46 homepage = "https://wasmcloud.com/";
47 mainProgram = "wash";
48 license = licenses.asl20;
49 maintainers = with maintainers; [ bloveless ];
50 };
51}