lol
1{
2 lib
3, rustPlatform
4, fetchFromGitHub
5, pkg-config
6, udev
7, stdenv
8, Security
9, nix-update-script
10, openssl
11, SystemConfiguration
12}:
13
14rustPlatform.buildRustPackage rec {
15 pname = "cargo-espflash";
16 version = "2.1.0";
17
18 src = fetchFromGitHub {
19 owner = "esp-rs";
20 repo = "espflash";
21 rev = "v${version}";
22 hash = "sha256-Nv2/33VYpCkPYyUhlVDYJR1BkbtEvEPtmgyZXfVn1ug=";
23 };
24
25 nativeBuildInputs = [
26 pkg-config
27 ];
28
29 # Needed to get openssl-sys to use pkg-config.
30 OPENSSL_NO_VENDOR = 1;
31
32 buildInputs = [ openssl ] ++ lib.optionals stdenv.isLinux [
33 udev
34 ] ++ lib.optionals stdenv.isDarwin [
35 Security
36 SystemConfiguration
37 ];
38
39 cargoHash = "sha256-FpBc92a2JQHRLe5S6yh3l0FpRI8LpkGGEma/4v5X4xs=";
40
41 passthru.updateScript = nix-update-script { };
42
43 meta = with lib; {
44 description = "Serial flasher utility for Espressif SoCs and modules based on esptool.py";
45 homepage = "https://github.com/esp-rs/cargo-espflash";
46 license = with licenses; [ mit /* or */ asl20 ];
47 maintainers = with maintainers; [ matthiasbeyer ];
48 };
49}