···35 darwinMinVersionHook,
36 makeWrapper,
37 nodejs_22,
00003839 withGLES ? false,
40}:
···89in
90rustPlatform.buildRustPackage rec {
91 pname = "zed-editor";
92- version = "0.165.4";
9394 src = fetchFromGitHub {
95 owner = "zed-industries";
96 repo = "zed";
97- rev = "refs/tags/v${version}";
98- hash = "sha256-g+ZHchlxeNDkxUM306OK3BsjrvO3snF4vcQQZJSIhLc=";
99 };
100101- patches =
102- [
103- # Zed uses cargo-install to install cargo-about during the script execution.
104- # We provide cargo-about ourselves and can skip this step.
105- # Until https://github.com/zed-industries/zed/issues/19971 is fixed,
106- # we also skip any crate for which the license cannot be determined.
107- ./0001-generate-licenses.patch
108- ]
109- ++ lib.optionals stdenv.hostPlatform.isDarwin [
110- # The Swift variant of livekit currently used inside Zed requires
111- # Swift 6, which is not available in nixpkgs yet:
112- # https://github.com/NixOS/nixpkgs/issues/343210
113- # The Rust variant of livekit for Zed is still pending and there is no
114- # schedule when it will be finished:
115- # https://github.com/zed-industries/zed/pull/13343
116- ./0002-disable-livekit-darwin.patch
117- ];
0000000118119 useFetchCargoVendor = true;
120- cargoHash = "sha256-ZNXvuHX9b3T58FUs9TjpfiGYNr9J3IDbz2JE6Vy7Sg0=";
121122 nativeBuildInputs =
123 [
···151 libxkbcommon
152 wayland
153 xorg.libxcb
0000154 ]
155 ++ lib.optionals stdenv.hostPlatform.isDarwin [
156 apple-sdk_15
157- # This will need to be increased to 12.3 once
158- # https://github.com/zed-industries/zed/pull/13343
159- # is merged and released, as ScreenCaptureKit is only available on 12.3 and up:
160 # https://developer.apple.com/documentation/screencapturekit
161- (darwinMinVersionHook "10.15")
162 ];
163164 cargoBuildFlags = [
···183 ZED_UPDATE_EXPLANATION = "Zed has been installed using Nix. Auto-updates have thus been disabled.";
184 # Used by `zed --version`
185 RELEASE_VERSION = version;
0186 };
187188 RUSTFLAGS = if withGLES then "--cfg gles" else "";
···286 passthru = {
287 updateScript = gitUpdater {
288 rev-prefix = "v";
289- ignoredVersions = "pre";
290 };
291 fhs = fhs { };
292 fhsWithPackages = f: fhs { additionalPkgs = f; };
···295 meta = {
296 description = "High-performance, multiplayer code editor from the creators of Atom and Tree-sitter";
297 homepage = "https://zed.dev";
298- changelog = "https://github.com/zed-industries/zed/releases/tag/v${version}";
299 license = lib.licenses.gpl3Only;
300 maintainers = with lib.maintainers; [
301 GaetanLepage
···35 darwinMinVersionHook,
36 makeWrapper,
37 nodejs_22,
38+ libGL,
39+ libX11,
40+ libXext,
41+ livekit-libwebrtc,
4243 withGLES ? false,
44}:
···93in
94rustPlatform.buildRustPackage rec {
95 pname = "zed-editor";
96+ version = "0.166.1";
9798 src = fetchFromGitHub {
99 owner = "zed-industries";
100 repo = "zed";
101+ tag = "v${version}";
102+ hash = "sha256-ss4dz9qPAP6eIYbG3S5QJaSR5zEyEqLBjfacj/eb7AE=";
103 };
104105+ patches = [
106+ # Zed uses cargo-install to install cargo-about during the script execution.
107+ # We provide cargo-about ourselves and can skip this step.
108+ # Until https://github.com/zed-industries/zed/issues/19971 is fixed,
109+ # we also skip any crate for which the license cannot be determined.
110+ ./0001-generate-licenses.patch
111+ # See https://github.com/zed-industries/zed/pull/21661#issuecomment-2524161840
112+ "script/patches/use-cross-platform-livekit.patch"
113+ ];
114+115+ postPatch =
116+ lib.optionalString stdenv.hostPlatform.isLinux ''
117+ # Dynamically link WebRTC instead of static
118+ substituteInPlace ../${pname}-${version}-vendor/webrtc-sys-*/build.rs \
119+ --replace-fail "cargo:rustc-link-lib=static=webrtc" "cargo:rustc-link-lib=dylib=webrtc"
120+ ''
121+ + lib.optionalString stdenv.hostPlatform.isDarwin ''
122+ # On Darwin, linking against the dylib results in Rust linker errors, while
123+ # linking against the framework works fine.
124+ substituteInPlace ../${pname}-${version}-vendor/webrtc-sys-*/build.rs \
125+ --replace-fail "cargo:rustc-link-lib=static=webrtc" "cargo:rustc-link-lib=framework=webrtc" \
126+ --replace-fail 'println!("cargo:rustc-link-search=native={}", webrtc_lib.to_str().unwrap());' \
127+ 'println!("cargo:rustc-link-search=framework={}/Library/Frameworks", webrtc_dir.to_str().unwrap());'
128+ '';
129130 useFetchCargoVendor = true;
131+ cargoHash = "sha256-HbOdY+6FKGTK5gW2BkWSdciBvTx+oKhCchFvwKEoGNE=";
132133 nativeBuildInputs =
134 [
···162 libxkbcommon
163 wayland
164 xorg.libxcb
165+ # required by livekit:
166+ libGL
167+ libX11
168+ libXext
169 ]
170 ++ lib.optionals stdenv.hostPlatform.isDarwin [
171 apple-sdk_15
172+ # ScreenCaptureKit, required by livekit, is only available on 12.3 and up:
00173 # https://developer.apple.com/documentation/screencapturekit
174+ (darwinMinVersionHook "12.3")
175 ];
176177 cargoBuildFlags = [
···196 ZED_UPDATE_EXPLANATION = "Zed has been installed using Nix. Auto-updates have thus been disabled.";
197 # Used by `zed --version`
198 RELEASE_VERSION = version;
199+ LK_CUSTOM_WEBRTC = livekit-libwebrtc;
200 };
201202 RUSTFLAGS = if withGLES then "--cfg gles" else "";
···300 passthru = {
301 updateScript = gitUpdater {
302 rev-prefix = "v";
303+ ignoredVersions = "(*-pre|0.999999.0|0.9999-temporary)";
304 };
305 fhs = fhs { };
306 fhsWithPackages = f: fhs { additionalPkgs = f; };
···309 meta = {
310 description = "High-performance, multiplayer code editor from the creators of Atom and Tree-sitter";
311 homepage = "https://zed.dev";
312+ changelog = "https://github.com/zed-industries/zed/releases/tag/${src.tag}";
313 license = lib.licenses.gpl3Only;
314 maintainers = with lib.maintainers; [
315 GaetanLepage