devShells.zephyr: add extraAttrs and extraPackages

This commit is contained in:
Artemis Tosini 2023-11-12 21:21:51 +00:00
parent 0454b989b5
commit 3de0f648f8
Signed by: artemist
GPG key ID: ADFFE553DCBB831E

View file

@ -1,6 +1,6 @@
{ lib, mkShell, zephyr, cmake, ninja, gnumake, python3 { lib, mkShell, zephyr, cmake, ninja, gnumake, python3
, toolchains ? with zephyr.toolchains; [ arm-zephyr-eabi ], enableWest ? false , toolchains ? with zephyr.toolchains; [ arm-zephyr-eabi ], enableWest ? false
, zephyrSrc ? null }: , zephyrSrc ? null, extraPackages ? [ ], extraAttrs ? { } }:
let zephyr-sdk = zephyr.sdk.override { inherit toolchains; }; let zephyr-sdk = zephyr.sdk.override { inherit toolchains; };
in mkShell { in mkShell {
packages = [ cmake ninja gnumake python3 ] ++ (with python3.pkgs; packages = [ cmake ninja gnumake python3 ] ++ (with python3.pkgs;
@ -18,7 +18,7 @@ in mkShell {
requests requests
anytree anytree
intelhex intelhex
] ++ lib.optional enableWest python3.pkgs.west); ] ++ lib.optional enableWest python3.pkgs.west ++ extraPackages);
ZEPHYR_TOOLCHAIN_VARIANT = "zephyr"; ZEPHYR_TOOLCHAIN_VARIANT = "zephyr";
ZEPHYR_SDK_INSTALL_DIR = "${zephyr-sdk}"; ZEPHYR_SDK_INSTALL_DIR = "${zephyr-sdk}";
@ -27,4 +27,4 @@ in mkShell {
shellHook = '' shellHook = ''
PATH="${zephyrSrc}/scripts:$PATH" PATH="${zephyrSrc}/scripts:$PATH"
''; '';
} } // extraAttrs