Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a nix / devbox distribution option #289

Open
maelp opened this issue Jan 27, 2025 · 9 comments
Open

Add a nix / devbox distribution option #289

maelp opened this issue Jan 27, 2025 · 9 comments

Comments

@maelp
Copy link

maelp commented Jan 27, 2025

It's quite useful to have nix/devbox to setup efficient local dev environment, would it be possible to package rust-build in nix, so we could just nix shell -p rust-build and get a fully-functional dev env?

@SergioGasquez
Copy link
Member

Hi! At the moment, we do not plan on supporting a Nix distribution option, but we would welcome anyone from the community who is willing to create it and maintain it.

@maelp
Copy link
Author

maelp commented Jan 27, 2025

I'm not a nix expert, just like how "when it works" it makes stuff easy haha, but willing to help if someone wants to give some infos

@maelp
Copy link
Author

maelp commented Jan 27, 2025

Could you tell me for instance the most straightforward and "best practice" installation process for now to install the rust env for esp32-s3 compilation? I can take it from there

@SergioGasquez
Copy link
Member

Could you tell me for instance the most straightforward and "best practice" installation process for now to install the rust env for esp32-s3 compilation? I can take it from there

Details are explained in https://docs.esp-rs.org/book/installation/index.html, but assuming you want a rust no_std env for S3 here is what you need to do:

  1. Install espup: From gh release artifacts or cargo install espup
  2. Install Xtensa Rust toolchain: espup install
  3. Update environment variables: . $HOME/export-esp.sh, you can also set this environment variables elsewhere.
  4. Install tools: espflash, probe-rs, esp-generate. Not sure which ones you want, all of them can be installed from sources or gh artifacts

@maelp
Copy link
Author

maelp commented Jan 27, 2025

@maelp
Copy link
Author

maelp commented Jan 27, 2025

I haven't installed all the other tools, I guess it shouldn't be too hard, but I'm not a Nix expert 😅

@SergioGasquez
Copy link
Member

A few comments:

  • You seem to want an std env (for esp-idf-* crates) based on "Flake for Rust ESP-IDF setup with espup", so you need installing ldproxy (cargo install ldproxy). See https://docs.esp-rs.org/book/installation/std-requirements.html for more details
  • The default name is already esp so you could remove the --name flag
  • I would suggest that the description says that its only for ESP32S3 or that you install Xtensa Rust for all the targets

@maelp
Copy link
Author

maelp commented Jan 27, 2025

@SergioGasquez thanks for the comments! Indeed it was meant more as a kind of "starter config" so that someone more experienced could finish packaging it, do you want me to do the modifications?

I'm targeting no-std for esp32-s3, but indeed if we integrate this in one of the esp-rs package we should definitely make this configurable, however my Nix skills are not that great (and ChatGPT doesn't really get nix either haha) so I'm not sure how to do all this

If you know someone who could finish packaging all of this he might be more efficient than the two of us doing back and forth perhaps? However if you think that just the above changes are sufficient I can implement them and send you a new gist

@SergioGasquez
Copy link
Member

do you want me to do the modifications?

As you want, as mentioned before, we won't be able to maintain this, so if you want to take care of this and share it, maybe other nix user can build on top of it!

I'm targeting no-std for esp32-s3

Then, description = "Flake for Rust ESP-IDF setup with espup"; is not true, no_std is not related ESP-IDF.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

2 participants