lol
1{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, libusb1, pico-sdk }:
2
3stdenv.mkDerivation rec {
4 pname = "picotool";
5 version = "1.1.2";
6
7 src = fetchFromGitHub {
8 owner = "raspberrypi";
9 repo = pname;
10 rev = version;
11 sha256 = "sha256-OcQJeiva6X2rUyh1rJ+w4O2dWxaR7MwMfbHlnWuBVb8=";
12 };
13
14 buildInputs = [ libusb1 pico-sdk ];
15 nativeBuildInputs = [ cmake pkg-config ];
16 cmakeFlags = [ "-DPICO_SDK_PATH=${pico-sdk}/lib/pico-sdk" ];
17
18 postInstall = ''
19 install -Dm444 ../udev/99-picotool.rules -t $out/etc/udev/rules.d
20 '';
21
22 meta = with lib; {
23 homepage = "https://github.com/raspberrypi/picotool";
24 description = "Tool for interacting with a RP2040 device in BOOTSEL mode, or with a RP2040 binary";
25 license = licenses.bsd3;
26 maintainers = with maintainers; [ muscaln ];
27 platforms = platforms.unix;
28 };
29}