Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Helix additional language config fails because it cannot write to nix store #217860

Closed
aldafu opened this issue Feb 23, 2023 · 3 comments
Closed
Labels
0.kind: bug Something is broken

Comments

@aldafu
Copy link

aldafu commented Feb 23, 2023

Describe the bug

Helix allows to have a local configuration that adds support for other languages that are then highlighted based on that custom language configuration, see here for details: https://docs.helix-editor.com/languages.html

Once configured it is needed to "fetch" and "build" this configuration by running helix. Helix will then try to create a directory and generate some files, but that fails since it is not allowed to write to root owned /nix/store.

The error message is:

» hx --grammar fetch
Fetching 1 grammars
1 grammars failed to fetch
	Failure 1/1: Could not create grammar directory "/nix/store/py9sm09af0bj67jlrnlz2jwcsgkl5qag-helix-22.12/lib/runtime/grammars/sources/<actual-languagename-here>"

Steps To Reproduce

Steps to reproduce the behavior:

  1. Write/have tree-sitter grammar for additional language
  2. hx --grammar fetch

Expected behavior

Helix should work for custom languages that are added in the local configuration and be able to "fetch" and "build" these.

Additional context

Happy to provide if needed.

Notify maintainers

@danth @yusdacra @mweinelt

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

 - system: `"x86_64-darwin"`
 - host os: `Darwin 22.3.0, macOS 10.16`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.13.2`
 - channels(<user-redacted>): `"nixpkgs, nixpkgs-22.11-darwin-22.11-darwin"`
 - channels(root): `""`
 - nixpkgs: `/Users/<user-redacted>/.nix-defexpr/channels/nixpkgs`
@aldafu aldafu added the 0.kind: bug Something is broken label Feb 23, 2023
@gruhn
Copy link

gruhn commented Mar 2, 2023

same here

Edit:

Actually, since nix store is immuable, this is probably working as intended. The Helix people have issues for that:

helix-editor/helix#3310
helix-editor/helix#3346

@n8henrie
Copy link
Contributor

hx --grammar fetch is working for me on x86_64-linux and aarch64-darwin; it looks like a fix was merged in the issues you linked. @aldafu can you confirm and if so close?

@ofalvai
Copy link
Contributor

ofalvai commented Oct 6, 2024

I also think this can be closed. The latest docs say that ~/.config/helix/runtime has a higher priority than $HELIX_DEFAULT_RUNTIME (which the derivation sets correctly)

https://docs.helix-editor.com/building-from-source.html#multiple-runtime-directories

@n8henrie n8henrie closed this as completed Oct 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken
Projects
None yet
Development

No branches or pull requests

4 participants