{ pkgs, ... }: let version = "159.7"; src = pkgs.fetchurl { url = "https://github.com/Anuken/Mindustry/releases/download/v${version}/Mindustry.jar"; hash = "sha256:67b2e5c7575e564b184ed11e139c01ddc140afd28b238715e7d42e81612fdfbe"; }; icon = pkgs.fetchurl { url = "https://upload.wikimedia.org/wikipedia/commons/4/4a/Mindustry_Icon.png"; hash = "sha256:1s597ywczx5c92dnqkij6drzkpn92613fqqsc1imw7dbhf07xjml"; }; mindustry = pkgs.writeShellScriptBin "mindustry" '' export LD_LIBRARY_PATH=${pkgs.libglvnd}/lib:$LD_LIBRARY_PATH exec ${pkgs.jdk17}/bin/java -jar ${src} "$@" ''; in { home.packages = [ mindustry ]; home.file.".local/share/icons/hicolor/scalable/apps/mindustry.png".source = icon; xdg.desktopEntries.mindustry.comment = "Sandbox tower defense with factory automation"; xdg.desktopEntries.mindustry.name = "Mindustry"; xdg.desktopEntries.mindustry.genericName = "Tower defense game"; xdg.desktopEntries.mindustry.exec = "mindustry"; xdg.desktopEntries.mindustry.icon = "mindustry"; }