-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathshell.nix
More file actions
30 lines (29 loc) · 788 Bytes
/
shell.nix
File metadata and controls
30 lines (29 loc) · 788 Bytes
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
{
pkgs ? import <nixpkgs> { },
}:
let
overrides = builtins.readFile ./rust-toolchain;
in
pkgs.callPackage (
{ stdenv, mkShell, rustup, rustPlatform, }:
mkShell {
strictDeps = true;
nativeBuildInputs = [
rustup
rustPlatform.bindgenHook
pkgs.pkg-config
];
buildInputs = with pkgs; [
openssl
] ++ lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.Security
];
packages = with pkgs; [ gdb ];
RUSTC_VERSION = overrides;
# 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"
'';
}
) { }