Skip to content

Rust with Xtensa support Nix using flakes.

Notifications You must be signed in to change notification settings

edupsousa/esp32-idf-rust

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 

Repository files navigation

esp32-idf-rust

It`s a fork of esp32-idf-rust with some changes as detailed below.

Differences from upstream

  1. Added permittedInsecurePackages = [ "python-2.7.18.7" ] because Python 2 is deprecated and the build fails without it.
  2. Changed the base docker image tag from all_latest to esp32_latest to reduce build time and size.
  3. Updated docker image digest to the latest version to this date (2024-03-14).

Minimal example

flake.nix (devShell)

{
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    esp32 = {
      url = "github:edupsousa/esp32-idf-rust";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };

  outputs = {
    self,
    nixpkgs,
    esp32,
  }: let
    pkgs = import nixpkgs {system = "x86_64-linux";};
    idf-rust = esp32.packages.x86_64-linux.esp32;
  in {
    devShells.x86_64-linux.default = pkgs.mkShell {
      buildInputs = [
        idf-rust
      ];

      shellHook = ''
        export PATH="${idf-rust}/.rustup/toolchains/esp/bin:${idf-rust}/.rustup/toolchains/esp/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin:$PATH"
        export RUST_SRC_PATH="$(rustc --print sysroot)/lib/rustlib/src/rust/src"
      '';
    };
  };
}

Upgrading or chaging the base Docker image

Run the command below to get the latest image digest and update the flake.nix file in this repository.

nix run nixpkgs#nix-prefetch-docker -- --image-name espressif/idf-rust --image-tag esp32_latest

Note: You can change the esp32_latest tag to any other tag you want to use.

Find the available tags here.

About

Rust with Xtensa support Nix using flakes.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Nix 100.0%