devShells.zephyr: allow disabling west, adding zephyr source

This commit is contained in:
Artemis Tosini 2023-11-12 19:10:00 +00:00
parent adfa8f8a6e
commit 0454b989b5
Signed by: artemist
GPG key ID: EE5227935FE3FF18

View file

@ -1,24 +1,30 @@
{ mkShell, zephyr, cmake, ninja, gnumake, python3 { lib, mkShell, zephyr, cmake, ninja, gnumake, python3
, toolchains ? with zephyr.toolchains; [ arm-zephyr-eabi ] }: , toolchains ? with zephyr.toolchains; [ arm-zephyr-eabi ], enableWest ? false
, zephyrSrc ? null }:
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;
# requirements-base.txt [
pyelftools # requirements-base.txt
pyyaml pyelftools
pykwalify pyyaml
canopen pykwalify
packaging canopen
progress packaging
psutil progress
pylink-square psutil
pyserial pylink-square
requests pyserial
anytree requests
intelhex anytree
west intelhex
]); ] ++ lib.optional enableWest python3.pkgs.west);
ZEPHYR_TOOLCHAIN_VARIANT = "zephyr"; ZEPHYR_TOOLCHAIN_VARIANT = "zephyr";
ZEPHYR_SDK_INSTALL_DIR = "${zephyr-sdk}"; ZEPHYR_SDK_INSTALL_DIR = "${zephyr-sdk}";
} // lib.optionalAttrs (zephyrSrc != null) {
ZEPHYR_BASE = "${zephyrSrc}";
shellHook = ''
PATH="${zephyrSrc}/scripts:$PATH"
'';
} }