about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/editors/kakoune/plugins/kak-fzf.nix
blob: b52584b4456266aae61313eb775534f9dea38579 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{ lib, stdenv, fetchFromGitHub, fzf }:

assert lib.asserts.assertOneOf "fzf" fzf.pname [ "fzf" "skim" ];

stdenv.mkDerivation {
  name = "kak-fzf";
  version = "2020-07-26";

  src = fetchFromGitHub {
    owner = "andreyorst";
    repo = "fzf.kak";
    rev = "f23daa698ad95493fbd675ae153e3cac13ef34e9";
    hash = "sha256-BfXHTJ371ThOizMI/4BAbdJoaltGSP586hz4HqX1KWA=";
  };

  configurePhase = ''
    if [[ -x "${fzf}/bin/fzf" ]]; then
      fzfImpl='${fzf}/bin/fzf'
    else
      fzfImpl='${fzf}/bin/sk'
    fi

    substituteInPlace rc/fzf.kak \
      --replace \'fzf\' \'"$fzfImpl"\'
  '';

  installPhase = ''
    mkdir -p $out/share/kak/autoload/plugins
    cp -r rc $out/share/kak/autoload/plugins/fzf
  '';

  meta = with lib;
  { description = "Kakoune plugin that brings integration with fzf";
    homepage = "https://github.com/andreyorst/fzf.kak";
    license = licenses.mit;
    maintainers = with maintainers; [ nrdxp ];
    platform = platforms.all;
  };
}