2023-08-14 17:23:47 +00:00
|
|
|
{ fetchpatch, fetchzip, lib, rustPlatform, git, installShellFiles, makeWrapper }:
|
2021-06-30 01:54:42 +00:00
|
|
|
|
2023-05-23 05:32:53 +00:00
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "helix";
|
2023-05-18 15:07:32 +00:00
|
|
|
version = "23.05";
|
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";
|
|
|
|
hash = "sha256-3ZEToXwW569P7IFLqz6Un8rClnWrW5RiYKmRVFt7My8=";
|
|
|
|
stripRoot = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
cargoHash = "sha256-/LCtfyDAA2JuioBD/CDMv6OOxM0B9A3PpuVP/YY5oF0=";
|
2021-06-30 01:54:42 +00:00
|
|
|
|
2023-08-14 17:23:47 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://patch-diff.githubusercontent.com/raw/helix-editor/helix/pull/7227.patch";
|
|
|
|
hash = "sha256-dObMKHNJfc5TODUjZ28TVxuTen02rl8HzcXpFWnhB1k=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2023-05-23 05:32:53 +00:00
|
|
|
nativeBuildInputs = [ git installShellFiles makeWrapper ];
|
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
|
|
|
'';
|
|
|
|
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";
|
2023-05-22 06:50:28 +00:00
|
|
|
maintainers = with maintainers; [ danth yusdacra zowoq ];
|
2021-06-30 01:54:42 +00:00
|
|
|
};
|
|
|
|
}
|