From 19558839b72717a5fc1d1620f73e7a9dfc5dfd6a Mon Sep 17 00:00:00 2001
From: Michael Davis <mcarsondavis@gmail.com>
Date: Thu, 6 Mar 2025 18:38:44 -0500
Subject: [PATCH] flake: Avoid setting HELIX_RUNTIME in devShell

The runtime directory should be correctly set without the need to set
HELIX_RUNTIME manually because we check for a runtime directory within
CARGO_MANIFEST_DIR.

This change also filters the runtime directory out of the source file
set passed to buildRustPackage since the runtime directory is not needed
at compilation time.
---
 default.nix | 3 ++-
 flake.nix   | 1 -
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/default.nix b/default.nix
index 2f8ea435..d94e707d 100644
--- a/default.nix
+++ b/default.nix
@@ -16,6 +16,7 @@
     ./screenshot.png
     ./book
     ./docs
+    ./runtime
     ./flake.lock
     (fs.fileFilter (file: lib.strings.hasInfix ".git" file.name) ./.)
     (fs.fileFilter (file: file.hasExt "svg") ./.)
@@ -66,7 +67,7 @@ in
     doCheck = false;
     strictDeps = true;
 
-    # Sets the Helix runtimedir to the grammars
+    # Sets the Helix runtime dir to the grammars
     env.HELIX_DEFAULT_RUNTIME = "${runtimeDir}";
 
     # Get all the application stuff in the output directory.
diff --git a/flake.nix b/flake.nix
index 0a92e23d..b093ded5 100644
--- a/flake.nix
+++ b/flake.nix
@@ -72,7 +72,6 @@
             ++ (lib.optional stdenv.isLinux lldb)
             ++ (lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.CoreFoundation);
           shellHook = ''
-            export HELIX_RUNTIME="$PWD/runtime"
             export RUST_BACKTRACE="1"
             export RUSTFLAGS="''${RUSTFLAGS:-""} ${rustFlagsEnv}"
           '';