nixpkgs/pkgs/by-name/se/session-desktop/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

69 lines
1.6 KiB
Nix

{
lib,
makeDesktopItem,
copyDesktopItems,
stdenvNoCC,
fetchurl,
appimageTools,
makeWrapper,
}:
let
version = "1.13.2";
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-71v6CvlKa4m1LPG07eGhPqkpK60X4VrafCQyfjQR3rs=";
};
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 = "session-desktop";
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
cyewashish
];
platforms = [ "x86_64-linux" ];
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
};
}