forked from ethereum/act
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
58 lines (54 loc) · 1.7 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
{
description = "act";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:nixos/nixpkgs";
hevmUpstream = {
url = "github:ethereum/hevm";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, flake-utils, hevmUpstream, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
gitignore = pkgs.nix-gitignore.gitignoreSourcePure [ ./.gitignore ];
myHaskellPackages = pkgs.haskellPackages.override {
overrides = self: super: rec {
hevm = hevmUpstream.packages.${system}.noTests;
};
};
act = (myHaskellPackages.callCabal2nixWithOptions "act" (gitignore ./src) "-fci" {})
.overrideAttrs (attrs : {
buildInputs = attrs.buildInputs ++ [ pkgs.z3 pkgs.cvc5 ];
});
in rec {
packages.act = act;
packages.default = packages.act;
apps.act = flake-utils.lib.mkApp { drv = packages.act; };
apps.default = apps.act;
devShell = with pkgs;
let libraryPath = "${lib.makeLibraryPath [ libff secp256k1 gmp ]}";
in myHaskellPackages.shellFor {
packages = _: [ act ];
buildInputs = with pkgs.haskellPackages; [
cabal-install
haskell-language-server
pkgs.jq
pkgs.z3
pkgs.cvc5
pkgs.coq
pkgs.solc
pkgs.mdbook
pkgs.mdbook-mermaid
pkgs.mdbook-katex
];
withHoogle = true;
shellHook = ''
export PATH=$(pwd)/bin:$PATH
export DYLD_LIBRARY_PATH="${libraryPath}"
'';
};
}
);
}