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

hx --grammar fetch fails when using Helix built with Nix #3310

Closed
AumyF opened this issue Aug 3, 2022 · 4 comments
Closed

hx --grammar fetch fails when using Helix built with Nix #3310

AumyF opened this issue Aug 3, 2022 · 4 comments
Labels
C-bug Category: This is a bug

Comments

@AumyF
Copy link

AumyF commented Aug 3, 2022

Summary

helix --grammar fetch fails when using Helix built with Nix, since its runtime directory is set in Nix store which is not writable.

Reproduction Steps

  1. nix shell github:helix-editor/helix
  2. hx --grammar fetch

Helix log

Error: Failed to fetch some grammar(s)

Caused by:
    0: Could not create grammar directory "/nix/store/5znz3zwidqndnqa54ibhv1yfgxd5xmip-helix-runtime/grammars/sources/protobuf"
    1: Permission denied (os error 13)

Platform

Arch Linux

Terminal Emulator

foot 1.12.1

Helix Version

helix 22.05

@AumyF AumyF added the C-bug Category: This is a bug label Aug 3, 2022
@archseer
Copy link
Member

archseer commented Aug 3, 2022

There's a previous issue for this but it was closed: #2091 (comment)

@the-mikedavis the-mikedavis changed the title helix --grammar fetch fails when using Helix built with Nix hx --grammar fetch fails when using Helix built with Nix Aug 3, 2022
@the-mikedavis
Copy link
Member

You don't need to use hx -g fetch when using the Nix flake, grammars are fetched and built by nix when building hx. The runtime for nix is in the store which is immutable, so hx -g fetch and hx -g build fail.

I don't think there's an issue for it yet but like archseer says in the linked commit, we want to treat the runtime directory from installation (usually into /usr but /nix/store for nix) as immutable and have ~/.config/helix or other XDG dirs act as overrides like it does currently for configuration files like languages.toml

@tgharib
Copy link

tgharib commented Aug 6, 2022

hx --health to confirm highlighting (from treesitter) is working

@the-mikedavis
Copy link
Member

I'll close this out as expected behavior but I've opened up #3346 describing how we'd like to do this in the long-run. With a solution to that, hx -g fetch/hx -g build should act on ~/.config/helix/runtime rather than the Nix store.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug
Projects
None yet
Development

No branches or pull requests

4 participants