Add zed-editor
package and overlay to flake (#16783)
Adds a `zed-editor` package to the flake, along with exported overlay. Uses [`crane`](https://crane.dev) to avoid issues with updating git-sourced dependencies' hashes. Crane will also be useful if we want to export separate packages for `stable`, `preview`, and `nightly` in the future. Release Notes: - Added a default package + overlay to Zed's Nix flake. This is useful for users wanting to pilot nightly builds of Zed on NixOS.
This commit is contained in:
parent
7936fe40ae
commit
093f131712
6 changed files with 341 additions and 81 deletions
52
nix/shell.nix
Normal file
52
nix/shell.nix
Normal file
|
@ -0,0 +1,52 @@
|
|||
{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
|
||||
];
|
||||
in
|
||||
pkgs.mkShell.override {inherit stdenv;} {
|
||||
nativeBuildInputs = with pkgs; [
|
||||
clang
|
||||
curl
|
||||
perl
|
||||
pkg-config
|
||||
protobuf
|
||||
rustPlatform.bindgenHook
|
||||
];
|
||||
|
||||
inherit buildInputs;
|
||||
|
||||
shellHook = ''
|
||||
export LD_LIBRARY_PATH="${pkgs.lib.makeLibraryPath ([
|
||||
pkgs.vulkan-loader
|
||||
]
|
||||
++ 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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue