23 , enableWayland ? stdenv.hostPlatform.isLinux
27 rustPlatform.buildRustPackage.override { stdenv = clangStdenv; } rec {
31 src = fetchFromGitHub {
35 hash = "sha256-u10JxMvXC/FIobeolWJElBZuCiJ3xIUg4F0vLom7/S0=";
38 cargoHash = "sha256-j8++watC7RBc1zn8m7Jg0Zl/iKXSrld+q62GiaLxGCo=";
42 repo = fetchFromGitHub {
45 # see rust-skia:skia-bindings/Cargo.toml#package.metadata skia
47 hash = "sha256-4l6ekAJy+pG27hBGT6A6LLRwbsyKinJf6PP6mMHwaAs=";
49 # The externals for skia are taken from skia/DEPS
50 externals = linkFarm "skia-externals" (lib.mapAttrsToList
51 (name: value: { inherit name; path = fetchgit value; })
52 (lib.importJSON ./skia-externals.json));
54 runCommand "source" { } ''
57 ln -s ${externals} $out/third_party/externals
61 SKIA_GN_COMMAND = "${gn}/bin/gn";
62 SKIA_NINJA_COMMAND = "${ninja}/bin/ninja";
69 ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ xcbuild ];
71 nativeCheckInputs = [ neovim ];
76 rustPlatform.bindgenHook
77 ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
78 darwin.apple_sdk.frameworks.AppKit
82 libPath = lib.makeLibraryPath ([
89 ] ++ lib.optionals enableWayland [ wayland ]);
91 # library skia embeds the path to its sources
92 remove-references-to -t "$SKIA_SOURCE_DIR" \
95 wrapProgram $out/bin/neovide \
96 --prefix LD_LIBRARY_PATH : ${libPath}
99 postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
100 mkdir -p $out/Applications
101 cp -r extra/osx/Neovide.app $out/Applications
102 ln -s $out/bin $out/Applications/Neovide.app/Contents/MacOS
103 '' + lib.optionalString stdenv.hostPlatform.isLinux ''
104 for n in 16x16 32x32 48x48 256x256; do
105 install -m444 -D "assets/neovide-$n.png" \
106 "$out/share/icons/hicolor/$n/apps/neovide.png"
108 install -m444 -Dt $out/share/icons/hicolor/scalable/apps assets/neovide.svg
109 install -m444 -Dt $out/share/applications assets/neovide.desktop
112 disallowedReferences = [ SKIA_SOURCE_DIR ];
115 description = "This is a simple graphical user interface for Neovim";
116 mainProgram = "neovide";
117 homepage = "https://github.com/neovide/neovide";
118 changelog = "https://github.com/neovide/neovide/releases/tag/${version}";
119 license = with licenses; [ mit ];
120 maintainers = with maintainers; [ ck3d ];
121 platforms = platforms.linux ++ [ "aarch64-darwin" ];