2023-07-09 23:06:52 +00:00
|
|
|
{
|
|
|
|
lib
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pkg-config
|
2024-02-12 12:14:57 +00:00
|
|
|
, installShellFiles
|
2023-07-09 23:06:52 +00:00
|
|
|
, udev
|
|
|
|
, stdenv
|
2024-03-28 11:04:37 +00:00
|
|
|
, CoreServices
|
2023-07-09 23:06:52 +00:00
|
|
|
, Security
|
|
|
|
, nix-update-script
|
|
|
|
, openssl
|
|
|
|
, SystemConfiguration
|
|
|
|
}:
|
2022-09-16 14:02:09 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
2024-02-09 16:50:17 +00:00
|
|
|
pname = "espflash";
|
2024-08-15 09:08:59 +00:00
|
|
|
version = "3.1.1";
|
2022-09-16 14:02:09 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "esp-rs";
|
|
|
|
repo = "espflash";
|
2024-08-15 09:08:59 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-NplHzdUHlBgujH8rLYT5VbYBV7NljMJEbMAxZ5ZK8JY=";
|
2022-09-16 14:02:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
2024-02-12 12:14:57 +00:00
|
|
|
installShellFiles
|
2022-09-16 14:02:09 +00:00
|
|
|
];
|
|
|
|
|
2023-07-09 23:06:52 +00:00
|
|
|
# Needed to get openssl-sys to use pkg-config.
|
|
|
|
OPENSSL_NO_VENDOR = 1;
|
|
|
|
|
|
|
|
buildInputs = [ openssl ] ++ lib.optionals stdenv.isLinux [
|
2022-09-16 14:02:09 +00:00
|
|
|
udev
|
2022-10-16 00:28:50 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
2024-03-28 11:04:37 +00:00
|
|
|
CoreServices
|
2022-10-16 00:28:50 +00:00
|
|
|
Security
|
2023-07-09 23:06:52 +00:00
|
|
|
SystemConfiguration
|
2022-09-16 14:02:09 +00:00
|
|
|
];
|
|
|
|
|
2024-08-15 09:08:59 +00:00
|
|
|
cargoHash = "sha256-iA8VJj0btFHUoyY7w8kR+9AU5Yrts4ctr90jxlWQu4c=";
|
2023-07-09 23:06:52 +00:00
|
|
|
|
2024-02-12 12:14:57 +00:00
|
|
|
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
|
|
|
installShellCompletion --cmd espflash \
|
|
|
|
--bash <($out/bin/espflash completions bash) \
|
|
|
|
--zsh <($out/bin/espflash completions zsh) \
|
|
|
|
--fish <($out/bin/espflash completions fish)
|
|
|
|
'';
|
|
|
|
|
2023-07-09 23:06:52 +00:00
|
|
|
passthru.updateScript = nix-update-script { };
|
2022-09-16 14:02:09 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Serial flasher utility for Espressif SoCs and modules based on esptool.py";
|
2024-02-09 16:50:17 +00:00
|
|
|
homepage = "https://github.com/esp-rs/espflash";
|
|
|
|
changelog = "https://github.com/esp-rs/espflash/blob/v${version}/CHANGELOG.md";
|
|
|
|
mainProgram = "espflash";
|
2022-09-19 12:31:30 +00:00
|
|
|
license = with licenses; [ mit /* or */ asl20 ];
|
2022-09-16 14:02:09 +00:00
|
|
|
maintainers = with maintainers; [ matthiasbeyer ];
|
|
|
|
};
|
|
|
|
}
|