Skip to content

Instantly share code, notes, and snippets.

@rasendubi
Created April 22, 2019 17:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rasendubi/2f5e6fc9f74295d518556c34c2f995b2 to your computer and use it in GitHub Desktop.
Save rasendubi/2f5e6fc9f74295d518556c34c2f995b2 to your computer and use it in GitHub Desktop.
Nix env for rustc development
{ pkgs ? import <nixpkgs> {} }:
let
rust-etags = with pkgs; stdenv.mkDerivation {
name = "rust-etags";
src = fetchFromGitHub {
owner = "nikomatsakis";
repo = "rust-etags";
rev = "master";
sha256 = "0br2ipkcm3xdfnxn031swsvy7n6f3nwl2iklgjvrij55sf578m6j";
};
nativeBuildInputs = [ makeWrapper ];
postPatch = ''
sed -e 's:^ ctags: ${ctags}/bin/ctags:' \
-e "s:CTAGS=.*:CTAGS=\"$out/lib/rust-etags/ctags.rust\":" \
-i rust-ctags
'';
installPhase = ''
mkdir -p $out/lib/rust-etags $out/bin
cp -r * $out/lib/rust-etags/
ln -s $out/lib/rust-etags/rust-ctags $out/bin/rust-ctags
'';
};
in pkgs.mkShell {
name = "rustc";
buildInputs = [
pkgs.llvm
pkgs.cmake
pkgs.rustup
pkgs.gdb
pkgs.graphviz
rust-etags
];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment