Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jrobsonchase
Copy link

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
Copy link

shazow commented Nov 4, 2024

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.

flake.nix Outdated Show resolved Hide resolved
rust-overlay.overlays.default
solc.overlay
(final: prev: {
solc = (solc.mkDefault final final.solc_0_8_27);
Copy link
Member

@zerosnacks zerosnacks Nov 7, 2024

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?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +80 to +84
solc
anvil
cast
chisel
forge
Copy link
Member

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants