Skip to content

Commit

Permalink
tmodloader: add desktop item
Browse files Browse the repository at this point in the history
  • Loading branch information
NotAShelf committed Jan 19, 2024
1 parent 184c9a3 commit 3ca8535
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion pkgs/tmodloader/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,26 @@
lib,
stdenv,
fetchzip,
fetchurl,
makeDesktopItem,
steam-run,
dotnet,
runtimeDir ? "\\$HOME/.local/share/tmodloader",
...
}: let
pname = "tModLoader";
version = "2023.11.3.3";
description = "A mod to make and play Terraria mods.";

desktopItem = makeDesktopItem {
name = pname;
exec = pname;
desktopName = pname;
genericName = pname;
comment = description;
icon = pname;
categories = ["Game"];
};
in
stdenv.mkDerivation {
inherit pname version;
Expand Down Expand Up @@ -65,8 +78,19 @@ in
chmod +x $out/bin/${pname}
'';

postInstall = let
icon = fetchurl {
url = "https://raw.githubusercontent.com/tModLoader/tModLoader/1.4.4/solutions/documentation/tModLoaderIcon-Large.png";
hash = "sha256-FXwcoYJwQaG//L0MoJfRp9lHi1MShRssB1HQJy9ZyDg=";
};
in ''
mkdir -p "$out/share/icons/"
ln -s ${icon} "$out/share/icons/tModLoader.png"
cp -r "${desktopItem}/share/applications/" "$out/share/"
'';

meta = {
description = "A mod to make and play Terraria mods.";
inherit description;
homepage = "https://github.com/tModLoader/tModLoader";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [NotAShelf];
Expand Down

0 comments on commit 3ca8535

Please sign in to comment.