Skip to content

Commit

Permalink
nrf-command-line-tools: init at 10.23.0
Browse files Browse the repository at this point in the history
  • Loading branch information
StarGate01 committed Sep 14, 2023
1 parent 06a261c commit 9c074f6
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 0 deletions.
76 changes: 76 additions & 0 deletions pkgs/development/tools/misc/nrf-command-line-tools/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{ lib
, stdenv
, fetchurl
, autoPatchelfHook
, udev
, libusb1
, segger-jlink
}:

let
supported = {
x86_64-linux = {
name = "linux-amd64";
sha256 = "1b69272c704f4526b8560fe3c64b92769626261c2a285258bde550d3dd218873";
};
aarch64-linux = {
name = "linux-arm64";
sha256 = "bcad32f9340c60374589e6613aa773dd9255e0cea7c50b9bd83ee47ca170a536";
};
armv7l-linux = {
name = "linux-armhf";
sha256 = "7b217b434e675dba4ae3a6f611fb9e15835bbe106fd1a4a4052ae68954111a2e";
};
};

platform = supported.${stdenv.system} or (throw "unsupported platform ${stdenv.system}");

version = "10.23.0";

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) sha256;
};

runtimeDependencies = [
segger-jlink
];

nativeBuildInputs = [
autoPatchelfHook
];

buildInputs = [
udev
libusb1
];

dontConfigure = true;
dontBuild = true;

installPhase = ''
runHook preInstall
rm -rf ./python
mkdir -p $out
cp -r * $out
chmod +x $out/lib/*
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 ];
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19907,6 +19907,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 { };
Expand Down

0 comments on commit 9c074f6

Please sign in to comment.