nixpkgs/pkgs/applications/networking/instant-messengers/session-desktop/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

66 lines
1.6 KiB
Nix

{ lib
, makeDesktopItem
, copyDesktopItems
, stdenvNoCC
, fetchurl
, appimageTools
, makeWrapper
}:
let
version = "1.11.5";
pname = "session-desktop";
src = fetchurl {
url = "https://github.com/oxen-io/session-desktop/releases/download/v${version}/session-desktop-linux-x86_64-${version}.AppImage";
hash = "sha256-Sma8e3A1tf7JmnlS4mbtlF98Ow5aRPqw+aUoitzCjmk=";
};
appimage = appimageTools.wrapType2 {
inherit version pname src;
};
appimage-contents = appimageTools.extractType2 {
inherit version pname src;
};
in
stdenvNoCC.mkDerivation {
inherit version pname;
src = appimage;
nativeBuildInputs = [ copyDesktopItems makeWrapper ];
desktopItems = [
(makeDesktopItem {
name = "Session";
desktopName = "Session";
comment = "Onion routing based messenger";
exec = "${appimage}/bin/session-desktop-${version}";
icon = "${appimage-contents}/session-desktop.png";
terminal = false;
type = "Application";
categories = [ "Network" ];
})
];
installPhase = ''
runHook preInstall
mkdir -p $out/
cp -r bin $out/bin
wrapProgram $out/bin/session-desktop \
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}"
runHook postInstall
'';
meta = with lib; {
description = "Onion routing based messenger";
mainProgram = "session-desktop";
homepage = "https://getsession.org/";
license = licenses.gpl3Only;
maintainers = with maintainers; [ alexnortung ];
platforms = [ "x86_64-linux" ];
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
};
}