about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/editors/kakoune/plugins/kak-ansi.nix
blob: f34ee6d29990831996399970cbecca49ee0d2e0f (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
{ lib, stdenv, fetchFromGitHub }:

stdenv.mkDerivation rec {
  name = "kak-ansi";
  version = "0.2.1";

  src = fetchFromGitHub {
    owner = "eraserhd";
    repo = "kak-ansi";
    rev = "v${version}";
    sha256 = "0ddjih8hfyf6s4g7y46p1355kklaw1ydzzh61141i0r45wyb2d0d";
  };

  installPhase = ''
    mkdir -p $out/bin $out/share/kak/autoload/plugins/
    cp kak-ansi-filter $out/bin/
    # Hard-code path of filter and don't try to build when Kakoune boots
    sed '
      /^declare-option.* ansi_filter /i\
declare-option -hidden str ansi_filter %{'"$out"'/bin/kak-ansi-filter}
      /^declare-option.* ansi_filter /,/^}/d
    ' rc/ansi.kak >$out/share/kak/autoload/plugins/ansi.kak
  '';

  meta = with lib; {
    description = "Kakoune support for rendering ANSI code";
    homepage = "https://github.com/eraserhd/kak-ansi";
    license = licenses.unlicense;
    maintainers = with maintainers; [ eraserhd ];
    platforms = platforms.all;
  };
}