Nix packages for third-party projects that don't ship their own flakes
0

Configure Feed

Select the types of activity you want to include in your feed.

fix(zed-preview): set XKB path and avoid icon clash with zed-editor

Point XKB_CONFIG_ROOT at xkeyboard-config so the binary works on NixOS,
and rename icons/desktop Icon to zed-preview so nix profile can install
alongside zed-editor-fhs.

+16 -3
+16 -3
packages/zed-preview/default.nix
··· 9 9 libgcc, 10 10 vulkan-loader, 11 11 wayland, 12 + xkeyboard-config, 12 13 versionCheckHook, 13 14 }: 14 15 ··· 48 49 49 50 mkdir -p $out 50 51 cp -a bin lib libexec share $out/ 51 - # Coexist with nixpkgs zed-editor (zeditor) and a stable zed binary. 52 + # Coexist with nixpkgs zed-editor / zed-editor-fhs (binary + icons). 52 53 mv $out/bin/zed $out/bin/zed-preview 53 54 54 - # Point the desktop entry at our binary name (line-anchored; plain 55 + # Rename icons so share/icons/.../zed.png does not collide with zed-editor. 56 + find $out/share/icons -type f -name 'zed.png' | while read -r icon; do 57 + mv "$icon" "$(dirname "$icon")/zed-preview.png" 58 + done 59 + 60 + # Point the desktop entry at our binary + icon names (line-anchored; plain 55 61 # substitute would also rewrite TryExec when matching Exec=zed). 56 62 sed -i \ 57 63 -e 's/^TryExec=zed$/TryExec=zed-preview/' \ 58 64 -e 's/^Exec=zed/Exec=zed-preview/' \ 65 + -e 's/^Icon=zed$/Icon=zed-preview/' \ 59 66 $out/share/applications/dev.zed.Zed-Preview.desktop 60 67 61 68 runHook postInstall 62 69 ''; 63 70 64 71 postFixup = '' 72 + # xkbcommon defaults to /usr/share/X11/xkb, which does not exist on NixOS. 65 73 wrapProgram $out/bin/zed-preview \ 66 - --set ZED_UPDATE_EXPLANATION "Zed Preview has been installed using Nix. Auto-updates have thus been disabled." 74 + --set ZED_UPDATE_EXPLANATION "Zed Preview has been installed using Nix. Auto-updates have thus been disabled." \ 75 + --set XKB_CONFIG_ROOT "${xkeyboard-config}/share/X11/xkb" 76 + # CLI execs libexec/zed-editor; wrap it too so direct launches get the same env. 77 + wrapProgram $out/libexec/zed-editor \ 78 + --set ZED_UPDATE_EXPLANATION "Zed Preview has been installed using Nix. Auto-updates have thus been disabled." \ 79 + --set XKB_CONFIG_ROOT "${xkeyboard-config}/share/X11/xkb" 67 80 ''; 68 81 69 82 nativeInstallCheckInputs = [ versionCheckHook ];