1 { lib, stdenvNoCC, fetchurl, makeBinaryWrapper, jre, version, hash, udev }:
3 stdenvNoCC.mkDerivation (finalAttrs: {
9 version-split = lib.strings.splitString "-" finalAttrs.version;
10 mcVersion = builtins.elemAt version-split 0;
11 buildNum = builtins.elemAt version-split 1;
14 url = "https://papermc.io/api/v2/projects/paper/versions/${mcVersion}/builds/${buildNum}/downloads/paper-${mcVersion}-${buildNum}.jar";
15 inherit (finalAttrs) hash;
21 install -D $src $out/share/papermc/papermc.jar
23 makeWrapper ${lib.getExe jre} "$out/bin/minecraft-server" \
24 --append-flags "-jar $out/share/papermc/papermc.jar nogui" \
25 ${lib.optionalString stdenvNoCC.hostPlatform.isLinux "--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ udev ]}"}
35 preferLocalBuild = true;
36 allowSubstitutes = false;
39 updateScript = ./update.py;
43 description = "High-performance Minecraft Server";
44 homepage = "https://papermc.io/";
45 sourceProvenance = with lib.sourceTypes; [ binaryBytecode ];
46 license = lib.licenses.gpl3Only;
47 platforms = lib.platforms.unix;
48 maintainers = with lib.maintainers; [ aaronjanse neonfuz MayNiklas ];
49 mainProgram = "minecraft-server";