nixpkgs/pkgs/applications/editors/helix/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

49 lines
1.5 KiB
Nix
Raw Normal View History

{ fetchpatch, fetchzip, lib, rustPlatform, git, installShellFiles, makeWrapper }:
2023-05-23 05:32:53 +00:00
rustPlatform.buildRustPackage rec {
pname = "helix";
version = "23.05";
# 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=";
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
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
'';
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 ];
};
}