Skip to content

Commit

Permalink
chore: update flake.nix for the current release (matter-labs#914)
Browse files Browse the repository at this point in the history
## What ❔

- update flake.nix for the current release
- also modifiy the standard environment to use the `mold` linker
- add `rustup` and `sqlx-cli`
- reformat with `nixpkgs-fmt`
- add formatter to flake for `nix fmt`
- change flake output `packages` to `devShells`, because that is what
this is
- tested the flake

## Why ❔

The old version was outdated and the environment with `nix develop
--impure` didn't work anymore.

## Checklist

- [x] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [x] Tests for the changes have been added / updated.
- [ ] Documentation comments have been added / updated.
- [x] Code has been formatted via `zk fmt` and `zk lint`.
- [x] Spellcheck has been run via `zk spellcheck`.

Signed-off-by: Harald Hoyer <[email protected]>
  • Loading branch information
haraldh authored Jan 25, 2024
1 parent 9fc2d95 commit 9b04a1c
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 39 deletions.
8 changes: 4 additions & 4 deletions flake.lock

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

73 changes: 38 additions & 35 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,40 +1,43 @@
{
description = "zkSync development shell";
inputs = {
stable.url = "github:NixOS/nixpkgs/nixos-22.11";
};
outputs = {self, stable}: {
packages.x86_64-linux.default =
with import stable { system = "x86_64-linux"; };
pkgs.mkShell {
name = "zkSync";
src = ./.;
buildInputs = [
docker-compose
nodejs
yarn
axel
libclang
openssl
pkg-config
postgresql
python3
solc
];
description = "zkSync development shell";
inputs = {
stable.url = "github:NixOS/nixpkgs/nixos-23.11";
};
outputs = { self, stable }: {
formatter.x86_64-linux = stable.legacyPackages.x86_64-linux.nixpkgs-fmt;
devShells.x86_64-linux.default =
with import stable { system = "x86_64-linux"; };
pkgs.mkShell.override { stdenv = pkgs.stdenvAdapters.useMoldLinker pkgs.gccStdenv; } {
name = "zkSync";
src = ./.;
buildInputs = [
docker-compose
nodejs
yarn
axel
libclang
openssl
pkg-config
postgresql
python3
solc
sqlx-cli
rustup
];

# for RocksDB and other Rust bindgen libraries
LIBCLANG_PATH = lib.makeLibraryPath [ libclang.lib ];
BINDGEN_EXTRA_CLANG_ARGS = ''-I"${libclang.lib}/lib/clang/${libclang.version}/include"'';
# for RocksDB and other Rust bindgen libraries
LIBCLANG_PATH = lib.makeLibraryPath [ libclang.lib ];
BINDGEN_EXTRA_CLANG_ARGS = ''-I"${libclang.lib}/lib/clang/${builtins.elemAt (builtins.splitVersion libclang.version) 0}/include"'';

shellHook = ''
export ZKSYNC_HOME=$PWD
export PATH=$ZKSYNC_HOME/bin:$PATH
'';
shellHook = ''
export ZKSYNC_HOME=$PWD
export PATH=$ZKSYNC_HOME/bin:$PATH
'';

# hardhat solc requires ld-linux
# Nixos has to fake it with nix-ld
NIX_LD_LIBRARY_PATH = lib.makeLibraryPath [];
NIX_LD = builtins.readFile "${stdenv.cc}/nix-support/dynamic-linker";
};
};
# hardhat solc requires ld-linux
# Nixos has to fake it with nix-ld
NIX_LD_LIBRARY_PATH = lib.makeLibraryPath [];
NIX_LD = builtins.readFile "${stdenv.cc}/nix-support/dynamic-linker";
};
};
}

0 comments on commit 9b04a1c

Please sign in to comment.