nixpkgs/pkgs/development/tools/rust/cargo-espflash/default.nix
Cody P Schafer 7345d52e87
cargo-espflash: fix build on darwin
- udev is only needed on linux (and is blocked from building on darwin
   via systemd being marked as broken)
 - Security is required (otherwise a link error occurs)
2022-10-15 20:45:55 -04:00

33 lines
854 B
Nix

{ lib, rustPlatform, fetchFromGitHub, pkg-config, udev, stdenv, Security }:
rustPlatform.buildRustPackage rec {
pname = "cargo-espflash";
version = "1.7.0";
src = fetchFromGitHub {
owner = "esp-rs";
repo = "espflash";
rev = "v${version}";
sha256 = "sha256-AauIneSnacnY4mulD/qUgfN4K9tLzZXFug0oEsDuj18=";
};
nativeBuildInputs = [
pkg-config
];
buildInputs = lib.optionals stdenv.isLinux [
udev
] ++ lib.optionals stdenv.isDarwin [
Security
];
cargoSha256 = "sha256-82o3B6qmBVPpBVAogClmTbxrBRXY8Lmd2sHmonP5/s8=";
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 ];
};
}