8 , gobject-introspection
9 , jre # old or modded versions of the game may require Java 8 (https://aur.archlinux.org/packages/minecraft-launcher/#pinned-674960)
35 desktopItem = makeDesktopItem {
36 name = "minecraft-launcher";
37 exec = "minecraft-launcher";
38 icon = "minecraft-launcher";
39 comment = "Official launcher for Minecraft, a sandbox-building game";
40 desktopName = "Minecraft Launcher";
41 categories = [ "Game" ];
44 envLibPath = lib.makeLibraryPath [
48 alsa-lib # needed for narrator
49 flite # needed for narrator
50 libXxf86vm # needed only for versions <1.13
53 libPath = lib.makeLibraryPath ([
88 stdenv.mkDerivation rec {
89 pname = "minecraft-launcher";
94 url = "https://launcher.mojang.com/download/linux/x86_64/minecraft-launcher_${version}.tar.gz";
95 sha256 = "03q579hvxnsh7d00j6lmfh53rixdpf33xb5zlz7659pvb9j5w0cm";
99 url = "https://launcher.mojang.com/download/minecraft-launcher.svg";
100 sha256 = "0w8z21ml79kblv20wh5lz037g130pxkgs8ll9s3bi94zn2pbrhim";
103 nativeBuildInputs = [ makeWrapper wrapGAppsHook3 copyDesktopItems gobject-introspection ];
107 dontWrapGApps = true;
108 dontConfigure = true;
115 mv minecraft-launcher $out/opt
117 install -D $icon $out/share/icons/hicolor/symbolic/apps/minecraft-launcher.svg
124 --set-interpreter ${stdenv.cc.bintools.dynamicLinker} \
125 --set-rpath '$ORIGIN/'":${libPath}" \
126 $out/opt/minecraft-launcher/minecraft-launcher
128 --set-rpath '$ORIGIN/'":${libPath}" \
129 $out/opt/minecraft-launcher/libcef.so
131 --set-rpath '$ORIGIN/'":${libPath}" \
132 $out/opt/minecraft-launcher/liblauncher.so
136 # Do not create `GPUCache` in current directory
137 makeWrapper $out/opt/minecraft-launcher/minecraft-launcher $out/bin/minecraft-launcher \
138 --prefix LD_LIBRARY_PATH : ${envLibPath} \
139 --prefix PATH : ${lib.makeBinPath [ jre ]} \
140 --set JAVA_HOME ${lib.getBin jre} \
142 "''${gappsWrapperArgs[@]}"
145 desktopItems = [ desktopItem ];
148 description = "Official launcher for Minecraft, a sandbox-building game";
149 homepage = "https://minecraft.net";
150 maintainers = with maintainers; [ ryantm ];
151 sourceProvenance = with sourceTypes; [ binaryNativeCode ];
152 license = licenses.unfree;
153 platforms = [ "x86_64-linux" ];
154 # "minecraft-launcher will fail on NixOS for minecraft versions >1.19
155 # try prismlauncher or atlauncher instead"
160 tests = { inherit (nixosTests) minecraft; };
161 updateScript = ./update.sh;