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