-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshell.nix
43 lines (41 loc) · 1.09 KB
/
shell.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# adapted from https://wiki.nixos.org/wiki/Rust#Installation_via_rustup
{
pkgs ? import <nixpkgs> { },
}:
let
overrides = (builtins.fromTOML (builtins.readFile ./rust-toolchain.toml));
in
pkgs.callPackage (
{
stdenv,
mkShell,
rustup,
rustPlatform,
}:
mkShell {
strictDeps = true;
nativeBuildInputs = [
rustup
rustPlatform.bindgenHook
#
# Packages specific to vcsq
#
pkgs.git
pkgs.mercurial
pkgs.jujutsu
pkgs.cargo-llvm-cov # for test coverage
pkgs.grcov # for test coverage
pkgs.cargo-tarpaulin # for test coverage
];
# libraries here
buildInputs = [
];
RUSTC_VERSION = overrides.toolchain.channel;
# https://github.com/rust-lang/rust-bindgen#environment-variables
shellHook = ''
export PATH="''${CARGO_HOME:-~/.cargo}/bin":"$PATH"
export PATH="''${RUSTUP_HOME:-~/.rustup}/toolchains/$RUSTC_VERSION-${stdenv.hostPlatform.rust.rustcTarget}/bin":"$PATH"
export RUSTFLAGS="''${RUSTFLAGS:+$RUSTFLAGS }-Cinstrument-coverage -Ddeprecated -Dwarnings "
'';
}
) { }