katyo / zephyr-rtos.nix

Battle-tested nix env for Zephyr RTOS developers
12 stars 0 forks source link

Zephyr Project - Development Environment

This Nix Flake allows use of Zephyr SDK by applications in a reproducible way. It offers following features:

Quickstart

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.

Templates

Packages