diff --git a/pkgs/by-name/pi/picotool/package.nix b/pkgs/by-name/pi/picotool/package.nix index 54a8b4f8e6d9..76460c9d24e5 100644 --- a/pkgs/by-name/pi/picotool/package.nix +++ b/pkgs/by-name/pi/picotool/package.nix @@ -7,17 +7,19 @@ libusb1, pico-sdk, mbedtls_2, + versionCheckHook, + gitUpdater, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "picotool"; - version = "2.0.0"; + version = "2.1.0"; src = fetchFromGitHub { owner = "raspberrypi"; - repo = pname; - rev = version; - sha256 = "sha256-z7EFk3qxg1PoKZQpUQqjhttZ2RkhhhiMdYc9TkXzkwk="; + repo = "picotool"; + tag = finalAttrs.version; + hash = "sha256-aGhh19/dl6o/3hbmKJGVh22qSHeCqxST2PoWzxmc7KQ="; }; postPatch = '' @@ -42,12 +44,23 @@ stdenv.mkDerivation rec { install -Dm444 ../udev/99-picotool.rules -t $out/etc/udev/rules.d ''; - meta = with lib; { - homepage = "https://github.com/raspberrypi/picotool"; - description = "Tool for interacting with RP2040/RP2350 device(s) in BOOTSEL mode, or with an RP2040/RP2350 binary"; - mainProgram = "picotool"; - license = licenses.bsd3; - maintainers = with maintainers; [ muscaln ]; - platforms = platforms.unix; + nativeInstallCheckInputs = [ + versionCheckHook + ]; + versionCheckProgramArg = [ "version" ]; + doInstallCheck = true; + + passthru = { + updateScript = gitUpdater { }; }; -} + + meta = { + description = "Tool for interacting with RP2040/RP2350 device(s) in BOOTSEL mode, or with an RP2040/RP2350 binary"; + homepage = "https://github.com/raspberrypi/picotool"; + changelog = "https://github.com/raspberrypi/picotool/releases/tag/${finalAttrs.version}"; + mainProgram = "picotool"; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ muscaln ]; + platforms = lib.platforms.unix; + }; +})