{ stdenv, lib, fetchFromGitHub, ncurses }: let INSTALL_PATH="${placeholder "out"}/share/fzf-tab"; in stdenv.mkDerivation rec { pname = "zsh-fzf-tab"; version = "unstable-2021-08-05"; src = fetchFromGitHub { owner = "Aloxaf"; repo = "fzf-tab"; rev = "89a33154707c09789177a893e5a8ebbb131d5d3d"; sha256 = "1g8011ldrghbw5ibchsp0p93r31cwyx2r1z5xplksd779jw79wdx"; }; buildInputs = [ ncurses ]; patches = lib.optionals stdenv.isDarwin [ ./darwin.patch ]; postConfigure = '' pushd modules ./configure --disable-gdbm --without-tcsetpgrp popd ''; postBuild = '' pushd modules make -j$NIX_BUILD_CORES popd ''; installPhase = '' mkdir -p ${INSTALL_PATH} cp -r lib ${INSTALL_PATH}/lib install -D fzf-tab.zsh ${INSTALL_PATH}/fzf-tab.zsh install -D fzf-tab.plugin.zsh ${INSTALL_PATH}/fzf-tab.plugin.zsh install -D modules/Src/aloxaf/fzftab.so ${INSTALL_PATH}/modules/Src/aloxaf/fzftab.so ''; meta = with lib; { homepage = "https://github.com/Aloxaf/fzf-tab"; description = "Replace zsh's default completion selection menu with fzf!"; license = licenses.mit; maintainers = with maintainers; [ vonfry ]; platforms = platforms.unix; }; }