2023-02-07 18:23:51 +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;
|
2023-02-07 18:23:51 +01:00
|
|
|
rustShellHook = {
|
|
|
|
rustc,
|
|
|
|
name,
|
|
|
|
}: ''
|
2017-02-07 20:16:11 +01:00
|
|
|
rustname=rust_${rustc.version}_${name}
|
|
|
|
setPS1 $rustname
|
|
|
|
unset name
|
|
|
|
'';
|
2022-10-31 11:04:38 +01:00
|
|
|
commonVimRC = "";
|
2023-02-07 18:23:51 +01:00
|
|
|
in
|
|
|
|
pkgs.stdenv.mkDerivation {
|
2017-02-07 20:16:11 +01:00
|
|
|
inherit name;
|
2023-02-07 18:23:51 +01:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|