2022-09-05 10:11:51 +00:00
|
|
|
{ fetchzip, lib, rustPlatform, installShellFiles, makeWrapper }:
|
2021-06-30 01:54:42 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "helix";
|
2023-04-02 20:43:03 +00:00
|
|
|
version = "23.03";
|
2021-06-30 01:54:42 +00:00
|
|
|
|
2022-04-04 14:33:39 +00: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";
|
2023-04-02 20:43:03 +00:00
|
|
|
hash = "sha256-FtY2V7za3WGeUaC2t2f63CcDUEg9zAS2cGUWI0YeGwk=";
|
2022-04-04 14:33:39 +00:00
|
|
|
stripRoot = false;
|
2021-06-30 01:54:42 +00:00
|
|
|
};
|
|
|
|
|
2023-04-02 20:43:03 +00:00
|
|
|
# should be removed, when tree-sitter is not used as a git checkout anymore
|
|
|
|
cargoLock = {
|
|
|
|
lockFile = ./Cargo.lock;
|
|
|
|
outputHashes = {
|
|
|
|
"tree-sitter-0.20.9" = "sha256-/PaFaASOT0Z8FpipX5uiRCjnv1kyZtg4B9+TnHA0yTY=";
|
|
|
|
};
|
|
|
|
};
|
2021-06-30 01:54:42 +00:00
|
|
|
|
2022-09-05 10:11:51 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles makeWrapper ];
|
2021-08-13 18:07:01 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
2022-04-28 20:27:12 +00:00
|
|
|
# not needed at runtime
|
|
|
|
rm -r runtime/grammars/sources
|
|
|
|
|
2021-08-13 18:07:01 +00:00
|
|
|
mkdir -p $out/lib
|
|
|
|
cp -r runtime $out/lib
|
2022-09-05 10:11:51 +00:00
|
|
|
installShellCompletion contrib/completion/hx.{bash,fish,zsh}
|
2023-03-21 17:15:55 +00:00
|
|
|
mkdir -p $out/share/{applications,icons/hicolor/256x256/apps}
|
2023-02-16 21:57:28 +00:00
|
|
|
cp contrib/Helix.desktop $out/share/applications
|
2023-03-21 17:15:55 +00:00
|
|
|
cp contrib/helix.png $out/share/icons/hicolor/256x256/apps
|
2021-08-13 18:07:01 +00:00
|
|
|
'';
|
|
|
|
postFixup = ''
|
|
|
|
wrapProgram $out/bin/hx --set HELIX_RUNTIME $out/lib/runtime
|
|
|
|
'';
|
2021-06-30 01:54:42 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A post-modern modal text editor";
|
|
|
|
homepage = "https://helix-editor.com";
|
|
|
|
license = licenses.mpl20;
|
2021-08-10 23:13:07 +00:00
|
|
|
mainProgram = "hx";
|
2022-04-04 10:12:33 +00:00
|
|
|
maintainers = with maintainers; [ danth yusdacra ];
|
2021-06-30 01:54:42 +00:00
|
|
|
};
|
|
|
|
}
|