Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/svelterust/esp32
Rust with Xtensa support Nix using flakes.
https://github.com/svelterust/esp32
esp32 rust
Last synced: 3 months ago
JSON representation
Rust with Xtensa support Nix using flakes.
- Host: GitHub
- URL: https://github.com/svelterust/esp32
- Owner: svelterust
- Created: 2023-03-19T20:43:06.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-09-09T08:32:08.000Z (5 months ago)
- Last Synced: 2024-11-24T16:17:30.636Z (3 months ago)
- Topics: esp32, rust
- Language: Nix
- Homepage:
- Size: 11.7 KB
- Stars: 6
- Watchers: 1
- Forks: 12
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# esp32
Rust with Xtensa support for Nix using flakes.
```
$ nix flake show github:knarkzel/esp32
└───packages
└───x86_64-linux
└───esp32: package 'esp32'
$ nix build github:knarkzel/esp32#esp32
$ ls -a result
. .. .cargo .rustup
```## Minimal example
```nix
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
esp32 = {
url = "github:knarkzel/esp32";
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:$PATH"
export RUST_SRC_PATH="$(rustc --print sysroot)/lib/rustlib/src/rust/src"
'';
};
};
}
```## Getting started
Use the above flake, then follow the [Rust on ESP Book](https://esp-rs.github.io/book/writing-your-own-application/generate-project-from-template.html).
## Notes
When building from source, you need a huge amount of memory, about 36 GB.
To create temporary swap, use following commands:```
$ fallocate -l 36G /tmp/swap; mkswap /tmp/swap; swapon /tmp/swap
```