This Nix Flake allows use of Zephyr SDK by applications in a reproducible way. It offers following features:
To use the development shell, you can use a flake such as:
{
inputs.nixpkgs.url = "nixpkgs/release-23.11";
inputs.zephyr-rtos = {
url = "github:katyo/zephyr-rtos.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { nixpkgs, zephyr-rtos, ... }:
let
supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
nixpkgsFor = forAllSystems (system: import nixpkgs {
inherit system;
overlays = [ zephyr-rtos.overlays.default ];
});
in
{
devShells = forAllSystems (system: {
default = nixpkgsFor.${system}.mkZephyrSdk { };
});
};
}
Once this is done, the nix develop
command will get you under a development shell ready for Zephyr
Project development.
all-toolchains
: using all supported toolchainsarm
: using arm toolchainopenocd-svd
openocd-zephyr
uncrustify_0_72
zephyr-sdk