Add zephyr sdk package for putting everything together

This commit is contained in:
Artemis Tosini 2023-11-12 03:40:37 +00:00
parent 2e3f4a4adf
commit f728872208
Signed by: artemist
GPG key ID: ADFFE553DCBB831E
2 changed files with 27 additions and 0 deletions

View file

@ -11,4 +11,10 @@ in rec {
inherit target sources; inherit target sources;
inherit (assets) version hosts; inherit (assets) version hosts;
}) assets.toolchains; }) assets.toolchains;
sdk = callPackage ./sdk.nix {
inherit host-tools;
inherit (assets) version hosts;
source = assets.sdk;
};
} }

21
packages/zephyr/sdk.nix Normal file
View file

@ -0,0 +1,21 @@
{ lib, symlinkJoin, fetchurl, host-tools, source, version, hosts
, toolchains ? [ ] }:
let src = fetchurl source;
in symlinkJoin rec {
pname = "zephyr-sdk";
inherit version;
name = "${pname}-${version}";
paths = [ host-tools ] ++ toolchains;
postBuild = ''
tar -C "$out" -xf "${src}" --exclude setup.sh --exclude sdk_toolchains --strip-components=1
'';
meta = with lib; {
homepage = "https://www.zephyrproject.org/";
description = "Full Zephyr SDK with customized toolchains";
license = licenses.asl20;
platforms = hosts;
maintainers = with maintainers; [ artemist ];
};
}