-
Notifications
You must be signed in to change notification settings - Fork 44
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
Add Nix support #143
Add Nix support #143
Conversation
flake.nix
Outdated
solc-select = pkgs.python39Packages.buildPythonPackage (pyCommon // { | ||
pname = "solc-select"; | ||
version = "1.0.3"; | ||
src = builtins.fetchGit { | ||
url = "git+ssh://[email protected]/crytic/solc-select"; | ||
rev = "97f160611c39d46e27d6f44a5a61344e6218d584"; | ||
}; | ||
propagatedBuildInputs = with pkgs.python39Packages; [ | ||
packaging | ||
setuptools | ||
pycryptodome | ||
]; | ||
}); |
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.
In-line addition of nix support to solc-select
& other packages that don't feature a flake.nix
file yet. If/when they do, these pieces of config can move into their respective repos & can be removed from this project.
In the meantime, they allow medusa
to depend on a specific commit of crytic-compile
, etc
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.
lgtm, over the long term we should add nix to our to-be-created release pipeline to ensure the vendorhash is correct
Once merged to the default branch, this PR should allow anyone with nix installed to run
nix run github:crytic/medusa
to use the medusa tool without installing anything globally. Kind of like a single-serving virtualenv. The first time this is run, it'll take some time as medusa's dependencies (egslither
) are downloaded & the project is built, but subsequent runs will start almost instantly without requiring any further downloads. More info renix run
.Allows global installation of medusa with:
nix build && nix-env -i ./result
. Thismedusa
installation is hooked up to a new copy of required dependencies, so it'll take care of the slither dependency if not already present but w/out any risk of conflict w existing globalslither
installation.Also provides a developer environment via
nix develop
which opens a shell that includes basic golang tools & other dependencies needed to build & run tests.This is entirely opt-in, it uses the rest of the repo's config (eg
go.mod
) rather than attempting to replace it. If you don't want to fiddle withnix
, then you can ignore these new files & do the same thing you've always done.