Files
zed/nix/shell.nix
Jakub Konka fdf5bf7e6a remote: Support building x86_64-linux-musl proxy in nix-darwin (#41291)
This change adds two things to our remote server build
process:
1. It now checks if all required tooling is installed before using it or installing it on demand. This includes checks for `rustup` and `cargo-zigbuild` in your `PATH`.
2. Next, if `ZED_BUILD_REMOTE_SERVER` contains `musl` and `ZED_ZSTD_MUSL_LIB`
is set, we will pass its value (the path) to `cargo-zigbuild` as `-C
link-arg=-L{path}`.

Release Notes:

- N/A
2025-10-28 06:58:09 +01:00

64 lines
1.5 KiB
Nix
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
mkShell,
makeFontsConf,
pkgsCross,
zed-editor,
rust-analyzer,
rustup,
cargo-nextest,
cargo-hakari,
cargo-machete,
cargo-zigbuild,
nixfmt-rfc-style,
protobuf,
nodejs_22,
zig,
}:
(mkShell.override { inherit (zed-editor) stdenv; }) {
inputsFrom = [ zed-editor ];
packages = [
rust-analyzer
rustup
cargo-nextest
cargo-hakari
cargo-machete
cargo-zigbuild
nixfmt-rfc-style
# TODO: package protobuf-language-server for editing zed.proto
# TODO: add other tools used in our scripts
# `build.nix` adds this to the `zed-editor` wrapper (see `postFixup`)
# we'll just put it on `$PATH`:
nodejs_22
zig
];
env =
let
baseEnvs =
(zed-editor.overrideAttrs (attrs: {
passthru = { inherit (attrs) env; };
})).env; # exfil `env`; it's not in drvAttrs
in
(removeAttrs baseEnvs [
"LK_CUSTOM_WEBRTC" # download the staticlib during the build as usual
"ZED_UPDATE_EXPLANATION" # allow auto-updates
"CARGO_PROFILE" # let you specify the profile
"TARGET_DIR"
])
// {
# note: different than `$FONTCONFIG_FILE` in `build.nix` this refers to relative paths
# outside the nix store instead of to `$src`
FONTCONFIG_FILE = makeFontsConf {
fontDirectories = [
"./assets/fonts/lilex"
"./assets/fonts/ibm-plex-sans"
];
};
PROTOC = "${protobuf}/bin/protoc";
ZED_ZSTD_MUSL_LIB = "${pkgsCross.musl64.pkgsStatic.zstd.out}/lib";
};
}