From e1a897b4f405920ddcc29974263390f26ab28282 Mon Sep 17 00:00:00 2001 From: claymorwan Date: Sun, 21 Dec 2025 11:38:11 +0000 Subject: [PATCH] sm64coopdx: desktop entry --- pkgs/by-name/sm/sm64coopdx/package.nix | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/sm/sm64coopdx/package.nix b/pkgs/by-name/sm/sm64coopdx/package.nix index f360d9b6da5b..e8d7f7300b76 100644 --- a/pkgs/by-name/sm/sm64coopdx/package.nix +++ b/pkgs/by-name/sm/sm64coopdx/package.nix @@ -3,6 +3,9 @@ lib, makeWrapper, writeTextFile, + copyDesktopItems, + makeDesktopItem, + imagemagick, curl, hexdump, @@ -48,7 +51,11 @@ stdenv.mkDerivation (finalAttrs: { patches = [ ./no-update-check.patch ]; - nativeBuildInputs = [ makeWrapper ]; + nativeBuildInputs = [ + makeWrapper + copyDesktopItems + imagemagick + ]; buildInputs = [ curl @@ -60,6 +67,17 @@ stdenv.mkDerivation (finalAttrs: { libGL ]; + icon = "${finalAttrs.src}/res/icon.ico"; + desktopItems = [ + (makeDesktopItem { + name = finalAttrs.pname; + desktopName = "Super Mario 64 Coop Deluxe"; + exec = "sm64coopdx"; + icon = finalAttrs.pname; + categories = [ "Game" ]; + }) + ]; + enableParallelBuilding = true; makeFlags = [ @@ -92,6 +110,12 @@ stdenv.mkDerivation (finalAttrs: { cp $built/libdiscord_game_sdk* $share ''} + magick ${finalAttrs.icon} icon.png + for size in 16 24 32 48 64 128 256 512; do + mkdir -p $out/share/icons/hicolor/"$size"x"$size"/apps + magick icon-0.png -resize "$size"x"$size" $out/share/icons/hicolor/"$size"x"$size"/apps/${finalAttrs.pname}.png + done + # coopdx always tries to load resources from the binary's directory, with no obvious way to change. Thus this small wrapper script to always run from the /share directory that has all the resources mkdir -p $out/bin makeWrapper $share/sm64coopdx $out/bin/sm64coopdx \