Created
August 19, 2019 11:16
-
-
Save waylandc/ef15dd719c17328f5bc277043af1290c to your computer and use it in GitHub Desktop.
nix-shell config for rust/substrate development on macos
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let | |
moz_overlay = import (builtins.fetchTarball https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz); | |
nixpkgs = import <nixpkgs> { overlays = [ moz_overlay ]; }; | |
myrust = (nixpkgs.rustChannelOf { date = "2019-05-21"; channel = "nightly"; }).rust.override { extensions = [ "rust-src" "rust-analysis" "rustfmt-preview" ]; targets = [ "wasm32-unknown-unknown" ];}; | |
in | |
with nixpkgs; | |
stdenv.mkDerivation { | |
name = "rust-dev"; | |
buildInputs = [ | |
myrust | |
rustup | |
rustracer | |
openssl | |
wasm-gc | |
cmake | |
pkgconfig | |
python3 | |
gnuplot | |
wabt | |
llvmPackages.clang-unwrapped | |
] ++ lib.optionals stdenv.isDarwin [ | |
darwin.apple_sdk.frameworks.IOKit | |
darwin.apple_sdk.frameworks.Security | |
darwin.apple_sdk.frameworks.CoreServices | |
]; | |
LIBCLANG_PATH="${llvmPackages.libclang}/lib"; | |
RUST_SRC_PATH="${myrust}/lib/rustlib/src/rust/src"; | |
shellHook = '' | |
export NIX_CXXSTDLIB_LINK="" | |
export CARGO_HOME="./.cargo" | |
''; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment