mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-08-27 02:34:53 +00:00
This commit was created by a combination of scripts and tools: - an ast-grep script to prefix things in meta with `lib.`, - a modified nixf-diagnose / nixf combination to remove unused `with lib;`, and - regular nixfmt. Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
43 lines
1.0 KiB
Nix
43 lines
1.0 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
pkg-config,
|
|
fetchFromGitHub,
|
|
libusb1,
|
|
}:
|
|
|
|
# IMPORTANT: You need permissions to access the stlink usb devices.
|
|
# Add services.udev.packages = [ pkgs.stlink ] to your configuration.nix
|
|
stdenv.mkDerivation {
|
|
pname = "stlink-tool";
|
|
version = "0-unstable-2020-06-10";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "jeanthom";
|
|
repo = "stlink-tool";
|
|
rev = "8cbdffee012d5a782dd67d1277ed22fa889b9ba9";
|
|
hash = "sha256-1Mk4rFyIviJ9hcJo1GyzRmlPIemBJtuj3PgvnNhche0=";
|
|
fetchSubmodules = true;
|
|
};
|
|
|
|
buildInputs = [ libusb1 ];
|
|
nativeBuildInputs = [ pkg-config ];
|
|
|
|
env.NIX_CFLAGS_COMPILE = "-Wno-uninitialized";
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
install -D stlink-tool $out/bin/stlink-tool
|
|
runHook postInstall
|
|
'';
|
|
|
|
meta = {
|
|
description = "libusb tool for flashing chinese ST-Link dongles";
|
|
homepage = "https://github.com/jeanthom/stlink-tool";
|
|
license = lib.licenses.mit;
|
|
platforms = lib.platforms.unix;
|
|
maintainers = [ lib.maintainers.wucke13 ];
|
|
mainProgram = "stlink-tool";
|
|
};
|
|
}
|