From 92bc0f7bc61baf88e40a6c846f9ce352407f49a2 Mon Sep 17 00:00:00 2001 From: Louis Bettens Date: Sat, 20 Feb 2021 18:08:41 +0100 Subject: [PATCH] spacevim: best practices --- pkgs/applications/editors/spacevim/default.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/editors/spacevim/default.nix b/pkgs/applications/editors/spacevim/default.nix index 88d18573240..930c8f919e4 100644 --- a/pkgs/applications/editors/spacevim/default.nix +++ b/pkgs/applications/editors/spacevim/default.nix @@ -28,13 +28,19 @@ in stdenv.mkDerivation rec { buildInputs = [ vim-customized ]; buildPhase = '' + runHook preBuild # generate the helptags 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 = '' + runHook preInstall mkdir -p $out/bin cp -r $(pwd) $out/SpaceVim @@ -43,6 +49,7 @@ in stdenv.mkDerivation rec { makeWrapper "${vim-customized}/bin/vim" "$out/bin/spacevim" \ --add-flags "-u $out/SpaceVim/vimrc" --set SPACEVIMDIR "${spacevimdir}/" \ --prefix PATH : ${lib.makeBinPath [ fzf git ripgrep]} + runHook postInstall ''; meta = with lib; {