9 (stdenvNoCC.mkDerivation {
10 pname = "revolt-desktop";
15 description = "Open source user-first chat platform";
16 homepage = "https://revolt.chat/";
17 changelog = "https://github.com/revoltchat/desktop/releases/tag/v${version}";
18 license = licenses.agpl3Only;
19 maintainers = with maintainers; [
23 platforms = platforms.linux ++ platforms.darwin;
24 sourceProvenance = with sourceTypes; [ binaryNativeCode ];
25 mainProgram = "revolt-desktop";
27 nativeBuildInputs = [ makeWrapper ];
32 inherit (prev) pname version;
34 if stdenvNoCC.hostPlatform.isLinux then
37 url = "https://github.com/revoltchat/desktop/releases/download/v${version}/Revolt-linux.AppImage";
38 hash = "sha256-Wsm6ef2Reenq3/aKGaP2yzlOuLKaxKtRHCLLMxvWUUY=";
41 appimageContents = appimageTools.extractType2 { inherit (final) src pname version; };
48 mkdir -p $out/bin $out/share/{applications,revolt-desktop}
50 cp -a ${final.appimageContents}/{locales,resources} $out/share/revolt-desktop
51 cp -a ${final.appimageContents}/revolt-desktop.desktop $out/share/applications/revolt-desktop.desktop
52 cp -a ${final.appimageContents}/usr/share/icons $out/share/icons
54 substituteInPlace $out/share/applications/revolt-desktop.desktop \
55 --replace 'Exec=AppRun' 'Exec=revolt-desktop'
61 makeWrapper ${electron}/bin/electron $out/bin/revolt-desktop \
62 --add-flags $out/share/revolt-desktop/resources/app.asar \
63 --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform=wayland --enable-features=WaylandWindowDecorations}}"
67 assert stdenvNoCC.hostPlatform.isDarwin;
70 url = "https://github.com/revoltchat/desktop/releases/download/v${version}/Revolt-${version}-mac.zip";
71 hash = "sha256-XxmKcIfJtHfi6SahrRHMeTAuyVqiN9Yhayjis10vD2w=";
78 mkdir -p "$out/Applications/" "$out/bin/"
79 mv Revolt.app "$out/Applications/"
80 makeWrapper "$out/Applications/Revolt.app/Contents/MacOS/Revolt" "$out/bin/revolt-desktop"