Skip to content

Instantly share code, notes, and snippets.

@stew
Created February 27, 2019 07:13
Show Gist options
  • Save stew/cd8106110b12ec39f7be9c8505566092 to your computer and use it in GitHub Desktop.
Save stew/cd8106110b12ec39f7be9c8505566092 to your computer and use it in GitHub Desktop.
shell.nix for rust project
with import <nixpkgs> {
overlays = map import [ ./nix/rust-overlay.nix ];
};
stdenv.mkDerivation rec {
name = "hatchway";
buildInputs = [
rustChannels.stable.rust
# rustChannels.nightly.rust
openssl
pkgconfig
rdkafka
zlib
(stdenv.lib.optional stdenv.isDarwin pkgs.darwin.Security)
(stdenv.lib.optional stdenv.isDarwin pkgs.darwin.apple_sdk.frameworks.CoreServices)
(stdenv.lib.optional stdenv.isDarwin pkgs.darwin.apple_sdk.frameworks.CoreFoundation)
];
RUST_SRC_PATH= "${rustChannels.stable.rust-src}/lib/rustlib/src/rust/src";
shellHook = ''
export PATH="$PWD/.cargo/bin:$PATH"
export NIX_LDFLAGS="-F${pkgs.darwin.apple_sdk.frameworks.CoreFoundation}/Library/Frameworks -framework CoreFoundation $NIX_LDFLAGS";
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment