push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,70 @@
{
lib,
stdenvNoCC,
fetchurl,
zlib,
libusb1,
segger-jlink-headless,
gcc,
autoPatchelfHook,
versionCheckHook,
}:
let
source = import ./source.nix;
supported = removeAttrs source [ "version" ];
platform = supported.${stdenvNoCC.system} or (throw "unsupported platform ${stdenvNoCC.system}");
in
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "nrfutil";
inherit (source) version;
src = fetchurl {
url = "https://files.nordicsemi.com/artifactory/swtools/external/nrfutil/packages/nrfutil/nrfutil-${platform.name}-${finalAttrs.version}.tar.gz";
inherit (platform) hash;
};
nativeBuildInputs = [
autoPatchelfHook
];
buildInputs = [
zlib
libusb1
gcc.cc.lib
segger-jlink-headless
];
dontConfigure = true;
dontBuild = true;
installPhase = ''
runHook preInstall
mkdir -p $out
mv data/* $out/
runHook postInstall
'';
doInstallCheck = true;
nativeInstallCheckInputs = [
versionCheckHook
];
passthru.updateScript = ./update.sh;
meta = with lib; {
description = "CLI tool for managing Nordic Semiconductor devices";
homepage = "https://www.nordicsemi.com/Products/Development-tools/nRF-Util";
changelog = "https://docs.nordicsemi.com/bundle/nrfutil/page/guides/revision_history.html";
license = licenses.unfree;
platforms = lib.attrNames supported;
maintainers = with maintainers; [
h7x4
ezrizhu
];
mainProgram = "nrfutil";
};
})

View File

@@ -0,0 +1,7 @@
{
version = "7.13.0";
x86_64-linux = {
name = "x86_64-unknown-linux-gnu";
hash = "sha256-R3OF/340xEab+0zamfwvejY16fjy/3TrzMvQaBlVxHw=";
};
}

View File

@@ -0,0 +1,35 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p jq nix nix-prefetch-github
nixpkgs="$(git rev-parse --show-toplevel || (printf 'Could not find root of nixpkgs repo\nAre we running from within the nixpkgs git repo?\n' >&2; exit 1))"
narhash() {
nix --extra-experimental-features nix-command store prefetch-file --json "$1" | jq -r .hash
}
set -euo pipefail
declare -A architectures
declare -A versions
declare -A hashes
architectures["x86_64-linux"]="x86_64-unknown-linux-gnu"
BASE_URL="https://files.nordicsemi.com/artifactory/swtools/external/nrfutil"
for a in ${!architectures[@]}; do
versions["$a"]=$(curl "$BASE_URL/index/${architectures[${a}]}/index.json" | jq -r '.packages.nrfutil.latest_version')
hashes["$a"]=$(narhash "$BASE_URL/packages/nrfutil/nrfutil-${architectures[${a}]}-${versions[${a}]}.tar.gz")
done
{
printf "{\n"
printf " version = \"${versions["x86_64-linux"]}\";\n"
for a in ${!architectures[@]}; do
printf " ${a} = {\n"
printf " name = \"${architectures[${a}]}\";\n"
printf " hash = \"${hashes[${a}]}\";\n"
printf " };\n"
done
printf "}\n"
} > "${nixpkgs}/pkgs/by-name/nr/nrfutil/source.nix"