1 { stdenv, lib, fetchFromGitHub, zsh, ncurses, nix-update-script }:
4 INSTALL_PATH="${placeholder "out"}/share/fzf-tab";
5 in stdenv.mkDerivation rec {
9 src = fetchFromGitHub {
13 hash = "sha256-Qv8zAiMtrr67CbLRrFjGaPzFZcOiMVEFLg1Z+N6VMhg=";
17 buildInputs = [ ncurses ];
19 # https://github.com/Aloxaf/fzf-tab/issues/337
20 env = lib.optionalAttrs stdenv.cc.isClang {
21 NIX_CFLAGS_COMPILE = toString [
22 "-Wno-error=implicit-function-declaration"
23 "-Wno-error=implicit-int"
27 # this script is modified according to fzf-tab/lib-ftb-build-module
34 ln -s $(pwd)/Src/fzftab.c zsh-${zsh.version}/Src/Modules/
35 ln -s $(pwd)/Src/fzftab.mdd zsh-${zsh.version}/Src/Modules/
37 pushd zsh-${zsh.version}
40 if [[ ! -f ./configure ]]; then
43 if [[ ! -f ./Makefile ]]; then
44 ./configure --disable-gdbm --without-tcsetpgrp
56 pushd modules/zsh-${zsh.version}
57 make -j$NIX_BUILD_CORES
66 mkdir -p ${INSTALL_PATH}
67 cp -r lib ${INSTALL_PATH}/lib
68 install -D fzf-tab.zsh ${INSTALL_PATH}/fzf-tab.zsh
69 install -D fzf-tab.plugin.zsh ${INSTALL_PATH}/fzf-tab.plugin.zsh
70 pushd modules/zsh-${zsh.version}/Src/Modules
71 if [[ -e "fzftab.so" ]]; then
72 install -D -t ${INSTALL_PATH}/modules/Src/aloxaf/ fzftab.so
74 if [[ -e "fzftab.bundle" ]]; then
75 install -D -t ${INSTALL_PATH}/modules/Src/aloxaf/ fzftab.bundle
82 passthru.updateScript = nix-update-script { };
85 homepage = "https://github.com/Aloxaf/fzf-tab";
86 description = "Replace zsh's default completion selection menu with fzf!";
87 license = lib.licenses.mit;
88 maintainers = with lib.maintainers; [ vonfry ];
89 platforms = lib.platforms.unix;