nixos-config/pkgs/lunarvim/default.nix

38 lines
921 B
Nix
Raw Normal View History

2021-11-25 17:18:13 +01:00
{ pkgs, ... }:
with pkgs;
let
nvim-customized = wrapNeovim neovim-unwrapped { };
in
stdenv.mkDerivation rec {
pname = "lunarvim";
version = "0.0.1";
src = fetchFromGitHub {
owner = "LunarVim";
repo = "LunarVim";
rev = "0e531891b1dfd04fa02a22b48ce075120b512277";
sha256 = "0yfr3vh8p1s9wy21s6bgpp6kp6s9pqlb6k66s76sa22vz4sjiyxb";
};
nativeBuildInputs = [ makeWrapper nvim-customized ];
buildInputs = [ nvim-customized ];
buildPhase = ''
echo "hello"
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp -r $(pwd) $out/lvim
export shim="$out/lvim/utils/bin/lvim"
substituteInPlace "$shim" \
--replace "exec nvim" "exec ${nvim-customized}/bin/nvim"
chmod +x "$shim"
makeWrapper "$shim" "$out/bin/lvim" \
--set LUNARVIM_RUNTIME_DIR "$out" \
--prefix PATH : ${lib.makeBinPath [ fzf git ripgrep ]}
runHook postInstall
'';
}