mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-27 10:59:53 +00:00
eda7e88fd4
Previously the rustc and cargo did were not declared dependencies supplied to devshell. This means that shell relied some impure cargo and rustc version found in the system. This lead to issues with GLIBC version on systems which have different GLIBC version globally. This package exposes nixpkgs rustc and cargo version into the shell preventing issues with incompatibility. Release Notes: - N/A
52 lines
1.1 KiB
Nix
52 lines
1.1 KiB
Nix
{pkgs ? import <nixpkgs> {}}: let
|
|
stdenv = pkgs.stdenvAdapters.useMoldLinker pkgs.llvmPackages_18.stdenv;
|
|
in
|
|
if pkgs.stdenv.isDarwin
|
|
then
|
|
# See https://github.com/NixOS/nixpkgs/issues/320084
|
|
throw "zed: nix dev-shell isn't supported on darwin yet."
|
|
else let
|
|
buildInputs = with pkgs; [
|
|
curl
|
|
fontconfig
|
|
freetype
|
|
libgit2
|
|
openssl
|
|
sqlite
|
|
zlib
|
|
zstd
|
|
alsa-lib
|
|
libxkbcommon
|
|
wayland
|
|
xorg.libxcb
|
|
vulkan-loader
|
|
rustc
|
|
cargo
|
|
];
|
|
in
|
|
pkgs.mkShell.override {inherit stdenv;} {
|
|
nativeBuildInputs = with pkgs; [
|
|
clang
|
|
curl
|
|
cmake
|
|
perl
|
|
pkg-config
|
|
protobuf
|
|
rustPlatform.bindgenHook
|
|
];
|
|
|
|
inherit buildInputs;
|
|
|
|
shellHook = ''
|
|
export LD_LIBRARY_PATH="${pkgs.lib.makeLibraryPath buildInputs}:$LD_LIBRARY_PATH"
|
|
export PROTOC="${pkgs.protobuf}/bin/protoc"
|
|
'';
|
|
|
|
FONTCONFIG_FILE = pkgs.makeFontsConf {
|
|
fontDirectories = [
|
|
"./assets/fonts/zed-mono"
|
|
"./assets/fonts/zed-sans"
|
|
];
|
|
};
|
|
ZSTD_SYS_USE_PKG_CONFIG = true;
|
|
}
|