Gram is a new fork of Zed which was recently packaged for NixOS.
I was trying it on a simple web project and it needed to install the superhtml language serve. It needed rustup for that, which I added to my list of packages. However, I’m getting an error which I can’t debug give I know nothing about Rust, Gram and Zed.
Has anyone already successfully added extensions to it?
Alternatively, I would add them in my nix config, but I believe the package/app doesn’t allow that yet?
I just spent today figuring this out. Personally I made a fork of the programs.zed-editor home manager module and I’ve been using that (here if you’d like to reference it).
I also wrote up a Gram NixOS Wiki page with instructions for other ways to add the needed dependencies to build extensions. It’s structured a little weird but hopefully it’s helpful. I think I tested all of the options listed but it’s possible I missed something or there’s syntax errors. Lmk if you run into any problems.
And I believe you are correct that right now Gram does not support the auto_install_extensions config property.
If you just want to use rustup I think (though I’m not very familiar with Rust) the only clean way to set it up is undeclarative, running rustup default ${toolchain-branch}, like as it shows in the example rustup default stable, and I think you will also need clang installed or you will get a cc error iirc.
Package maintainer of gram in nixpkgs here. My preferred idea was to actually build extensions as Nix derivations, to also benefit from binary caching. As far as I’m aware, we already have all the necessary tools for that (compilers with the required targets) in nixpkgs. This wouldn’t have to happen inside nixpkgs of course, an automated repository such as GitHub - nix-community/nix-vscode-extensions: Nix expressions for VS Code Marketplace and Open VSX extensions [maintainers=@deemp, @ameertaweel] · GitHub seems like a better solution. For convenience the build helper would be in nixpkgs (also for use with untracked extensions) and the package repository could become a community effort.
Until something like this exists, @smudgebun’s NixOS wiki article looks perfect!