vim-rust: init
This commit is contained in:
parent
54141dd96e
commit
e198d616be
3 changed files with 77 additions and 14 deletions
|
@ -1,19 +1,32 @@
|
|||
{
|
||||
pkgs ? import /home/steveej/src/github/NixOS/nixpkgs {},
|
||||
name ? "generic",
|
||||
version,
|
||||
extraBuildInputs ? [] }:
|
||||
{ gitpkgs ? import /home/steveej/src/github/NixOS/nixpkgs {}
|
||||
, pkgs ? gitpkgs
|
||||
, name ? "generic"
|
||||
, version ? "Stable"
|
||||
, extraBuildInputs ? []
|
||||
}:
|
||||
let
|
||||
rustPackages = builtins.getAttr "rust${version}" pkgs;
|
||||
rustBuildInputs = { rustPackages }: [
|
||||
rustPackages.rustc
|
||||
];
|
||||
rustShellHook = { rustPackages, name }: ''
|
||||
setPS1 rust${version}
|
||||
unset name
|
||||
'';
|
||||
rustc = rustPackages.rustc;
|
||||
rustShellHook = { rustc, name }: ''
|
||||
rustname=rust_${rustc.version}_${name}
|
||||
setPS1 $rustname
|
||||
unset name
|
||||
'';
|
||||
commonVimRC = ''
|
||||
'';
|
||||
in pkgs.stdenv.mkDerivation {
|
||||
inherit name;
|
||||
buildInputs = extraBuildInputs ++ (rustBuildInputs){ inherit rustPackages; };
|
||||
shellHook = (rustShellHook) { inherit name; inherit rustPackages; };
|
||||
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;
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue