-
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
nix: add build via crate2nix, simplify dev shell #9260
base: master
Are you sure you want to change the base?
Conversation
This looks like a nice improvement, worth adding I think. Also FYI @jrobsonchase I maintain an overlay here for convenience, but we also lack a build from source which you're adding: https://github.com/shazow/foundry.nix Once this is merged we can integrate that as an option too. |
rust-overlay.overlays.default | ||
solc.overlay | ||
(final: prev: { | ||
solc = (solc.mkDefault final final.solc_0_8_27); |
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.
solc 0.8.28
has been released: https://soliditylang.org/blog/2024/10/09/solidity-0.8.28-release-announcement
is there a good way to make sure this stays up to date? or does it not matter too much as you are dynamically pulling in solc regardless?
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.
The source we retrieve it from is https://github.com/alloy-rs/svm-rs/blob/b97a212ddd72671d3f93d3b8c773ffe2edfb1ece/crates/svm-rs/src/install.rs#L251
solc | ||
anvil | ||
cast | ||
chisel | ||
forge |
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.
is there a way we could test / evaluate the working of flake.nix
in the CI and make some basic assertions?
Motivation
I wanted an easy-to-use package for NixOS. It doesn't appear to exist in upstream nixpkgs, so adding one to the existing flake is the next best approach.
Solution
Add a dependency on crate2nix and use it to analyze and build the workspace.
I also simplified the
devShell
, sinceinputsFrom
should theoretically pull in all of the other things needed to build the package. It's possible that I removed too much there, so I may need someone else to give it a try and see if I've broken something for them.