-
Notifications
You must be signed in to change notification settings - Fork 7
/
shell.nix
25 lines (25 loc) · 843 Bytes
/
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
{pkgs ? import <nixpkgs> {}}: let
overrides = builtins.fromTOML (builtins.readFile ./rust-toolchain.toml);
rustHostTriple = "x86_64-unknown-linux-gnu";
libs = with pkgs; [openssl xz bzip2];
in
pkgs.mkShell rec {
nativeBuildInputs = with pkgs; [
llvmPackages_12.bintools
pkg-config
clang
cmake
rustup
cargo-rdme
cargo-nextest
];
buildInputs = libs;
RUSTC_VERSION = overrides.toolchain.channel;
LIBCLANG_PATH = pkgs.lib.makeLibraryPath [pkgs.llvmPackages_12.libclang.lib];
shellHook = ''
export PATH=$PATH:''${CARGO_HOME:-~/.cargo}/bin/
export PATH=$PATH:''${RUSTUP_HOME:-~/.rustup}/toolchains/${RUSTC_VERSION}-${rustHostTriple}/bin/
'';
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath libs;
PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig/";
}