nixpkgs-suyu/pkgs/development/tools/misc/stlink/default.nix

34 lines
957 B
Nix
Raw Normal View History

{ stdenv, fetchFromGitHub, cmake, libusb1 }:
# IMPORTANT: You need permissions to access the stlink usb devices.
# Add services.udev.pkgs = [ pkgs.stlink ] to your configuration.nix
2020-02-27 17:40:28 +01:00
stdenv.mkDerivation rec {
2019-08-13 23:52:01 +02:00
pname = "stlink";
2020-02-27 17:40:28 +01:00
version = "1.6.0";
src = fetchFromGitHub {
owner = "texane";
repo = "stlink";
2020-02-27 17:40:28 +01:00
rev = "v${version}";
2020-02-25 02:16:26 +01:00
sha256 = "1mlkrxjxg538335g59hjb0zc739dx4mhbspb26z5gz3lf7d4xv6x";
};
buildInputs = [ cmake libusb1 ];
patchPhase = ''
sed -i 's@/etc/udev/rules.d@$ENV{out}/etc/udev/rules.d@' CMakeLists.txt
sed -i 's@/etc/modprobe.d@$ENV{out}/etc/modprobe.d@' CMakeLists.txt
'';
preInstall = ''
mkdir -p $out/etc/udev/rules.d
mkdir -p $out/etc/modprobe.d
'';
meta = with stdenv.lib; {
description = "In-circuit debug and programming for ST-Link devices";
license = licenses.bsd3;
platforms = platforms.unix;
maintainers = [ maintainers.bjornfor maintainers.rongcuid ];
};
}