envs/dev: restructure rust

This commit is contained in:
steveej 2018-09-16 18:52:24 +02:00
parent 1a4f4800f7
commit e975628bdb
3 changed files with 0 additions and 8 deletions

View file

@ -0,0 +1,32 @@
{ gitpkgs ? import /home/steveej/src/github/NixOS/nixpkgs {}
, pkgs ? gitpkgs
, name ? "generic"
, version ? "Stable"
, extraBuildInputs ? []
}:
let
rustPackages = builtins.getAttr "rust${version}" pkgs;
rustc = rustPackages.rustc;
rustShellHook = { rustc, name }: ''
rustname=rust_${rustc.version}_${name}
setPS1 $rustname
unset name
'';
commonVimRC = ''
'';
in pkgs.stdenv.mkDerivation {
inherit name;
buildInputs = with rustPackages;[
( import ./vim-rust.nix { pkgs=gitpkgs; commonRC=commonVimRC;
inherit rustc;
racerd=pkgs.rustracerd;
})
rustc cargo
] ++ [
pkgs.rustfmt
] ++ extraBuildInputs;
shellHook = (rustShellHook){
inherit name;
inherit rustc;
};
}