forked from ethereum-optimism/op-geth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
73 lines (64 loc) · 2.05 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
65
66
67
68
69
70
71
72
73
{
description = "A Nix-flake-based Go 1.17 development environment";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.flake-compat.url = "github:edolstra/flake-compat";
inputs.flake-compat.flake = false;
inputs.foundry.url = "github:shazow/foundry.nix/monthly"; # Use monthly branch for permanent releases
outputs = { self, flake-utils, nixpkgs, foundry, ... }:
let
goVersion = 19; # Change this to update the whole stack
overlays = [
(final: prev: {
go = prev."go_1_${toString goVersion}";
# Overlaying nodejs here to ensure nodePackages use the desired
# version of nodejs.
nodejs = prev.nodejs-16_x;
pnpm = prev.nodePackages.pnpm;
yarn = prev.nodePackages.yarn;
})
foundry.overlay
];
in
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit overlays system;
config = {
permittedInsecurePackages = [ "nodejs-16.20.1" ];
};
};
in
{
devShells.default = pkgs.mkShell {
COMPOSE_DOCKER_CLI_BUILD=1;
DOCKER_BUILDKIT=1;
packages = with pkgs; [
go
# goimports, godoc, etc.
gotools
# https://github.com/golangci/golangci-lint
golangci-lint
# C
llvmPackages_16.libcxxClang
# Node
nodejs
pnpm
yarn # `pnpm build` fails without this
# Foundry, and tools like the anvil dev node
foundry-bin
# Docker
docker-compose # provides the `docker-compose` command
# Python
(python3.withPackages (ps: with ps; [ ]))
jq
# geth node
go-ethereum
] ++ lib.optionals stdenv.isDarwin [
darwin.libobjc
darwin.IOKit
darwin.apple_sdk.frameworks.CoreFoundation
];
};
});
}