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