about summary refs log tree commit diff
path: root/pkgs/applications/editors/helix
diff options
context:
space:
mode:
authorDaniel Thwaites <danthwaites30@btinternet.com>2022-04-04 15:33:39 +0100
committerYt <raphael@megzari.com>2022-04-05 08:28:59 -0400
commitdd37fc3587d78e370298a844bf764c8b797ee1ce (patch)
tree9d1eeaa5a458c0ef4b11e766e53090046e70d553 /pkgs/applications/editors/helix
parentfe982a28d0d101bbf4d61fbecdea86de8f17c020 (diff)
downloadnixlib-dd37fc3587d78e370298a844bf764c8b797ee1ce.tar
nixlib-dd37fc3587d78e370298a844bf764c8b797ee1ce.tar.gz
nixlib-dd37fc3587d78e370298a844bf764c8b797ee1ce.tar.bz2
nixlib-dd37fc3587d78e370298a844bf764c8b797ee1ce.tar.lz
nixlib-dd37fc3587d78e370298a844bf764c8b797ee1ce.tar.xz
nixlib-dd37fc3587d78e370298a844bf764c8b797ee1ce.tar.zst
nixlib-dd37fc3587d78e370298a844bf764c8b797ee1ce.zip
helix: use release tarball to fetch tree-sitter grammars
Diffstat (limited to 'pkgs/applications/editors/helix')
-rw-r--r--pkgs/applications/editors/helix/default.nix19
1 files changed, 7 insertions, 12 deletions
diff --git a/pkgs/applications/editors/helix/default.nix b/pkgs/applications/editors/helix/default.nix
index 78731ab333e1..fb1abcd6cffe 100644
--- a/pkgs/applications/editors/helix/default.nix
+++ b/pkgs/applications/editors/helix/default.nix
@@ -1,15 +1,15 @@
-{ fetchFromGitHub, lib, rustPlatform, makeWrapper }:
+{ fetchzip, lib, rustPlatform, makeWrapper }:
 
 rustPlatform.buildRustPackage rec {
   pname = "helix";
   version = "22.03";
 
-  src = fetchFromGitHub {
-    owner = "helix-editor";
-    repo = pname;
-    rev = version;
-    fetchSubmodules = true;
-    sha256 = "anUYKgr61QQmdraSYpvFY/2sG5hkN3a2MwplNZMEyfI=";
+  # This release tarball includes source code for the tree-sitter grammars,
+  # which is not ordinarily part of the repository.
+  src = fetchzip {
+    url = "https://github.com/helix-editor/helix/releases/download/${version}/helix-${version}-source.tar.xz";
+    sha256 = "DP/hh6JfnyHdW2bg0cvhwlWvruNDvL9bmXM46iAUQzA=";
+    stripRoot = false;
   };
 
   cargoSha256 = "zJQ+KvO+6iUIb0eJ+LnMbitxaqTxfqgu7XXj3j0GiX4=";
@@ -24,11 +24,6 @@ rustPlatform.buildRustPackage rec {
     wrapProgram $out/bin/hx --set HELIX_RUNTIME $out/lib/runtime
   '';
 
-  # This tries to fetch the tree-sitter grammars over the Internet:
-  # https://github.com/helix-editor/helix/blob/f8c83f98859fd618980141eb95e7927dcdf074d7/helix-loader/src/grammar.rs#L140-L185
-  # TODO: Download the grammars through Nix so that they can be enabled.
-  HELIX_DISABLE_AUTO_GRAMMAR_BUILD = true;
-
   meta = with lib; {
     description = "A post-modern modal text editor";
     homepage = "https://helix-editor.com";