2023-11-12 19:10:00 +00:00
|
|
|
{ lib, mkShell, zephyr, cmake, ninja, gnumake, python3
|
|
|
|
, toolchains ? with zephyr.toolchains; [ arm-zephyr-eabi ], enableWest ? false
|
2023-11-13 05:59:59 +00:00
|
|
|
, zephyrSrc ? zephyr.src, modules ? [ ], extraPackages ? [ ], extraAttrs ? { }
|
|
|
|
}:
|
2023-11-12 05:10:09 +00:00
|
|
|
let zephyr-sdk = zephyr.sdk.override { inherit toolchains; };
|
2023-11-12 22:24:55 +00:00
|
|
|
in mkShell ({
|
2023-11-12 19:10:00 +00:00
|
|
|
packages = [ cmake ninja gnumake python3 ] ++ (with python3.pkgs;
|
|
|
|
[
|
|
|
|
# requirements-base.txt
|
|
|
|
pyelftools
|
|
|
|
pyyaml
|
|
|
|
pykwalify
|
|
|
|
canopen
|
|
|
|
packaging
|
|
|
|
progress
|
|
|
|
psutil
|
|
|
|
pylink-square
|
|
|
|
pyserial
|
|
|
|
requests
|
|
|
|
anytree
|
|
|
|
intelhex
|
2023-11-12 21:21:51 +00:00
|
|
|
] ++ lib.optional enableWest python3.pkgs.west ++ extraPackages);
|
2023-11-12 05:10:09 +00:00
|
|
|
|
|
|
|
ZEPHYR_TOOLCHAIN_VARIANT = "zephyr";
|
|
|
|
ZEPHYR_SDK_INSTALL_DIR = "${zephyr-sdk}";
|
2023-11-12 19:10:00 +00:00
|
|
|
} // lib.optionalAttrs (zephyrSrc != null) {
|
|
|
|
ZEPHYR_BASE = "${zephyrSrc}";
|
|
|
|
shellHook = ''
|
|
|
|
PATH="${zephyrSrc}/scripts:$PATH"
|
|
|
|
'';
|
2023-11-13 05:59:59 +00:00
|
|
|
} // lib.optionalAttrs (modules != [ ]) {
|
2023-11-13 06:48:03 +00:00
|
|
|
ZEPHYR_MODULES =
|
|
|
|
lib.concatStringsSep ";" (map (pkg: pkg.passthru.modulePath) modules);
|
2023-11-12 22:24:55 +00:00
|
|
|
} // extraAttrs)
|