2023-08-22 20:05:09 +00:00
|
|
|
{ fetchpatch, fetchzip, lib, rustPlatform, git, installShellFiles, makeWrapper }:
|
2021-07-03 03:11:41 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "helix";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "23.10";
|
2021-07-03 03:11:41 +00:00
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
# This release tarball includes source code for the tree-sitter grammars,
|
|
|
|
# which is not ordinarily part of the repository.
|
2023-07-15 17:15:38 +00:00
|
|
|
src = fetchzip {
|
|
|
|
url = "https://github.com/helix-editor/helix/releases/download/${version}/helix-${version}-source.tar.xz";
|
2023-11-16 04:20:00 +00:00
|
|
|
hash = "sha256-PH4n+zm5ShwOrzzQm0Sn8b8JzAW/CF8UzzKZYE3e2WA=";
|
2023-07-15 17:15:38 +00:00
|
|
|
stripRoot = false;
|
|
|
|
};
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
cargoHash = "sha256-B8RO6BADDbPchowSfNVgviGvVgH23iF42DdhEBKBQzs=";
|
2023-08-22 20:05:09 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
nativeBuildInputs = [ git installShellFiles makeWrapper ];
|
2021-08-18 13:19:15 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
2023-07-15 17:15:38 +00:00
|
|
|
# not needed at runtime
|
|
|
|
rm -r runtime/grammars/sources
|
2022-04-27 09:35:20 +00:00
|
|
|
|
2021-08-18 13:19:15 +00:00
|
|
|
mkdir -p $out/lib
|
|
|
|
cp -r runtime $out/lib
|
2022-09-09 14:08:57 +00:00
|
|
|
installShellCompletion contrib/completion/hx.{bash,fish,zsh}
|
2023-03-24 00:07:29 +00:00
|
|
|
mkdir -p $out/share/{applications,icons/hicolor/256x256/apps}
|
2023-02-22 10:55:15 +00:00
|
|
|
cp contrib/Helix.desktop $out/share/applications
|
2023-03-24 00:07:29 +00:00
|
|
|
cp contrib/helix.png $out/share/icons/hicolor/256x256/apps
|
2021-08-18 13:19:15 +00:00
|
|
|
'';
|
|
|
|
postFixup = ''
|
|
|
|
wrapProgram $out/bin/hx --set HELIX_RUNTIME $out/lib/runtime
|
|
|
|
'';
|
2021-07-03 03:11:41 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A post-modern modal text editor";
|
|
|
|
homepage = "https://helix-editor.com";
|
|
|
|
license = licenses.mpl20;
|
2021-08-11 14:56:57 +00:00
|
|
|
mainProgram = "hx";
|
2023-05-24 13:37:59 +00:00
|
|
|
maintainers = with maintainers; [ danth yusdacra zowoq ];
|
2021-07-03 03:11:41 +00:00
|
|
|
};
|
|
|
|
}
|