this post was submitted on 08 Jun 2023
198 points (99.5% liked)

Asklemmy

43831 readers
850 users here now

A loosely moderated place to ask open-ended questions

Search asklemmy ๐Ÿ”

If your post meets the following criteria, it's welcome here!

  1. Open-ended question
  2. Not offensive: at this point, we do not have the bandwidth to moderate overtly political discussions. Assume best intent and be excellent to each other.
  3. Not regarding using or support for Lemmy: context, see the list of support communities and tools for finding communities below
  4. Not ad nauseam inducing: please make sure it is a question that would be new to most members
  5. An actual topic of discussion

Looking for support?

Looking for a community?

~Icon~ ~by~ ~@Double_A@discuss.tchncs.de~

founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[โ€“] knoff@lemmy.ml 1 points 1 year ago (1 children)

How does your rust env setup look like? I've recently setup a full flake based dev-env, that uses fenix. It works great, but I'm interested in hearing a professional opinion

[โ€“] pimeys@beehaw.org 2 points 1 year ago

When I worked for Prisma, you can check our rust setup from the public flake:

https://github.com/prisma/prisma-engines/blob/main/flake.nix

CD to the project and nix-direnv loads the flake. Get to work.

Now when I'm working in Grafbase, our flake is a bit different:

https://github.com/grafbase/grafbase/blob/main/flake.nix

Instead of the Rust overlay, we use rustup and rust-toolchain.toml. This makes it easier to enforce the same Rust version for nix and non-nix users.

Both ways work really well. The deal is to define the rust env per project instead of defining it globally. Use direnv to make it working seamlessly.