anvil-editor: init at 0.4
[NixPkgs.git] / pkgs / applications / editors / kakoune / plugins / overrides.nix
blob6f60573f48b29e9f0c74fd60c1da08e31e72a991
1 { lib, stdenv, fetchFromGitHub, fetchFromGitLab, fetchgit
2 , buildKakounePluginFrom2Nix
3 , kakoune-lsp, parinfer-rust, rep
4 , fzf, git, guile, kakoune-unwrapped, lua5_3, plan9port
5 , rustPlatform
6 }:
8 self: super: {
9   inherit kakoune-lsp parinfer-rust rep;
11   case-kak = buildKakounePluginFrom2Nix {
12     pname = "case-kak";
13     version = "2020-04-06";
14     src = fetchFromGitLab {
15       owner = "FlyingWombat";
16       repo = "case.kak";
17       rev = "6f1511820aa3abfa118e0f856118adc8113e2185";
18       sha256 = "002njrlwgakqgp74wivbppr9qyn57dn4n5bxkr6k6nglk9qndwdp";
19     };
20     meta.homepage = "https://gitlab.com/FlyingWombat/case.kak";
21   };
23   fzf-kak = super.fzf-kak.overrideAttrs(oldAttrs: rec {
24     preFixup = ''
25       if [[ -x "${fzf}/bin/fzf" ]]; then
26         fzfImpl='${fzf}/bin/fzf'
27       else
28         fzfImpl='${fzf}/bin/sk'
29       fi
31       substituteInPlace $out/share/kak/autoload/plugins/fzf-kak/rc/fzf.kak \
32         --replace \'fzf\' \'"$fzfImpl"\'
33     '';
34   });
36   kak-ansi = stdenv.mkDerivation rec {
37     pname = "kak-ansi";
38     version = "0.2.4";
40     src = fetchFromGitHub {
41       owner = "eraserhd";
42       repo = "kak-ansi";
43       rev = "v${version}";
44       sha256 = "kFjTYFy0KF5WWEHU4hHFAnD/03/d3ptjqMMbTSaGImE=";
45     };
47     installPhase = ''
48       mkdir -p $out/bin $out/share/kak/autoload/plugins/
49       cp kak-ansi-filter $out/bin/
50       # Hard-code path of filter and don't try to build when Kakoune boots
51       sed '
52         /^declare-option.* ansi_filter /i\
53 declare-option -hidden str ansi_filter %{'"$out"'/bin/kak-ansi-filter}
54         /^declare-option.* ansi_filter /,/^}/d
55       ' rc/ansi.kak >$out/share/kak/autoload/plugins/ansi.kak
56     '';
58     meta = with lib; {
59       description = "Kakoune support for rendering ANSI code";
60       homepage = "https://github.com/eraserhd/kak-ansi";
61       license = licenses.unlicense;
62       maintainers = with maintainers; [ eraserhd philiptaron ];
63       platforms = platforms.all;
64     };
65   };
67   kak-plumb = stdenv.mkDerivation rec {
68     pname = "kak-plumb";
69     version = "0.1.1";
71     src = fetchFromGitHub {
72       owner = "eraserhd";
73       repo = "kak-plumb";
74       rev = "v${version}";
75       sha256 = "1rz6pr786slnf1a78m3sj09axr4d2lb5rg7sfa4mfg1zcjh06ps6";
76     };
78     installPhase = ''
79       mkdir -p $out/bin $out/share/kak/autoload/plugins/
80       substitute rc/plumb.kak $out/share/kak/autoload/plugins/plumb.kak \
81         --replace '9 plumb' '${plan9port}/bin/9 plumb'
82       substitute edit-client $out/bin/edit-client \
83         --replace '9 9p' '${plan9port}/bin/9 9p' \
84         --replace 'kak -p' '${kakoune-unwrapped}/bin/kak -p'
85       chmod +x $out/bin/edit-client
86     '';
88     meta = with lib; {
89       description = "Kakoune integration with the Plan 9 plumber";
90       homepage = "https://github.com/eraserhd/kak-plumb";
91       license = licenses.unlicense;
92       maintainers = with maintainers; [ eraserhd philiptaron ];
93       platforms = platforms.all;
94     };
95   };
97   kakoune-rainbow = super.kakoune-rainbow.overrideAttrs(oldAttrs: rec {
98     preFixup = ''
99       mkdir -p $out/bin
100       mv $out/share/kak/autoload/plugins/kakoune-rainbow/bin/kak-rainbow.scm $out/bin
101       substituteInPlace $out/bin/kak-rainbow.scm \
102         --replace '/usr/bin/env -S guile' '${guile}/bin/guile'
103       substituteInPlace $out/share/kak/autoload/plugins/kakoune-rainbow/rainbow.kak \
104         --replace '%sh{dirname "$kak_source"}' "'$out'"
105     '';
106   });
108   kakoune-state-save = buildKakounePluginFrom2Nix {
109     pname = "kakoune-state-save";
110     version = "2020-02-09";
112     src = fetchFromGitLab {
113       owner = "Screwtapello";
114       repo = "kakoune-state-save";
115       rev = "ab7c0c765326a4a80af78857469ee8c80814c52a";
116       sha256 = "AAOCG0TY3G188NnkkwMCSbkkNe487F4gwiFWwG9Yo+A=";
117     };
119     meta = with lib; {
120       description = "Help Kakoune save and restore state between sessions";
121       homepage = "https://gitlab.com/Screwtapello/kakoune-state-save";
122       license = licenses.mit;
123       maintainers = with maintainers; [ Flakebi philiptaron ];
124       platforms = platforms.all;
125     };
126   };
128   powerline-kak = super.powerline-kak.overrideAttrs(oldAttrs: rec {
129     preFixup = ''
130       substituteInPlace $out/share/kak/autoload/plugins/powerline-kak/rc/modules/git.kak \
131         --replace ' git ' ' ${git}/bin/git '
132     '';
133   });
135   hop-kak = rustPlatform.buildRustPackage rec {
136     pname = "hop-kak";
137     version = "0.2.0";
139     src = fetchgit {
140       url = "https://git.sr.ht/~hadronized/hop.kak";
141       rev = "7314ec64809a69e0044ba7ec57a18b43e3b5f005";
142       sha256 = "stmGZQU0tp+5xxrexKMzwSwHj5F/F4HzDO9BorNWC3w=";
144       # this package uses git to put the commit hash in the
145       # help dialog, so leave the .git folder so the command
146       # succeeds.
147       leaveDotGit = true;
148     };
150     nativeBuildInputs = [
151       git
152     ];
154     cargoHash = "sha256-EjSj/+BysGwJBxK6Ccg2+pXHdB2Lg3dxIURRsSVTHVY=";
156     postInstall = ''
157       mkdir -p $out/share/kak/bin
158       mv $out/bin/hop-kak $out/share/kak/bin/
159     '';
161     meta = with lib; {
162       description = "hinting brought to Kakoune selections";
163       homepage = "https://git.sr.ht/~hadronized/hop.kak/";
164       license = licenses.bsd3;
165       maintainers = with maintainers; [ oleina ];
166       platforms = platforms.all;
167     };
168   };
170   quickscope-kak = buildKakounePluginFrom2Nix rec {
171     pname = "quickscope-kak";
172     version = "1.0.0";
174     src = fetchgit {
175       url = "https://git.sr.ht/~voroskoi/quickscope.kak";
176       rev = "v${version}";
177       sha256 = "0y1g3zpa2ql8l9rl5i2w84bka8a09kig9nq9zdchaff5pw660mcx";
178     };
180     buildInputs = [ lua5_3 ];
182     installPhase = ''
183       mkdir -p $out/share/kak/autoload/plugins/
184       cp quickscope.* $out/share/kak/autoload/plugins/
185       # substituteInPlace does not like the pipe
186       sed -e 's,[|] *lua,|${lua5_3}/bin/lua,' quickscope.kak >$out/share/kak/autoload/plugins/quickscope.kak
187     '';
189     meta = with lib; {
190       description = "Highlight f and t jump positions";
191       homepage = "https://sr.ht/~voroskoi/quickscope.kak/";
192       license = licenses.unlicense;
193       maintainers = with maintainers; [ eraserhd ];
194       platforms = platforms.all;
195     };
196   };
198   kakoune-catppuccin = buildKakounePluginFrom2Nix {
199     pname = "kakoune-catppuccin";
200     version = "0-unstable-2024-03-29";
201     src = fetchFromGitHub {
202       owner = "catppuccin";
203       repo = "kakoune";
204       rev = "7f187d9da2867a7fda568b2135d29b9c00cfbb94";
205       hash = "sha256-acBOQuJ8MgsMKdvFV5B2CxuxvXIYsg11n1mHEGqd120=";
206     };
207     meta = with lib; {
208       description = "Soothing pastel theme for Kakoune";
209       homepage = "https://github.com/catppuccin/kakoune/";
210       license = licenses.mit;
211       platforms = platforms.all;
212       maintainers = with maintainers; [ philipwilk ];
213     };
214   };