grapevine/nix/shell.nix
Charles Hall 540cc89c83
move ci job scipts into an actual script
This will make it possible/easier to:

* share code between jobs
* run jobs locally
2024-12-11 11:39:20 -08:00

53 lines
1.1 KiB
Nix

# Keep sorted
{ cargo-insta
, default
, engage
, inputs
, jq
, lychee
, markdownlint-cli
, mdbook
, mkShell
, ripgrep
, stdenv
, toolchain
}:
mkShell {
env = default.env // {
# Rust Analyzer needs to be able to find the path to default crate
# sources, and it can read this environment variable to do so. The
# `rust-src` component is required in order for this to work.
RUST_SRC_PATH = "${toolchain}/lib/rustlib/src/rust/library";
};
# Development tools
nativeBuildInputs = [
# Always use nightly rustfmt because most of its options are unstable
#
# This needs to come before `toolchain` in this list, otherwise
# `$PATH` will have stable rustfmt instead.
inputs.fenix.packages.${stdenv.buildPlatform.system}.latest.rustfmt
# Keep sorted
cargo-insta
engage
jq
lychee
markdownlint-cli
mdbook
ripgrep
toolchain
]
++
default.nativeBuildInputs
++
default.propagatedBuildInputs
++
default.buildInputs;
shellHook = ''
# Workaround for <https://github.com/NixOS/nix/issues/8355>
unset TMPDIR
'';
}