2020-04-02 07:59:14 +02:00
|
|
|
{ stdenv, fetchurl, jre_headless }:
|
2019-08-13 23:52:01 +02:00
|
|
|
stdenv.mkDerivation {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "minecraft-server";
|
2020-01-28 10:00:45 +01:00
|
|
|
version = "1.15.2";
|
2014-03-29 10:48:08 +01:00
|
|
|
|
2019-06-27 10:50:47 +02:00
|
|
|
src = fetchurl {
|
2020-04-02 07:59:14 +02:00
|
|
|
url =
|
|
|
|
"https://launcher.mojang.com/v1/objects/bb2b6b1aefcd70dfd1892149ac3a215f6c636b07/server.jar";
|
2020-01-28 10:00:45 +01:00
|
|
|
sha256 = "12kynrpxgcdg8x12wcvwkxka0fxgm5siqg8qq0nnmv0443f8dkw0";
|
2019-06-27 10:50:47 +02:00
|
|
|
};
|
2018-08-21 01:34:03 +02:00
|
|
|
|
2019-06-27 10:50:47 +02:00
|
|
|
preferLocalBuild = true;
|
2018-08-21 01:34:03 +02:00
|
|
|
|
2019-06-27 10:50:47 +02:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin $out/lib/minecraft
|
|
|
|
cp -v $src $out/lib/minecraft/server.jar
|
2018-08-21 01:34:03 +02:00
|
|
|
|
2019-06-27 10:50:47 +02:00
|
|
|
cat > $out/bin/minecraft-server << EOF
|
|
|
|
#!/bin/sh
|
2020-04-02 07:59:14 +02:00
|
|
|
exec ${jre_headless}/bin/java \$@ -jar $out/lib/minecraft/server.jar nogui
|
2019-06-27 10:50:47 +02:00
|
|
|
EOF
|
2018-08-21 01:34:03 +02:00
|
|
|
|
2019-06-27 10:50:47 +02:00
|
|
|
chmod +x $out/bin/minecraft-server
|
|
|
|
'';
|
2019-04-26 14:01:23 +02:00
|
|
|
|
2019-06-27 10:50:47 +02:00
|
|
|
phases = "installPhase";
|
2014-03-29 10:48:08 +01:00
|
|
|
|
2020-04-02 07:59:14 +02:00
|
|
|
meta = with stdenv.lib; {
|
2019-06-27 10:50:47 +02:00
|
|
|
description = "Minecraft Server";
|
2020-04-02 07:59:14 +02:00
|
|
|
homepage = "https://minecraft.net";
|
|
|
|
license = licenses.unfreeRedistributable;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ thoughtpolice tomberek costrouc ];
|
2014-03-29 10:48:08 +01:00
|
|
|
};
|
|
|
|
}
|