foundry-rs / foundry

Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.
https://getfoundry.sh
Apache License 2.0
8.34k stars 1.77k forks source link

nix: add build via crate2nix, simplify dev shell #9260

Open jrobsonchase opened 3 weeks ago

jrobsonchase commented 3 weeks ago

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, since inputsFrom 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.

shazow commented 3 weeks ago

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.