Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 27 additions & 9 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 38 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,47 @@
z3
cvc5
git
] ++ lib.optionals (!stdenv.isDarwin) [
foundry.defaultPackage.${system}
];

secp256k1-static = stripDylib (pkgs.secp256k1.overrideAttrs (attrs: {
configureFlags = attrs.configureFlags ++ [ "--enable-static" ];
}));

patchedHaskellPackages = pkgs.haskell.packages.ghc94.override {
overrides = self: super: {
# disable tests in optics
optics-core = pkgs.haskell.lib.dontCheck (self.callCabal2nix "optics-core" (pkgs.fetchFromGitHub {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This will be included in the next bump right?

Copy link
Contributor Author

@siraben siraben Jun 27, 2023

Choose a reason for hiding this comment

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

Yes, when the nexthaskell-updates is merged after NixOS/nixpkgs#236431

owner = "well-typed";
repo = "optics";
rev = "46b03019bd7d9eddb767b19a68b94125eec3b17a";
sha256 = "sha256-wzZ/64G7nVAzIFjKNs/jBvv6gQdTIQS4X/OvM5KWfnU=";
} + "/optics-core") {});
optics = pkgs.haskell.lib.dontCheck (self.callCabal2nix "optics" (pkgs.fetchFromGitHub {
owner = "well-typed";
repo = "optics";
rev = "46b03019bd7d9eddb767b19a68b94125eec3b17a";
sha256 = "sha256-wzZ/64G7nVAzIFjKNs/jBvv6gQdTIQS4X/OvM5KWfnU=";
} + "/optics") {});
indexed-profunctors = pkgs.haskell.lib.dontCheck (self.callCabal2nix "optics" (pkgs.fetchFromGitHub {
owner = "well-typed";
repo = "optics";
rev = "46b03019bd7d9eddb767b19a68b94125eec3b17a";
sha256 = "sha256-wzZ/64G7nVAzIFjKNs/jBvv6gQdTIQS4X/OvM5KWfnU=";
} + "/indexed-profunctors") {});
# use obsidian systems fork of string-qq
string-qq = self.callCabal2nix "string-qq" (pkgs.fetchFromGitHub {
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we upstream this to nixpkgs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, I'll make a PR to Nixpkgs explaining the situation with string-qq

owner = "obsidiansystems";
repo = "string-qq";
rev = "82ad6d72b694dc61e9b6b7eb856cb2d3d27e2865";
sha256 = "sha256-CNtB8jkNyNBR+ZJbtLoeA6U1ivT3gEs4UVFVHIZe27w=";
}) {};
};
};

hevmUnwrapped = (with pkgs; lib.pipe (
haskellPackages.callCabal2nix "hevm" ./. {
patchedHaskellPackages.callCabal2nix "hevm" ./. {
# Haskell libs with the same names as C libs...
# Depend on the C libs, not the Haskell libs.
# These are system deps, not Cabal deps.
Expand All @@ -67,6 +99,7 @@
"--extra-lib-dirs=${glibc.static}/lib"
]))
haskell.lib.dontHaddock
haskell.lib.doJailbreak
]).overrideAttrs(final: prev: {
HEVM_SOLIDITY_REPO = solidity;
HEVM_ETHEREUM_TESTS_REPO = ethereum-tests;
Expand Down Expand Up @@ -144,13 +177,14 @@

devShell = with pkgs;
let libraryPath = "${lib.makeLibraryPath [ libff secp256k1 gmp ]}";
in haskellPackages.shellFor {
in patchedHaskellPackages.shellFor {
packages = _: [ hevmUnwrapped ];
buildInputs = [
mdbook
yarn
haskellPackages.cabal-install
haskellPackages.haskell-language-server
go-ethereum
patchedHaskellPackages.cabal-install
patchedHaskellPackages.haskell-language-server
] ++ testDeps;
withHoogle = true;

Expand Down
6 changes: 3 additions & 3 deletions hevm.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -138,15 +138,15 @@ library
Decimal >= 0.5.1 && < 0.6,
containers >= 0.6.0 && < 0.7,
deepseq >= 1.4.4 && < 1.5,
time >= 1.11.1.1 && < 1.12,
time >= 1.11.1.1 && <= 1.12.2,
transformers >= 0.5.6 && < 0.6,
tree-view >= 0.5 && < 0.6,
abstract-par >= 0.3.3 && < 0.4,
aeson >= 2.0.0 && < 2.1,
aeson >= 2.0.0 && <= 2.1.2.1,
bytestring >= 0.11.3.1 && < 0.12,
scientific >= 0.3.6 && < 0.4,
binary >= 0.8.6 && < 0.9,
text >= 1.2.3 && < 1.3,
text >= 1.2.3 && <= 2.0.2,
unordered-containers >= 0.2.10 && < 0.3,
vector >= 0.12.1 && < 0.13,
ansi-wl-pprint >= 0.6.9 && < 0.7,
Expand Down