1{ lib, rustPlatform, fetchFromGitHub, pkg-config, udev, stdenv, Security }:
2
3rustPlatform.buildRustPackage rec {
4 pname = "cargo-espflash";
5 version = "1.7.0";
6
7 src = fetchFromGitHub {
8 owner = "esp-rs";
9 repo = "espflash";
10 rev = "v${version}";
11 sha256 = "sha256-AauIneSnacnY4mulD/qUgfN4K9tLzZXFug0oEsDuj18=";
12 };
13
14 nativeBuildInputs = [
15 pkg-config
16 ];
17
18 buildInputs = lib.optionals stdenv.isLinux [
19 udev
20 ] ++ lib.optionals stdenv.isDarwin [
21 Security
22 ];
23
24 cargoSha256 = "sha256-82o3B6qmBVPpBVAogClmTbxrBRXY8Lmd2sHmonP5/s8=";
25
26 meta = with lib; {
27 description = "Serial flasher utility for Espressif SoCs and modules based on esptool.py";
28 homepage = "https://github.com/esp-rs/cargo-espflash";
29 license = with licenses; [ mit /* or */ asl20 ];
30 maintainers = with maintainers; [ matthiasbeyer ];
31 };
32}