1{ stdenv, lib, rustPlatform, fetchFromGitHub, makeWrapper, cargo-watch, zig, Security }:
2
3rustPlatform.buildRustPackage rec {
4 pname = "cargo-lambda";
5 version = "0.11.3";
6
7 src = fetchFromGitHub {
8 owner = pname;
9 repo = pname;
10 rev = "v${version}";
11 sha256 = "sha256-dEJOoV91DIQL7KPbLQrgCKdCF7ZMSZMHVLq6l1sg4F0=";
12 };
13
14 cargoSha256 = "sha256-qW4a4VPpPSdt0Z4nRA4/fHpW0cfDxOPQyEAdJidt+0o=";
15
16 buildInputs = lib.optionals stdenv.isDarwin [ Security ];
17
18 nativeBuildInputs = [ makeWrapper ];
19
20 postInstall = ''
21 wrapProgram $out/bin/cargo-lambda --prefix PATH : ${lib.makeBinPath [ cargo-watch zig ]}
22 '';
23
24 checkFlags = [
25 # Disabled because it accesses the network.
26 "--skip test_download_example"
27 # Disabled because it makes assumptions about the file system.
28 "--skip test_target_dir_from_env"
29 ];
30
31 meta = with lib; {
32 description = "A Cargo subcommand to help you work with AWS Lambda";
33 homepage = "https://cargo-lambda.info";
34 license = licenses.mit;
35 maintainers = with maintainers; [ taylor1791 calavera ];
36 };
37}