2024-04-08 17:22:35 +00:00
|
|
|
{ fetchzip, lib, rustPlatform, git, installShellFiles }:
|
2021-06-30 01:54:42 +00:00
|
|
|
|
2023-05-23 05:32:53 +00:00
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "helix";
|
2024-07-14 18:52:37 +00:00
|
|
|
version = "24.07";
|
2021-06-30 01:54:42 +00:00
|
|
|
|
2023-05-18 15:07:32 +00:00
|
|
|
# This release tarball includes source code for the tree-sitter grammars,
|
|
|
|
# which is not ordinarily part of the repository.
|
2023-05-23 05:32:53 +00:00
|
|
|
src = fetchzip {
|
|
|
|
url = "https://github.com/helix-editor/helix/releases/download/${version}/helix-${version}-source.tar.xz";
|
2024-07-14 18:52:37 +00:00
|
|
|
hash = "sha256-R8foMx7YJ01ZS75275xPQ52Ns2EB3OPop10F4nicmoA=";
|
2023-05-23 05:32:53 +00:00
|
|
|
stripRoot = false;
|
|
|
|
};
|
|
|
|
|
2024-07-14 18:52:37 +00:00
|
|
|
cargoHash = "sha256-Y8zqdS8vl2koXmgFY0hZWWP1ZAO8JgwkoPTYPVpkWsA=";
|
2023-08-14 17:23:47 +00:00
|
|
|
|
2024-04-08 17:22:35 +00:00
|
|
|
nativeBuildInputs = [ git installShellFiles ];
|
|
|
|
|
2024-04-08 20:50:29 +00:00
|
|
|
env.HELIX_DEFAULT_RUNTIME = "${placeholder "out"}/lib/runtime";
|
2021-08-13 18:07:01 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
2023-05-23 05:32:53 +00:00
|
|
|
# not needed at runtime
|
|
|
|
rm -r runtime/grammars/sources
|
2022-04-28 20:27:12 +00:00
|
|
|
|
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
|
|
|
'';
|
2021-06-30 01:54:42 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Post-modern modal text editor";
|
|
|
|
homepage = "https://helix-editor.com";
|
|
|
|
license = licenses.mpl20;
|
2021-08-10 23:13:07 +00:00
|
|
|
mainProgram = "hx";
|
2023-05-22 06:50:28 +00:00
|
|
|
maintainers = with maintainers; [ danth yusdacra zowoq ];
|
2021-06-30 01:54:42 +00:00
|
|
|
};
|
|
|
|
}
|