This commit is contained in:
Danilo Reyes 2024-12-21 12:52:46 -06:00
parent 2ce209820a
commit 871d8e2ef8

View File

@ -1,8 +1,11 @@
{ {
lib, lib,
stdenv, stdenv,
fetchurl,
fetchzip, fetchzip,
autoPatchelfHook, autoPatchelfHook,
copyDesktopItems,
makeDesktopItem,
nss, nss,
cairo, cairo,
xorg, xorg,
@ -31,7 +34,14 @@ stdenv.mkDerivation (finalAttrs: {
stripRoot = false; stripRoot = false;
}; };
nativeBuildInputs = [ autoPatchelfHook ]; icon = fetchurl {
url = "https://raw.githubusercontent.com/nextcloud/talk-desktop/refs/tags/v1.0.0/img/icons/icon.png";
hash = "sha256-DteSSuxIs0ukIJrvUO/3Mrh5F2GG5UAVvGRZUuZonkg=";
};
nativeBuildInputs = [
autoPatchelfHook
copyDesktopItems
];
buildInputs = buildInputs =
[ [
@ -61,6 +71,18 @@ stdenv.mkDerivation (finalAttrs: {
# Fixes `Zygote could not fork` # Fixes `Zygote could not fork`
runtimeDependencies = [ systemd ]; runtimeDependencies = [ systemd ];
desktopItems = [
(makeDesktopItem {
type = "Application";
name = "nextcloud-talk-desktop";
desktopName = "Nextcloud Talk";
comment = finalAttrs.meta.description;
exec = finalAttrs.meta.mainProgram;
icon = "nextcloud-talk-desktop";
categories = [ "Chat" ];
})
];
preInstall = '' preInstall = ''
mkdir -p $out/bin mkdir -p $out/bin
mkdir -p $out/opt mkdir -p $out/opt
@ -73,6 +95,8 @@ stdenv.mkDerivation (finalAttrs: {
# Link the application in $out/bin away from contents of `preInstall` # Link the application in $out/bin away from contents of `preInstall`
ln -s "$out/opt/Nextcloud Talk-linux-x64/Nextcloud Talk" $out/bin/nextcloud-talk-desktop ln -s "$out/opt/Nextcloud Talk-linux-x64/Nextcloud Talk" $out/bin/nextcloud-talk-desktop
mkdir -p $out/share/icons/hicolor/512x512/apps
cp $icon $out/share/icons/hicolor/512x512/apps/nextcloud-talk-desktop.png
runHook postInstall runHook postInstall
''; '';