Merge pull request #959 from wizeman/vimrc
vim: add config option to generate global vimrc
This commit is contained in:
commit
152f87cc47
3 changed files with 40 additions and 3 deletions
|
@ -1,7 +1,9 @@
|
||||||
{ stdenv, fetchhg, ncurses, gettext, pkgconfig }:
|
{ stdenv, fetchhg, ncurses, gettext, pkgconfig }:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "vim-7.4.131";
|
name = "vim-${version}";
|
||||||
|
|
||||||
|
version = "7.4.131";
|
||||||
|
|
||||||
src = fetchhg {
|
src = fetchhg {
|
||||||
url = "https://vim.googlecode.com/hg/";
|
url = "https://vim.googlecode.com/hg/";
|
||||||
|
|
30
pkgs/applications/editors/vim/wrapper.nix
Normal file
30
pkgs/applications/editors/vim/wrapper.nix
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
{ stdenv, makeWrapper, writeText, vim, vimrc }:
|
||||||
|
|
||||||
|
let
|
||||||
|
|
||||||
|
vimrcfile = writeText "vimrc" (if vimrc == null then "" else vimrc);
|
||||||
|
|
||||||
|
in stdenv.mkDerivation rec {
|
||||||
|
name = "vimwrapper-${vim.version}";
|
||||||
|
|
||||||
|
buildInputs = [ makeWrapper vim vimrcfile ];
|
||||||
|
|
||||||
|
phases = [ "installPhase" ];
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out
|
||||||
|
cp -r ${vim}/* $out/
|
||||||
|
|
||||||
|
chmod u+w $out/bin
|
||||||
|
chmod u+w $out/share/vim
|
||||||
|
|
||||||
|
ln -s ${vimrcfile} $out/share/vim/vimrc
|
||||||
|
wrapProgram $out/bin/vim --set VIM "$out/share/vim"
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = with stdenv.lib; {
|
||||||
|
description = "The most popular clone of the VI editor";
|
||||||
|
homepage = http://www.vim.org;
|
||||||
|
platforms = platforms.unix;
|
||||||
|
};
|
||||||
|
}
|
|
@ -9058,6 +9058,11 @@ let
|
||||||
else stdenv;
|
else stdenv;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
vimwrapper = callPackage ../applications/editors/vim/wrapper.nix {
|
||||||
|
inherit vim;
|
||||||
|
vimrc = config.vim.vimrc or null;
|
||||||
|
};
|
||||||
|
|
||||||
vimHugeX = vim_configurable;
|
vimHugeX = vim_configurable;
|
||||||
|
|
||||||
vim_configurable = callPackage ../applications/editors/vim/configurable.nix {
|
vim_configurable = callPackage ../applications/editors/vim/configurable.nix {
|
||||||
|
|
Loading…
Reference in a new issue