-
Notifications
You must be signed in to change notification settings - Fork 0
/
shell.nix
34 lines (31 loc) · 1019 Bytes
/
shell.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{ nixpkgs ? import <nixpkgs> {}}:
nixpkgs.callPackage (
{ stdenv, rust, libbap, llvmPackages, vim_configurable }:
# Vim with rust + git support
let vim = vim_configurable.customize {
name = "vim";
vimrcConfig.customRC = ''
set backspace=indent,eol,start
let g:rustfmt_autosave = 1
autocmd FileType rust compiler cargo
let g:racer_cmd = "${nixpkgs.rustracer}/bin/racer"
let $RUST_SRC_PATH="${nixpkgs.rustc.src}/src"
let g:racer_experimental_completer = 1
au FileType rust nmap gd <Plug>(rust-def)
au FileType rust nmap gs <Plug>(rust-def-split)
au FileType rust nmap gx <Plug>(rust-def-vertical)
au FileType rust nmap <leader>gd <Plug>(rust-doc)
'';
vimrcConfig.vam.pluginDictionaries = [{ names = [
"fugitive"
"vim-racer"
"rust-vim"
"syntastic"
];}];
}; in
stdenv.mkDerivation rec {
name = "bap-rust";
buildInputs = [ rust libbap vim ];
LIBCLANG_PATH = "${llvmPackages.clang-unwrapped.lib}/lib";
}
) {rust = nixpkgs.rustChannels.stable.rust; }