Merge pull request #329823 from ExpidusOS/fix/pkgsllvm/elfutils
[NixPkgs.git] / pkgs / by-name / ev / evil-helix / package.nix
blobe53faa61d6d947390701a1152bde95eaba16a3d1
1 { lib
2 , fetchFromGitHub
3 , helix
4 , installShellFiles
5 , rustPlatform
6 }:
8 rustPlatform.buildRustPackage rec {
9   pname = "evil-helix";
10   version = "20240716";
12   src = fetchFromGitHub {
13     owner = "usagi-flow";
14     repo = "evil-helix";
15     rev = "release-${version}";
16     hash = "sha256-nvLo8bWjiLJjM+pZArMKu4gjEFPrlqDI/Kf+W8fs9L8=";
17   };
19   cargoHash = "sha256-2qrfw/QVfZZ3GTBalNne4QYQsI+JZBf5FdLJD84gnS4=";
21   nativeBuildInputs = [ installShellFiles ];
23   env = {
24     # disable fetching and building of tree-sitter grammars in the helix-term build.rs
25     HELIX_DISABLE_AUTO_GRAMMAR_BUILD = "1";
26     HELIX_DEFAULT_RUNTIME = "${placeholder "out"}/lib/runtime";
27   };
29   postInstall = ''
30     mkdir -p $out/lib
31     cp -r runtime $out/lib
32     # copy tree-sitter grammars from helix package
33     # TODO: build it from source instead
34     cp -r ${helix}/lib/runtime/grammars/* $out/lib/runtime/grammars/
35     installShellCompletion contrib/completion/hx.{bash,fish,zsh}
36     mkdir -p $out/share/{applications,icons/hicolor/256x256/apps}
37     cp contrib/Helix.desktop $out/share/applications
38     cp contrib/helix.png $out/share/icons/hicolor/256x256/apps
39   '';
41   meta = {
42     description = "Post-modern modal text editor, with vim keybindings";
43     homepage = "https://github.com/usagi-flow/evil-helix";
44     license = lib.licenses.mpl20;
45     mainProgram = "hx";
46     maintainers = with lib.maintainers; [ thiagokokada ];
47   };