tvl-depot/tvix/shell.nix
Ryan Lahfa ea03ff374b chore(tvix/shell): add cargo-expand to debug proc-macro
I lost a lot of hope and had to read the source code of `quote!`, `cargo expand` was invaluable
in this adventure. We should keep it IMHO.

Change-Id: Icfb4c80d413602f2bdc6deab0d595183825d88ad
Reviewed-on: https://cl.tvl.fyi/c/depot/+/10635
Autosubmit: raitobezarius <tvl@lahfa.xyz>
Reviewed-by: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
2024-01-18 12:29:46 +00:00

49 lines
1.4 KiB
Nix

# This file is shell.nix in the tvix josh workspace,
# *and* used to provide the //tvix:shell attribute in a full depot checkout.
# Hence, it may not use depot as a toplevel argument.
{
# This falls back to the tvix josh workspace-provided nixpkgs checkout.
# In the case of depot, it's always set explicitly.
pkgs ? (import ./nixpkgs {
depotOverlays = false;
depot.third_party.sources = import ./sources { };
})
, ...
}:
pkgs.mkShell {
name = "tvix-rust-dev-env";
packages = [
pkgs.buf-language-server
pkgs.cargo
pkgs.cargo-machete
pkgs.cargo-expand
pkgs.clippy
pkgs.evans
pkgs.fuse
pkgs.go
pkgs.grpcurl
pkgs.hyperfine
pkgs.nix_2_3 # b/313
pkgs.pkg-config
pkgs.rust-analyzer
pkgs.rustc
pkgs.rustfmt
pkgs.protobuf
] ++ pkgs.lib.optionals pkgs.stdenv.isDarwin [
# We need these two dependencies in the ambient environment to be able to
# `cargo build` on MacOS.
pkgs.libiconv
pkgs.buildPackages.darwin.apple_sdk.frameworks.Security
];
# Set TVIX_BENCH_NIX_PATH to a somewhat pinned nixpkgs path.
# This is for invoking `cargo bench` imperatively on the developer machine.
# For tvix benchmarking across longer periods of time (by CI), we probably
# should also benchmark with a more static nixpkgs checkout, so nixpkgs
# refactorings are not observed as eval perf changes.
shellHook = ''
export TVIX_BENCH_NIX_PATH=nixpkgs=${pkgs.path}
'';
}