2022-10-31 11:04:38 +01:00
|
|
|
{ gitpkgs ? import /home/steveej/src/github/NixOS/nixpkgs { }, pkgs ? gitpkgs
|
|
|
|
, name ? "generic", version ? "Stable", extraBuildInputs ? [ ] }:
|
|
|
|
let
|
2016-05-23 00:39:45 +02:00
|
|
|
rustPackages = builtins.getAttr "rust${version}" pkgs;
|
2017-02-07 20:16:11 +01:00
|
|
|
rustc = rustPackages.rustc;
|
|
|
|
rustShellHook = { rustc, name }: ''
|
|
|
|
rustname=rust_${rustc.version}_${name}
|
|
|
|
setPS1 $rustname
|
|
|
|
unset name
|
|
|
|
'';
|
2022-10-31 11:04:38 +01:00
|
|
|
commonVimRC = "";
|
2016-05-23 00:39:45 +02:00
|
|
|
in pkgs.stdenv.mkDerivation {
|
|
|
|
inherit name;
|
2022-10-31 11:04:38 +01:00
|
|
|
buildInputs = with rustPackages;
|
|
|
|
[
|
|
|
|
(import ./vim-rust.nix {
|
|
|
|
pkgs = gitpkgs;
|
|
|
|
commonRC = commonVimRC;
|
2017-02-07 20:16:11 +01:00
|
|
|
inherit rustc;
|
2022-10-31 11:04:38 +01:00
|
|
|
racerd = pkgs.rustracerd;
|
|
|
|
})
|
|
|
|
rustc
|
|
|
|
cargo
|
|
|
|
] ++ [ pkgs.rustfmt ] ++ extraBuildInputs;
|
|
|
|
shellHook = (rustShellHook) {
|
2017-02-07 20:16:11 +01:00
|
|
|
inherit name;
|
|
|
|
inherit rustc;
|
|
|
|
};
|
2016-05-23 00:39:45 +02:00
|
|
|
}
|