2022-09-05 12:11:51 +02:00
|
|
|
{ fetchzip, lib, rustPlatform, installShellFiles, makeWrapper }:
|
2021-06-30 03:54:42 +02:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "helix";
|
2022-09-01 20:02:09 +02:00
|
|
|
version = "22.08.1";
|
2021-06-30 03:54:42 +02:00
|
|
|
|
2022-04-04 16:33:39 +02:00
|
|
|
# This release tarball includes source code for the tree-sitter grammars,
|
|
|
|
# which is not ordinarily part of the repository.
|
|
|
|
src = fetchzip {
|
|
|
|
url = "https://github.com/helix-editor/helix/releases/download/${version}/helix-${version}-source.tar.xz";
|
2022-09-01 20:02:09 +02:00
|
|
|
sha256 = "sha256-pqAhUxKeFN7eebVdNN3Ge38sA30SUSu4Xn4HDZAjjyY=";
|
2022-04-04 16:33:39 +02:00
|
|
|
stripRoot = false;
|
2021-06-30 03:54:42 +02:00
|
|
|
};
|
|
|
|
|
2022-09-01 20:02:09 +02:00
|
|
|
cargoSha256 = "sha256-idItRkymr+cxk3zv2mPBR/frCGvzEUdSAhY7gghfR3M=";
|
2021-06-30 03:54:42 +02:00
|
|
|
|
2022-09-05 12:11:51 +02:00
|
|
|
nativeBuildInputs = [ installShellFiles makeWrapper ];
|
2021-08-13 20:07:01 +02:00
|
|
|
|
|
|
|
postInstall = ''
|
2022-04-28 22:27:12 +02:00
|
|
|
# not needed at runtime
|
|
|
|
rm -r runtime/grammars/sources
|
|
|
|
|
2021-08-13 20:07:01 +02:00
|
|
|
mkdir -p $out/lib
|
|
|
|
cp -r runtime $out/lib
|
2022-09-05 12:11:51 +02:00
|
|
|
installShellCompletion contrib/completion/hx.{bash,fish,zsh}
|
2021-08-13 20:07:01 +02:00
|
|
|
'';
|
|
|
|
postFixup = ''
|
|
|
|
wrapProgram $out/bin/hx --set HELIX_RUNTIME $out/lib/runtime
|
|
|
|
'';
|
2021-06-30 03:54:42 +02:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A post-modern modal text editor";
|
|
|
|
homepage = "https://helix-editor.com";
|
|
|
|
license = licenses.mpl20;
|
2021-08-11 01:13:07 +02:00
|
|
|
mainProgram = "hx";
|
2022-04-04 12:12:33 +02:00
|
|
|
maintainers = with maintainers; [ danth yusdacra ];
|
2021-06-30 03:54:42 +02:00
|
|
|
};
|
|
|
|
}
|