Skip to content

Commit

Permalink
deps: switch from nix-shell to nix flakes (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
srdtrk authored Nov 27, 2024
1 parent 55e908e commit 71d82b4
Show file tree
Hide file tree
Showing 4 changed files with 281 additions and 35 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ just install-operator
> Nix users can enter a development shell with all the necessary dependencies by running:
>
> ```sh
> nix-shell shell.nix
> nix develop
> ```
## Unit Testing
Expand Down
214 changes: 214 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

66 changes: 66 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
description = "Development environment for the sp1 tendermint light client";

inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";

solc = {
url = "github:hellwolf/solc.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
foundry.url = "github:shazow/foundry.nix/main";
rust-overlay.url = "github:oxalica/rust-overlay";
};

outputs = inputs: inputs.flake-utils.lib.eachSystem
[ "x86_64-linux" "aarch64-linux" "aarch64-darwin" ]
(
system:
let
pkgs = import inputs.nixpkgs {
inherit system;
overlays = [
(import inputs.rust-overlay)
inputs.foundry.overlay
inputs.solc.overlay
];
};
in
{
devShell = pkgs.mkShell {
buildInputs = with pkgs; [
openssl
openssl.dev
pkg-config
foundry-bin
go-ethereum
solc_0_8_28
(inputs.solc.mkDefault pkgs solc_0_8_28)
bun
just
golangci-lint
go
jq
parallel
rust-bin.stable.latest.default
protobuf
buf
protoc-gen-go
protoc-gen-go-grpc
];

NIX_LD_LIBRARY_PATH = with pkgs.buildPackages; lib.makeLibraryPath [
stdenv.cc.cc
];

shellHook = ''
if [ -z "$(which cargo-prove)" ]; then
echo "SP1 toolchain is not installed. This is recommended to generate risc-v elfs. To install, please follow the instructions at"
echo "https://docs.succinct.xyz/getting-started/install.html"
fi
'';
};
}
);
}
34 changes: 0 additions & 34 deletions shell.nix

This file was deleted.

0 comments on commit 71d82b4

Please sign in to comment.