1{
 2  mkShell,
 3  makeFontsConf,
 4
 5  zed-editor,
 6
 7  rust-analyzer,
 8  cargo-nextest,
 9  cargo-hakari,
10  cargo-machete,
11  nixfmt-rfc-style,
12  protobuf,
13  nodejs_22,
14}:
15(mkShell.override { inherit (zed-editor) stdenv; }) {
16  inputsFrom = [ zed-editor ];
17  packages = [
18    rust-analyzer
19    cargo-nextest
20    cargo-hakari
21    cargo-machete
22    nixfmt-rfc-style
23    # TODO: package protobuf-language-server for editing zed.proto
24    # TODO: add other tools used in our scripts
25
26    # `build.nix` adds this to the `zed-editor` wrapper (see `postFixup`)
27    # we'll just put it on `$PATH`:
28    nodejs_22
29  ];
30
31  env =
32    let
33      baseEnvs =
34        (zed-editor.overrideAttrs (attrs: {
35          passthru = { inherit (attrs) env; };
36        })).env; # exfil `env`; it's not in drvAttrs
37    in
38    (removeAttrs baseEnvs [
39      "LK_CUSTOM_WEBRTC" # download the staticlib during the build as usual
40      "ZED_UPDATE_EXPLANATION" # allow auto-updates
41      "CARGO_PROFILE" # let you specify the profile
42      "TARGET_DIR"
43    ])
44    // {
45      # note: different than `$FONTCONFIG_FILE` in `build.nix` – this refers to relative paths
46      # outside the nix store instead of to `$src`
47      FONTCONFIG_FILE = makeFontsConf {
48        fontDirectories = [
49          "./assets/fonts/lilex"
50          "./assets/fonts/ibm-plex-sans"
51        ];
52      };
53      PROTOC = "${protobuf}/bin/protoc";
54    };
55}