chore: add nix flake for dev shell #6412
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a nix flake definition for a dev shell that provides the necessary components to building and testing foundry.
Motivation
In order to compile and test successfully, the workspace requires Rust nightly, solc and libusb. These dependencies must be installed by users and could be provided system wide. However, it's a good idea to provide nix users with a pre-configured devShell that includes all these dependencies.
Solution
A nix flake is a deterministic definition file that configures the required nix packages that must be present in the PATH when developing a project.
The shell can be activated with the
nix develop
command and provides the rust toolchain on nightly with clippy and rustfmt, the solidity compiler at v0.8.20 and libusb1.