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