From a0f37f589e824173eb737f28af3c0cff65c4eef0 Mon Sep 17 00:00:00 2001 From: seth Date: Thu, 10 Aug 2023 15:53:48 -0400 Subject: pkgs/modrinth-app: cleanup desktop file + complete rename --- pkgs/modrinth-app/default.nix | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/pkgs/modrinth-app/default.nix b/pkgs/modrinth-app/default.nix index 013b98b..1cf9003 100644 --- a/pkgs/modrinth-app/default.nix +++ b/pkgs/modrinth-app/default.nix @@ -6,6 +6,7 @@ rustPlatform, buildGoModule, makeDesktopItem, + copyDesktopItems, CoreServices, Security, WebKit, @@ -88,6 +89,7 @@ rustPlatform.buildRustPackage rec { nativeBuildInputs = [ pkg-config pnpm + copyDesktopItems wrapGAppsHook ]; @@ -121,19 +123,26 @@ rustPlatform.buildRustPackage rec { popd ''; - desktopItem = makeDesktopItem { - name = "com.modrinth.theseus"; - exec = "theseus_gui"; - icon = "com.modrinth.theseus"; - desktopName = "Modrinth App"; - genericName = meta.description; - }; + desktopItems = [ + (makeDesktopItem rec { + name = "com.modrinth.ModrinthApp"; + exec = "theseus_gui"; + icon = "com.modrinth.ModrinthApp"; + desktopName = "Modrinth App"; + genericName = desktopName; + comment = meta.description; + terminal = false; + startupNotify = true; + startupWMClass = "ModrinthApp"; + categories = ["Game" "ActionGame" "AdventureGame" "Simulation"]; + keywords = ["game" "minecraft" "mc"]; + }) + ]; postInstall = lib.optionalString stdenv.isLinux '' - mkdir -p $out/share/icons/hicolor/256x256/apps - mkdir -p $out/share/applications - cp theseus_gui/src-tauri/icons/Square284x284Logo.png $out/share/icons/hicolor/256x256/apps/com.modrinth.theseus.png - cp ${desktopItem}/share/applications/*.desktop $out/share/applications + mkdir -p $out/share/{applications,icons/hicolor/256x256/apps} + copyDesktopItems + cp theseus_gui/src-tauri/icons/Square284x284Logo.png $out/share/icons/hicolor/256x256/apps/com.modrinth.ModrinthApp.png ''; meta = with lib; { @@ -143,7 +152,7 @@ rustPlatform.buildRustPackage rec { ''; homepage = "https://modrinth.com"; license = licenses.gpl3Plus; - maintainers = [maintainers.getchoo]; + maintainers = with maintainers; [maintainers.getchoo]; platforms = with platforms; linux ++ darwin; }; } -- cgit v1.2.3