about summary refs log tree commit diff
path: root/pkgs/applications/editors/vim/wrapper.nix
blob: 72e8680505372bd0ba5309818930be66f2532b35 (plain) (blame)
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
{ stdenv, makeWrapper, writeText, vim, vimrc }:

let

  vimrcfile = writeText "vimrc" vimrc;

  p = builtins.parseDrvName vim.name;

in stdenv.mkDerivation rec {
  name = "${p.name}-with-vimrc-${p.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;
  };
}