zed/shell.nix
jvmncs a5961c8d45
Some checks are pending
CI / Check formatting and spelling (push) Waiting to run
CI / (macOS) Run Clippy and tests (push) Waiting to run
CI / (Linux) Run Clippy and tests (push) Waiting to run
CI / (Windows) Run Clippy and tests (push) Waiting to run
CI / Create a macOS bundle (push) Blocked by required conditions
CI / Create a Linux bundle (push) Blocked by required conditions
CI / Create arm64 Linux bundle (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
Point PROTOC to nixpkgs.protobuf pkg in shell.nix (#15931)
This fixes an issue on NixOS where Zed's proto crate fails to build.
Cargo expects to find protoc in the Cargo registry, but due to the
distro's non-standard filesystem this expectation is invalid.

Release Notes:

- N/A
2024-08-07 16:35:49 -04:00

57 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
(pkgs.mkShell.override { inherit stdenv; }) rec {
nativeBuildInputs = with pkgs; [
copyDesktopItems
curl
perl
pkg-config
protobuf
rustPlatform.bindgenHook
];
buildInputs = with pkgs; [
curl
fontconfig
freetype
libgit2
openssl
sqlite
zlib
zstd
alsa-lib
libxkbcommon
wayland
xorg.libxcb
];
env = {
LD_LIBRARY_PATH =
with pkgs;
lib.makeLibraryPath (
buildInputs
++ [
stdenv.cc.cc.lib
vulkan-loader
]
);
ZSTD_SYS_USE_PKG_CONFIG = true;
FONTCONFIG_FILE = pkgs.makeFontsConf {
fontDirectories = [
"assets/fonts/zed-mono"
"assets/fonts/zed-sans"
];
};
PROTOC = "${pkgs.protobuf}/bin/protoc";
};
}