Last active
December 10, 2022 19:35
-
-
Save d3zd3z/d56a0f1e8b0e06adcf09147eba248196 to your computer and use it in GitHub Desktop.
nix-shell for Zephyr development
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Shell configuration for Zephyr work | |
# This currently requires the unstable channel for the newest tools. | |
{ pkgs ? import <unstable> {} }: | |
let | |
python-packages = pkgs.python3.withPackages(p: with p; [ | |
pyelftools | |
pyyaml | |
pykwalify | |
canopen | |
packaging | |
progress | |
psutil | |
anytree | |
intelhex | |
west | |
cryptography | |
intelhex | |
click | |
cbor | |
]); | |
packages = with pkgs; [ | |
gcc-arm-embedded | |
cmake | |
ninja | |
gperf | |
python3 | |
ccache | |
qemu | |
dtc | |
(python-packages) | |
# For mcuboot development, we want both Rust and go. | |
go | |
openssl.dev | |
pkgconfig | |
sqlite.dev | |
cargo | |
]; | |
in | |
pkgs.mkShell { | |
nativeBuildInputs = packages; | |
shellHook = '' | |
export ZEPHYR_TOOLCHAIN_VARIANT=gnuarmemb | |
export GNUARMEMB_TOOLCHAIN_PATH=${pkgs.gcc-arm-embedded} | |
source ./zephyr/zephyr-env.sh | |
''; | |
} |
i had to use
nix eval --raw
on #L33 to make theGNUARMEMB_TOOLCHAIN_PATH
work.
I'm not actually sure why I didn't, but --raw seems better.
This version expands directly using nix instead of having to run something to do it.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
i had to use
nix eval --raw
on #L33 to make theGNUARMEMB_TOOLCHAIN_PATH
work.