2023-07-15 17:15:38 +00:00
|
|
|
{
|
|
|
|
lib
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pkg-config
|
|
|
|
, udev
|
|
|
|
, stdenv
|
|
|
|
, Security
|
|
|
|
, nix-update-script
|
|
|
|
, openssl
|
|
|
|
, SystemConfiguration
|
|
|
|
}:
|
2022-09-22 12:36:57 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "cargo-espflash";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "2.0.0";
|
2022-09-22 12:36:57 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "esp-rs";
|
|
|
|
repo = "espflash";
|
|
|
|
rev = "v${version}";
|
2023-07-15 17:15:38 +00:00
|
|
|
hash = "sha256-3E0OC8DVP2muLyoN4DQfrdnK+idQEm7IpaA/CUIyYnU=";
|
2022-09-22 12:36:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
|
|
|
];
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
# Needed to get openssl-sys to use pkg-config.
|
|
|
|
OPENSSL_NO_VENDOR = 1;
|
|
|
|
|
|
|
|
buildInputs = [ openssl ] ++ lib.optionals stdenv.isLinux [
|
2022-09-22 12:36:57 +00:00
|
|
|
udev
|
2022-10-21 18:38:19 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
Security
|
2023-07-15 17:15:38 +00:00
|
|
|
SystemConfiguration
|
2022-09-22 12:36:57 +00:00
|
|
|
];
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
cargoHash = "sha256-8VIAmmtaQoIvD7wN+W3yUM0CEDadOQrv1wnJ4/AWKFA=";
|
|
|
|
|
|
|
|
passthru.updateScript = nix-update-script { };
|
2022-09-22 12:36:57 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Serial flasher utility for Espressif SoCs and modules based on esptool.py";
|
|
|
|
homepage = "https://github.com/esp-rs/cargo-espflash";
|
|
|
|
license = with licenses; [ mit /* or */ asl20 ];
|
|
|
|
maintainers = with maintainers; [ matthiasbeyer ];
|
|
|
|
};
|
|
|
|
}
|