packetry: add desktop entry and icon

This commit is contained in:
Karolis Stasaitis
2026-07-17 20:26:33 +02:00
parent b5d95a3fd3
commit 8e5b21a402
+21 -1
View File
@@ -1,12 +1,16 @@
{
fetchFromGitHub,
lib,
stdenv,
rustPlatform,
gtk4,
pkg-config,
pango,
wrapGAppsHook4,
versionCheckHook,
copyDesktopItems,
makeDesktopItem,
desktopToDarwinBundle,
}:
rustPlatform.buildRustPackage (finalAttrs: {
@@ -25,7 +29,9 @@ rustPlatform.buildRustPackage (finalAttrs: {
nativeBuildInputs = [
pkg-config
wrapGAppsHook4
];
copyDesktopItems
]
++ lib.optional stdenv.hostPlatform.isDarwin desktopToDarwinBundle;
buildInputs = [
gtk4
@@ -41,9 +47,23 @@ rustPlatform.buildRustPackage (finalAttrs: {
nativeInstallCheckInputs = [ versionCheckHook ];
doInstallCheck = true;
desktopItems = [
(makeDesktopItem {
name = "packetry";
desktopName = "Packetry";
comment = finalAttrs.meta.description;
exec = "packetry";
icon = "packetry";
categories = [ "Utility" ];
})
];
# packetry-cli is only necessary on windows https://github.com/greatscottgadgets/packetry/pull/154
postInstall = ''
rm $out/bin/packetry-cli
install -Dm644 appimage/dist/icon.png \
$out/share/icons/hicolor/512x512/apps/packetry.png
'';
meta = {