nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 pkg-config,
5 fetchFromGitHub,
6 libusb1,
7}:
8
9# IMPORTANT: You need permissions to access the stlink usb devices.
10# Add services.udev.packages = [ pkgs.stlink ] to your configuration.nix
11stdenv.mkDerivation {
12 pname = "stlink-tool";
13 version = "0-unstable-2020-06-10";
14
15 src = fetchFromGitHub {
16 owner = "jeanthom";
17 repo = "stlink-tool";
18 rev = "8cbdffee012d5a782dd67d1277ed22fa889b9ba9";
19 hash = "sha256-1Mk4rFyIviJ9hcJo1GyzRmlPIemBJtuj3PgvnNhche0=";
20 fetchSubmodules = true;
21 };
22
23 buildInputs = [ libusb1 ];
24 nativeBuildInputs = [ pkg-config ];
25
26 env.NIX_CFLAGS_COMPILE = "-Wno-uninitialized";
27
28 installPhase = ''
29 runHook preInstall
30 install -D stlink-tool $out/bin/stlink-tool
31 runHook postInstall
32 '';
33
34 meta = {
35 description = "libusb tool for flashing chinese ST-Link dongles";
36 homepage = "https://github.com/jeanthom/stlink-tool";
37 license = lib.licenses.mit;
38 platforms = lib.platforms.unix;
39 maintainers = [ lib.maintainers.wucke13 ];
40 mainProgram = "stlink-tool";
41 };
42}