|
1 | 1 | { pkgs ? import (builtins.fetchTarball { |
2 | | - name = "nixpkgs-unstable"; |
3 | | - url = "https://github.com/nixos/nixpkgs/archive/fb45fa64ae3460d6bd2701ab5a6c4512d781f166.tar.gz"; |
4 | | - sha256 = "sha256:1dcvpwshmalp5xp25z9pjm8svlnfgkcrbhany1pwjwwcpxm5kp40"; |
| 2 | + name = "nixpkgs-unstable-2021-10-15"; |
| 3 | + url = "https://github.com/nixos/nixpkgs/archive/ee084c02040e864eeeb4cf4f8538d92f7c675671.tar.gz"; |
| 4 | + sha256 = "sha256:1x8amcixdaw3ryyia32pb706vzhvn5whq9n8jin0qcha5qnm1fnh"; |
5 | 5 | }) {} |
6 | 6 | }: |
7 | 7 |
|
8 | 8 | let |
9 | | - dapptools = pkgs.fetchFromGitHub { |
10 | | - owner = "dapphub"; |
11 | | - repo = "dapptools"; |
12 | | - rev = "hevm/0.47.0"; |
13 | | - sha256 = "sha256-gFePasNQJ9bxrCDsSHWsZj2JVkjhVwIkjZf+wPDBKo0="; |
14 | | - }; |
15 | | - hevm = pkgs.haskell.lib.dontCheck ( |
16 | | - pkgs.haskell.lib.doJailbreak ( |
17 | | - pkgs.haskellPackages.callCabal2nix "hevm" "${dapptools}/src/hevm" |
18 | | - { secp256k1 = pkgs.secp256k1; } |
19 | | - )); |
20 | | - |
21 | | - crytic-compile = pkgs.python3Packages.callPackage (import ./nix/crytic-compile.nix) { }; |
22 | | - # slither is shipped with solc by default, we don't use it as we need |
23 | | - # precise solc versions |
24 | | - slither-analyzer = pkgs.slither-analyzer.override { |
25 | | - inherit crytic-compile; |
26 | | - withSolc = false; |
27 | | - }; |
28 | | - |
29 | 9 | # this is not perfect for development as it hardcodes solc to 0.5.7, test suite runs fine though |
30 | 10 | # would be great to integrate solc-select to be more flexible, improve this in future |
31 | 11 | solc = pkgs.stdenv.mkDerivation { |
|
48 | 28 | ''; |
49 | 29 | }; |
50 | 30 |
|
| 31 | + slither-analyzer = pkgs.slither-analyzer.override { withSolc = false; }; |
| 32 | + |
51 | 33 | v = "1.7.2"; |
52 | 34 |
|
53 | | - f = { mkDerivation, aeson, ansi-terminal, base, base16-bytestring |
54 | | - , binary, brick, bytestring, cborg, containers, data-dword, data-has |
55 | | - , deepseq, directory, exceptions, filepath, hashable, hevm, hpack |
56 | | - , lens, lens-aeson, megaparsec, MonadRandom, mtl |
57 | | - , optparse-applicative, process, random, stm, tasty |
58 | | - , tasty-hunit, tasty-quickcheck, temporary, text, transformers |
59 | | - , unix, unliftio, unliftio-core, unordered-containers, vector |
60 | | - , vector-instances, vty, wl-pprint-annotated, word8, yaml |
61 | | - , cabal-install, extra, ListLike, hlint, semver, haskell-language-server |
| 35 | + f = { mkDerivation, aeson, ansi-terminal, base, base16-bytestring, binary |
| 36 | + , brick, bytestring, cborg, containers, data-dword, data-has, deepseq |
| 37 | + , directory, exceptions, filepath, hashable, hevm, hpack, lens, lens-aeson |
| 38 | + , megaparsec, MonadRandom, mtl, optparse-applicative, process, random |
| 39 | + , semver, stm, tasty, tasty-hunit, tasty-quickcheck, temporary, text |
| 40 | + , transformers, unix, unliftio, unliftio-core, unordered-containers, vector |
| 41 | + , vector-instances, vty, wl-pprint-annotated, word8, yaml, extra, ListLike |
62 | 42 | }: |
63 | 43 | mkDerivation rec { |
64 | 44 | pname = "echidna"; |
|
68 | 48 | isExecutable = true; |
69 | 49 | libraryHaskellDepends = [ |
70 | 50 | aeson ansi-terminal base base16-bytestring binary brick bytestring |
71 | | - cborg containers data-dword data-has deepseq directory exceptions filepath |
72 | | - hashable hevm lens lens-aeson megaparsec MonadRandom mtl |
| 51 | + cborg containers data-dword data-has deepseq directory exceptions |
| 52 | + filepath hashable hevm lens lens-aeson megaparsec MonadRandom mtl |
73 | 53 | optparse-applicative process random stm temporary text transformers |
74 | 54 | unix unliftio unliftio-core unordered-containers vector |
75 | 55 | vector-instances vty wl-pprint-annotated word8 yaml extra ListLike |
76 | 56 | semver |
77 | 57 | ] ++ (if pkgs.lib.inNixShell then testHaskellDepends else []); |
78 | | - libraryToolDepends = [ hpack cabal-install hlint slither-analyzer solc haskell-language-server ]; |
79 | 58 | executableHaskellDepends = libraryHaskellDepends; |
80 | | - testHaskellDepends = [ |
81 | | - tasty tasty-hunit tasty-quickcheck |
82 | | - ]; |
| 59 | + testHaskellDepends = [ tasty tasty-hunit tasty-quickcheck ]; |
| 60 | + libraryToolDepends = [ hpack ]; |
| 61 | + testToolDepends = [ slither-analyzer solc ]; |
83 | 62 | preConfigure = '' |
84 | 63 | hpack |
85 | 64 | # re-enable dynamic build for Linux |
|
91 | 70 | doCheck = true; |
92 | 71 | }; |
93 | 72 |
|
94 | | - drv = pkgs.haskellPackages.callPackage f { hevm = hevm; }; |
| 73 | + echidna = pkgs.haskellPackages.callPackage f { }; |
| 74 | + echidnaShell = pkgs.haskellPackages.shellFor { |
| 75 | + packages = p: [ echidna ]; |
| 76 | + buildInputs = with pkgs.haskellPackages; [ |
| 77 | + hlint |
| 78 | + cabal-install |
| 79 | + haskell-language-server |
| 80 | + ]; |
| 81 | + }; |
95 | 82 | in |
96 | 83 | if pkgs.lib.inNixShell |
97 | | - then drv.env |
98 | | - else pkgs.haskell.lib.justStaticExecutables drv |
| 84 | + then echidnaShell |
| 85 | + else pkgs.haskell.lib.justStaticExecutables echidna |
0 commit comments