devShells.zephyr: add option for modules

This commit is contained in:
Artemis Tosini 2023-11-13 05:59:59 +00:00
parent da07bd75a0
commit 8483d4813a
Signed by: artemist
GPG key ID: EE5227935FE3FF18

View file

@ -1,6 +1,7 @@
{ 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, extraPackages ? [ ], extraAttrs ? { } }: , zephyrSrc ? zephyr.src, modules ? [ ], 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;
@ -27,4 +28,6 @@ in mkShell ({
shellHook = '' shellHook = ''
PATH="${zephyrSrc}/scripts:$PATH" PATH="${zephyrSrc}/scripts:$PATH"
''; '';
} // lib.optionalAttrs (modules != [ ]) {
ZEPHYR_MODULES = lib.concatStringsSep ";" (map (pkg: pkg.out) modules);
} // extraAttrs) } // extraAttrs)