Gram: Difference between revisions
m Add translate tags |
|||
| Line 1: | Line 1: | ||
<translate> | |||
[https://gram-editor.com/ 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 [https://gram-editor.com/docs/mission/ mission statement]. | [https://gram-editor.com/ 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 [https://gram-editor.com/docs/mission/ mission statement]. | ||
| Line 12: | Line 13: | ||
Add <code>fenix</code> to your flake | Add <code>fenix</code> to your flake | ||
</translate> | |||
{{file|flake.nix|nix| | {{file|flake.nix|nix| | ||
| Line 27: | Line 29: | ||
}} | }} | ||
<translate> | |||
The examples all use the stable version attribute set, but any provided by <code>fenix</code> should work. | The examples all use the stable version attribute set, but any provided by <code>fenix</code> should work. | ||
| Line 35: | Line 38: | ||
==== Let In Statement ==== | ==== Let In Statement ==== | ||
</translate> | |||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix"> | ||
| Line 55: | Line 59: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<translate> | |||
==== HomeManager Packages ==== | ==== HomeManager Packages ==== | ||
</translate> | |||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix"> | ||
| Line 66: | Line 72: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<translate> | |||
==== NixOS Packages ==== | ==== NixOS Packages ==== | ||
</translate> | |||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix"> | ||
| Line 88: | Line 96: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<translate> | |||
==== Flake Parts devShell ==== | ==== Flake Parts devShell ==== | ||
If using flake parts, devShells need to have their inputs passed to them by <code>perSystem</code> rather than as a top-level attribute. The file paths are only examples and can be replaced to fit the structure of your project. | If using flake parts, devShells need to have their inputs passed to them by <code>perSystem</code> rather than as a top-level attribute. The file paths are only examples and can be replaced to fit the structure of your project. | ||
</translate> | |||
{{file|default.nix|nix| | {{file|default.nix|nix| | ||
| Line 131: | Line 141: | ||
}} | }} | ||
<translate> | |||
==== More About Extensions ==== | ==== More About Extensions ==== | ||
* [https://discourse.nixos.org/t/fail-to-add-extensions-to-gram/78466/2 NixOS Discourse: Fail To Add Extensions To Gram] | * [https://discourse.nixos.org/t/fail-to-add-extensions-to-gram/78466/2 NixOS Discourse: Fail To Add Extensions To Gram] | ||
* [[Talk:Gram#Using_Rustup_for_Building_Extensions]] | * [[Talk:Gram#Using_Rustup_for_Building_Extensions]] | ||
</translate> | |||
[[Category:Applications]] [[Category:Text Editor]] | [[Category:Applications]] [[Category:Text Editor]] | ||
Revision as of 19:29, 22 July 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 any 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
];
}