-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
64 lines (56 loc) · 1.53 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
59
60
61
62
63
64
{
description = "UAP - Unstoppable Affiliates Protocol";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
utils.url = "github:numtide/flake-utils";
foundry.url = "github:shazow/foundry.nix"; # Use monthly branch for permanent releases
muKnIOpkgs.url = "github:MuKnIO/nixpkgs/solc"; # solc in master is broken and out of date
};
outputs = {
self,
nixpkgs,
utils,
foundry,
muKnIOpkgs,
}:
utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {
inherit system;
overlays = [
(self: super: {
solc = muKnIOpkgs.legacyPackages.${system}.solc;
})
foundry.overlay
];
};
buildInputs = with pkgs; [
# smart contracct dependencies
foundry-bin
solc
];
in {
devShell = pkgs.mkShell {
inherit buildInputs;
# Decorative prompt override so we know when we're in a dev shell
shellHook = ''
export PS1="[dev] $PS1"
export PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
'';
};
packages = {
test = pkgs.stdenv.mkDerivation {
inherit buildInputs;
name = "DMP contracts";
unpackPhase = ":";
buildPhase = ''
forge compile --no-auto-detect
'';
checkPhase = ''
forge test --no-auto-detect
'';
installPhase = "mkdir -p $out";
doCheck = true;
};
};
});
}