diff --git a/packages/zephyr/default.nix b/packages/zephyr/default.nix index 6844833..0b4d7f5 100644 --- a/packages/zephyr/default.nix +++ b/packages/zephyr/default.nix @@ -11,4 +11,10 @@ in rec { inherit target sources; inherit (assets) version hosts; }) assets.toolchains; + + sdk = callPackage ./sdk.nix { + inherit host-tools; + inherit (assets) version hosts; + source = assets.sdk; + }; } diff --git a/packages/zephyr/sdk.nix b/packages/zephyr/sdk.nix new file mode 100644 index 0000000..43105cd --- /dev/null +++ b/packages/zephyr/sdk.nix @@ -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 ]; + }; +}