From 37850aef0c8906b3cddd141e83b986ad07c1b5f1 Mon Sep 17 00:00:00 2001 From: Christoph Honal Date: Thu, 14 Sep 2023 16:44:11 +0200 Subject: [PATCH] nrf-command-line-tools: init at 10.23.2 --- .../misc/nrf-command-line-tools/default.nix | 74 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 76 insertions(+) create mode 100755 pkgs/development/tools/misc/nrf-command-line-tools/default.nix diff --git a/pkgs/development/tools/misc/nrf-command-line-tools/default.nix b/pkgs/development/tools/misc/nrf-command-line-tools/default.nix new file mode 100755 index 000000000000000..204efae0972a452 --- /dev/null +++ b/pkgs/development/tools/misc/nrf-command-line-tools/default.nix @@ -0,0 +1,74 @@ +{ lib +, stdenv +, fetchurl +, autoPatchelfHook +, udev +, libusb1 +, segger-jlink +}: + +let + supported = { + x86_64-linux = { + name = "linux-amd64"; + hash = "sha256-zL9tXl2HsO8JZXEGsjg4+lDJJz30StOMH96rU7neDsg="; + }; + aarch64-linux = { + name = "linux-arm64"; + hash = "sha256-ACy3rXsvBZNVXdVkpP2AqrsoqKPliw6m9UUWrFOCBzs="; + }; + armv7l-linux = { + name = "linux-armhf"; + hash = "sha256-nD1pHL/SQqC7OlxuovWwvtnXKMmhfx5qFaF4ti8gh8g="; + }; + }; + + platform = supported.${stdenv.system} or (throw "unsupported platform ${stdenv.system}"); + + version = "10.23.2"; + + url = "https://nsscprodmedia.blob.core.windows.net/prod/software-and-other-downloads/desktop-software/nrf-command-line-tools/sw/versions-${lib.versions.major version}-x-x/${lib.versions.major version}-${lib.versions.minor version}-${lib.versions.patch version}/nrf-command-line-tools-${lib.versions.major version}.${lib.versions.minor version}.${lib.versions.patch version}_${platform.name}.tar.gz"; + +in stdenv.mkDerivation { + pname = "nrf-command-line-tools"; + inherit version; + + src = fetchurl { + inherit url; + inherit (platform) hash; + }; + + runtimeDependencies = [ + segger-jlink + ]; + + nativeBuildInputs = [ + autoPatchelfHook + ]; + + buildInputs = [ + udev + libusb1 + ]; + + dontConfigure = true; + dontBuild = true; + + installPhase = '' + runHook preInstall + + rm -rf ./python + mkdir -p $out + cp -r * $out + + runHook postInstall + ''; + + meta = with lib; { + description = "Nordic Semiconductor nRF Command Line Tools"; + homepage = "https://www.nordicsemi.com/Products/Development-tools/nRF-Command-Line-Tools"; + license = licenses.unfree; + platforms = attrNames supported; + maintainers = with maintainers; [ stargate01 ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index cf68289c7272171..755dad40cbc0da6 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -19742,6 +19742,8 @@ with pkgs; sdk = true; }; + nrf-command-line-tools = callPackage ../development/tools/misc/nrf-command-line-tools { }; + nrf5-sdk = callPackage ../development/libraries/nrf5-sdk { }; nrfconnect = callPackage ../tools/bluetooth/nrfconnect { };