mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-17 07:41:23 +01:00
factor out nix code into new files via makeScope
This makes the Nix code a lot easier to reason about.
This commit is contained in:
parent
8d8d4425f3
commit
0f8d1a5ed7
5 changed files with 299 additions and 223 deletions
34
nix/shell.nix
Normal file
34
nix/shell.nix
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
# Keep sorted
|
||||
{ default
|
||||
, engage
|
||||
, inputs
|
||||
, jq
|
||||
, mkShell
|
||||
, system
|
||||
, 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.${system}.latest.rustfmt
|
||||
|
||||
# Keep sorted
|
||||
engage
|
||||
jq
|
||||
toolchain
|
||||
]
|
||||
++
|
||||
default.nativeBuildInputs;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue