How do I install rust?

I don’t recommend go install gcc to environment.systemPackages but always use a nix-shell for every project for the following reasons:

  1. Once you have all the build tools required for your project defined in a shell.nix it is easy to move between machines or share your expression with colleges.
  2. Compiling any C library installed with nix does not work unless you use a nix-shell. This is because our gcc package is actually a shell script that receives location of library/header paths through environment variables. These environment variables are only set if you add packages to buildInputs within a shell.nix. You can read more about this here

If it becomes to tedious to setup a shell.nix and run nix-shell in every project. Have a look at this page in particular nixify and nix-direnv

10 Likes