Gram: Difference between revisions
m Add translate tags |
→Installing Extensions: Add troubleshooting steps for possible issues with toolchain installation |
||
| Line 30: | Line 30: | ||
<translate> | <translate> | ||
The examples all use the stable version attribute set, but | The examples all use the stable version attribute set, but others provided by <code>fenix</code> should work. | ||
{{info| Make sure the versions match between <code>${version}.toolchain</code> (or <code>${version}.rustc</code> + <code>${version}.cargo</code>) & <code>targets.wasm32-wasip2.${version}.stable.rust-std</code> | {{info| Make sure the versions match between <code>${version}.toolchain</code> (or <code>${version}.rustc</code> + <code>${version}.cargo</code>) & <code>targets.wasm32-wasip2.${version}.stable.rust-std</code> | ||
| Line 140: | Line 140: | ||
</nowiki> | </nowiki> | ||
}} | }} | ||
==== Troubleshooting Extension Install ==== | |||
If you get the error <code>failed to run `rustup target add`: no such file or directory</code>, enter Gram's terminal and run | |||
<syntaxhighlight lang="shell"> | |||
ls $(rustc --print sysroot)/lib/rustlib | |||
</syntaxhighlight> | |||
If there is no directory named <code>wasm32-wasip2</code>, and there is one named something like <code>wasm32-unknown-unknown</code>, this likely means fenix has installed the target weirdly. On fenix this has been fixable by changing your version, for instance to <code>latest</code>. | |||
<translate> | <translate> | ||
Revision as of 21:36, 7 August 2026
Gram is a hard fork of Zed removing AI integration and telemetry as well as no user agreement or subscription, among other features. For more on the reasoning for and purpose of the fork see the mission statement.
Installation
Gram is available in nixpkgs as gram.
Configuration
Installing Extensions
Gram, unlike Zed, builds extensions locally. This means it needs a Rust WASI Toolchain and clang available to it while installing them. Currently, the easiest way to do this is using something like nix-community/fenix (the same should be able to be done with rust-overlay).
Add fenix to your flake
{
inputs = {
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
nixpkgs.url = "nixpkgs/nixos-unstable"; # or any other branch
};
}
The examples all use the stable version attribute set, but others provided by fenix should work.
${version}.toolchain (or ${version}.rustc + ${version}.cargo) & targets.wasm32-wasip2.${version}.stable.rust-std
You should be able to copy & paste the let in statement with any of the usage examples below (unless otherwise specified) into a nix module of the appropriate type (homeManager, nixos, devShell). Note that the devShell examples will only work if you launch Gram from in the shell.
Let In Statement
{inputs, pkgs, system, ... }:
let
# full toolchain:
/*
extension-toolchain = with inputs.fenix.packages.${system}; combine [
stable.toolchain
targets.wasm32-wasip2.stable.rust-std
];
*/
# minimum required to build:
extension-toolchain = with inputs.fenix.packages.${system}; combine [
stable.rustc
stable.cargo
targets.wasm32-wasip2.stable.rust-std
];
in
HomeManager Packages
{
home.packages = with pkgs; [
clang
extension-toolchain
];
}
NixOS Packages
{
environment.systemPackages = with pkgs; [
clang
extension-toolchain
];
}
devShell
{
packages = with pkgs; [
clang
extension-toolchain
];
}
Flake Parts devShell
If using flake parts, devShells need to have their inputs passed to them by perSystem rather than as a top-level attribute. The file paths are only examples and can be replaced to fit the structure of your project.
{ inputs, ... }:
{
perSystem = { config, pkgs, system, flake, ... }: {
devShells.gram = pkgs.callPackage nix/shells/default { fenix = inputs.fenix.packages.${system}; };
};
};
}
{ pkgs, fenix, }:
let
# 1. full toolchain:
/*
extension-toolchain = with fenix; combine [
stable.toolchain
targets.wasm32-wasip2.stable.rust-std
];
*/
# 2. minimum required to build:
extension-toolchain = with fenix; combine [
stable.rustc
stable.cargo
targets.wasm32-wasip2.stable.rust-std
];
in
pkgs.mkShell {
packages = with pkgs; [
extension-toolchain
clang
];
}
Troubleshooting Extension Install
If you get the error failed to run `rustup target add`: no such file or directory, enter Gram's terminal and run
ls $(rustc --print sysroot)/lib/rustlib
If there is no directory named wasm32-wasip2, and there is one named something like wasm32-unknown-unknown, this likely means fenix has installed the target weirdly. On fenix this has been fixable by changing your version, for instance to latest.