Skip to content

Instantly share code, notes, and snippets.

@d3zd3z
Last active December 10, 2022 19:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save d3zd3z/d56a0f1e8b0e06adcf09147eba248196 to your computer and use it in GitHub Desktop.
Save d3zd3z/d56a0f1e8b0e06adcf09147eba248196 to your computer and use it in GitHub Desktop.
nix-shell for Zephyr development
# 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
'';
}
@leonardp
Copy link

leonardp commented Mar 7, 2021

i had to use nix eval --raw on #L33 to make the GNUARMEMB_TOOLCHAIN_PATH work.

@d3zd3z
Copy link
Author

d3zd3z commented Mar 9, 2021

i had to use nix eval --raw on #L33 to make the GNUARMEMB_TOOLCHAIN_PATH work.

I'm not actually sure why I didn't, but --raw seems better.

@d3zd3z
Copy link
Author

d3zd3z commented Mar 9, 2021

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