spacevim: best practices

This commit is contained in:
Louis Bettens 2021-02-20 18:08:41 +01:00
parent b76056aebc
commit 92bc0f7bc6
1 changed files with 8 additions and 1 deletions

View File

@ -28,13 +28,19 @@ in stdenv.mkDerivation rec {
buildInputs = [ vim-customized ]; buildInputs = [ vim-customized ];
buildPhase = '' buildPhase = ''
runHook preBuild
# generate the helptags # generate the helptags
vim -u NONE -c "helptags $(pwd)/doc" -c q vim -u NONE -c "helptags $(pwd)/doc" -c q
runHook postBuild
''; '';
patches = [ ./helptags.patch ]; patches = [
# Don't generate helptags at runtime into read-only $SPACEVIMDIR
./helptags.patch
];
installPhase = '' installPhase = ''
runHook preInstall
mkdir -p $out/bin mkdir -p $out/bin
cp -r $(pwd) $out/SpaceVim cp -r $(pwd) $out/SpaceVim
@ -43,6 +49,7 @@ in stdenv.mkDerivation rec {
makeWrapper "${vim-customized}/bin/vim" "$out/bin/spacevim" \ makeWrapper "${vim-customized}/bin/vim" "$out/bin/spacevim" \
--add-flags "-u $out/SpaceVim/vimrc" --set SPACEVIMDIR "${spacevimdir}/" \ --add-flags "-u $out/SpaceVim/vimrc" --set SPACEVIMDIR "${spacevimdir}/" \
--prefix PATH : ${lib.makeBinPath [ fzf git ripgrep]} --prefix PATH : ${lib.makeBinPath [ fzf git ripgrep]}
runHook postInstall
''; '';
meta = with lib; { meta = with lib; {