Configure a shell with development tools¶
Given a project named
proj with a
pkgs/proj/default.nix file, create a file
shells/proj-shell/default.nix that looks like this:
- You must include the package as an input so that you can later extract the build inputs from it.
- Add any development tools you want as inputs. Here we use
clippyso that you can use these from your IDE in the flox environment. If you wanted to add other development tools like Cargo subcommands, you would add those here as well. Note the commas after each item!
inputsFromwill extract any necessary build inputs from the definition of the package so that you don't need to repeat them in this file.
- Add the development tools that you listed in the inputs here. Note that you shouldn't add commas between items here.
- Set this environment variable so that
rust-analyzercan provide type definitions, autocomplete, etc for items in the Rust standard library.
To enter the shell, use the [
flox develop][flox_develop] command and select
You should now have access to development tools in your shell, and an editor launched from this shell should have access to