-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
chore: add nix flake for dev shell #6412
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unfortunately, I haven't gotten into nix yet...
so I'm not really familiar with these settings, but I think these don't require too much maintenance so I'm okay with including this.
wdyt @DaniPopes @onbjerg @Evalir ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also don't really know nix, so i'm not too qualified to review this—but I think what we want is something that ideally is not opinionated and therefore won't lead us to get many patches for this. I'm ok with including this if it's like so
The only maintenance would be to update the lock file when a new nightly for the rust compiler would be desirable or when a different version of solc would be required (in this case also the flake would require an update). This is done with |
Later I can check on my Mac that everything is also included for mac development |
In case absolutely no maintenance is required, I think publishing the flake.nix without the lock file (and adding it to .gitignore) could also be a viable solution. But then it's not 100% reproducible, someone might use a different nightly than someone else. At the moment since you don't include a |
I think that we can manage sgtm any concerns @onbjerg ? |
Wait to merge, I have a couple of things to add for macOS EDIT: all good now |
let's wait for breg's approval before merging |
I will literally stop shitposting if this is merged Inshallah @gakonst sees this pls ser make it a happy merry christmas |
add a what to the what now |
@onbjerg sir |
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.