mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-18 08:11:24 +01:00
Some possible alternatives to this: - Keep putting them in PATH. - Make xtask a nix derivation. We would lose out on incremental compilation this way, and would end up recompiling xtask from scratch whenever something in the main package changed. - Have xtask call `nix build --inputs-from $toplevel nixpkgs#go` and such. Slow and tedious.
54 lines
1.1 KiB
Nix
54 lines
1.1 KiB
Nix
# Keep sorted
|
|
{ buildPlatform
|
|
, default
|
|
, engage
|
|
, complement
|
|
, go
|
|
, inputs
|
|
, jq
|
|
, lib
|
|
, lychee
|
|
, markdownlint-cli
|
|
, mdbook
|
|
, mkShell
|
|
, 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";
|
|
|
|
# See the doc comment on `use_xtask_path` in `xtask/src/main.rs`.
|
|
GRAPEVINE_XTASK_PATH = lib.makeBinPath [
|
|
# Keep sorted
|
|
complement
|
|
go
|
|
];
|
|
};
|
|
|
|
# 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.${buildPlatform.system}.latest.rustfmt
|
|
|
|
# Keep sorted
|
|
engage
|
|
jq
|
|
lychee
|
|
markdownlint-cli
|
|
mdbook
|
|
toolchain
|
|
]
|
|
++
|
|
default.nativeBuildInputs
|
|
++
|
|
default.propagatedBuildInputs
|
|
++
|
|
default.buildInputs;
|
|
}
|