diff options
author | laalsaas <laalsaas@systemli.org> | 2022-11-02 19:28:29 +0100 |
---|---|---|
committer | laalsaas <laalsaas@systemli.org> | 2022-12-03 02:56:03 +0100 |
commit | 123cdd499040fac090267246a254d424e70f68e4 (patch) | |
tree | 42901ceecb378a09ef1ce470800e208a8a043a09 | |
parent | 8149fc84381dcd0a96b58e366d942de2f56466b7 (diff) |
fzf: cleanup
- use installShellFiles - mkdir;cp -> install - unify shell completion installation
-rw-r--r-- | pkgs/tools/misc/fzf/default.nix | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/pkgs/tools/misc/fzf/default.nix b/pkgs/tools/misc/fzf/default.nix index aee0121977303..0ea167a5053c3 100644 --- a/pkgs/tools/misc/fzf/default.nix +++ b/pkgs/tools/misc/fzf/default.nix @@ -1,5 +1,12 @@ -{ lib, buildGoModule, fetchFromGitHub, writeText, runtimeShell, ncurses, perl }: - +{ lib +, buildGoModule +, fetchFromGitHub +, writeText +, runtimeShell +, installShellFiles +, ncurses +, perl +}: buildGoModule rec { pname = "fzf"; version = "0.35.1"; @@ -15,7 +22,7 @@ buildGoModule rec { outputs = [ "out" "man" ]; - fishHook = writeText "load-fzf-keybindings.fish" "fzf_key_bindings"; + nativeBuildInputs = [ installShellFiles ]; buildInputs = [ ncurses ]; @@ -38,22 +45,19 @@ buildGoModule rec { --replace " perl -n " " ${perl}/bin/perl -n " ''; - preInstall = '' - mkdir -p $out/share/fish/{vendor_functions.d,vendor_conf.d} - cp shell/key-bindings.fish $out/share/fish/vendor_functions.d/fzf_key_bindings.fish - cp ${fishHook} $out/share/fish/vendor_conf.d/load-fzf-key-bindings.fish - ''; - postInstall = '' - cp bin/fzf-tmux $out/bin + install bin/fzf-tmux $out/bin + + installManPage man/man1/fzf.1 man/man1/fzf-tmux.1 - mkdir -p $man/share/man - cp -r man/man1 $man/share/man + install -D plugin/* -t $out/share/vim-plugins/${pname}/plugin - mkdir -p $out/share/vim-plugins/${pname} - cp -r plugin $out/share/vim-plugins/${pname} + # Install shell integrations + install -D shell/* -t $out/share/fzf/ + install -D shell/key-bindings.fish $out/share/fish/vendor_functions.d/fzf_key_bindings.fish + mkdir -p $out/share/fish/vendor_conf.d + echo fzf_key_bindings > $out/share/fish/vendor_conf.d/load-fzf-key-bindings.fish - cp -R shell $out/share/fzf cat <<SCRIPT > $out/bin/fzf-share #!${runtimeShell} # Run this script to find the fzf shared folder where all the shell |