forked from ethereum-optimism/optimism
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from EspressoSystems/nix
Repo configuration
- Loading branch information
Showing
4 changed files
with
213 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# These owners will be the default owners for everything in the repo. Unless a | ||
# later match takes precedence, they will be requested for review when someone | ||
# opens a pull request. | ||
|
||
* @nomaxg @sveitser @jbearer | ||
|
||
# Dependabot PRs | ||
*.toml @nomaxg @sveitser | ||
*.lock @nomaxg @sveitser |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
{ | ||
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 { | ||
packages = with pkgs; [ | ||
go | ||
# goimports, godoc, etc. | ||
gotools | ||
# https://github.com/golangci/golangci-lint | ||
golangci-lint | ||
|
||
# Node | ||
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 | ||
]; | ||
}; | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
(import | ||
( | ||
let | ||
lock = builtins.fromJSON (builtins.readFile ./flake.lock); | ||
in | ||
fetchTarball { | ||
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz"; | ||
sha256 = lock.nodes.flake-compat.locked.narHash; | ||
} | ||
) | ||
{ | ||
src = ./.; | ||
}).shellNix |