16 rustPlatform.buildRustPackage rec {
20 src = fetchFromGitHub {
23 rev = "refs/tags/v${version}";
24 hash = "sha256-X9VTwXk/6zAkQb5P9Wz8Pt4oIt2xXfff9dhGb8wauG4=";
32 # Needed to get openssl-sys to use pkg-config.
33 OPENSSL_NO_VENDOR = 1;
35 buildInputs = [ openssl ] ++ lib.optionals stdenv.hostPlatform.isLinux [
37 ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
43 cargoHash = "sha256-3xUDsznzIRlfGwVuIH1+Ub5tE/ST981KZS/2TAKaBAE=";
45 postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
46 installShellCompletion --cmd espflash \
47 --bash <($out/bin/espflash completions bash) \
48 --zsh <($out/bin/espflash completions zsh) \
49 --fish <($out/bin/espflash completions fish)
52 passthru.updateScript = nix-update-script { };
55 description = "Serial flasher utility for Espressif SoCs and modules based on esptool.py";
56 homepage = "https://github.com/esp-rs/espflash";
57 changelog = "https://github.com/esp-rs/espflash/blob/v${version}/CHANGELOG.md";
58 mainProgram = "espflash";
59 license = with licenses; [ mit /* or */ asl20 ];
60 maintainers = with maintainers; [ matthiasbeyer ];