nixpkgs/pkgs/applications/networking/instant-messengers/zulip/default.nix
Peder Bergebakken Sundt 985aa8174d treewide: unbreak appimageTools.wrapType2 builds
`appimageTools.wrapType2` no longer creates a binary `$out/bin/${name}` if `pname` and `version` is provided.
Derivations that have worked around this behavior with a `mv $out/bin/{${name},${pname}}` broke as a result.
This should fix most instances.

contex: #271071
2024-04-24 15:26:52 +02:00

42 lines
1.2 KiB
Nix

{ lib
, fetchurl
, appimageTools
}:
let
pname = "zulip";
version = "5.11.0";
src = fetchurl {
url = "https://github.com/zulip/zulip-desktop/releases/download/v${version}/Zulip-${version}-x86_64.AppImage";
hash = "sha256-snxeMgcLFMYDEsog7Xqeybw8GkU4kPqHMds1174bPd0=";
name="${pname}-${version}.AppImage";
};
appimageContents = appimageTools.extractType2 {
inherit pname version src;
};
in appimageTools.wrapType2 {
inherit pname version src;
runScript = "appimage-exec.sh -w ${appimageContents} -- \${NIXOS_OZONE_WL:+\${WAYLAND_DISPLAY:+--ozone-platform-hint=auto}}";
extraInstallCommands = ''
install -m 444 -D ${appimageContents}/zulip.desktop $out/share/applications/zulip.desktop
install -m 444 -D ${appimageContents}/usr/share/icons/hicolor/512x512/apps/zulip.png \
$out/share/icons/hicolor/512x512/apps/zulip.png
substituteInPlace $out/share/applications/zulip.desktop \
--replace 'Exec=AppRun' 'Exec=${pname}'
'';
meta = with lib; {
description = "Desktop client for Zulip Chat";
homepage = "https://zulip.com";
license = licenses.asl20;
maintainers = with maintainers; [ andersk jonafato ];
platforms = [ "x86_64-linux" ];
mainProgram = "zulip";
};
}