2020-04-24 23:36:52 +00:00
|
|
|
{ stdenv, fetchurl, jre_headless }:
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
pname = "minecraft-server";
|
2020-11-06 00:33:48 +00:00
|
|
|
version = "1.16.4";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2020-11-06 00:33:48 +00:00
|
|
|
url = "https://launcher.mojang.com/v1/objects/35139deedbd5182953cf1caa23835da59ca3d7cd/server.jar";
|
2020-06-02 18:00:15 +00:00
|
|
|
# sha1 because that comes from mojang via api
|
2020-11-06 00:33:48 +00:00
|
|
|
sha1 = "35139deedbd5182953cf1caa23835da59ca3d7cd";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
preferLocalBuild = true;
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin $out/lib/minecraft
|
|
|
|
cp -v $src $out/lib/minecraft/server.jar
|
|
|
|
|
|
|
|
cat > $out/bin/minecraft-server << EOF
|
|
|
|
#!/bin/sh
|
|
|
|
exec ${jre_headless}/bin/java \$@ -jar $out/lib/minecraft/server.jar nogui
|
|
|
|
EOF
|
|
|
|
|
|
|
|
chmod +x $out/bin/minecraft-server
|
|
|
|
'';
|
|
|
|
|
|
|
|
phases = "installPhase";
|
|
|
|
|
2020-06-02 18:00:15 +00:00
|
|
|
passthru.updateScript = ./update.sh;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Minecraft Server";
|
|
|
|
homepage = "https://minecraft.net";
|
|
|
|
license = licenses.unfreeRedistributable;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ thoughtpolice tomberek costrouc ];
|
|
|
|
};
|
|
|
|
}
|