2014-03-29 09:48:08 +00:00
|
|
|
{ stdenv, fetchurl, jre }:
|
2019-06-27 08:50:47 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "minecraft-server-${version}";
|
|
|
|
version = "1.14.3";
|
2014-03-29 09:48:08 +00:00
|
|
|
|
2019-06-27 08:50:47 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://launcher.mojang.com/v1/objects/d0d0fe2b1dc6ab4c65554cb734270872b72dadd6/server.jar";
|
|
|
|
sha256 = "0f0v0kqz2v5758551yji1vj6xf43lvbma30v3crz4h7cpzq5c8ll";
|
|
|
|
};
|
2018-08-20 23:34:03 +00:00
|
|
|
|
2019-06-27 08:50:47 +00:00
|
|
|
preferLocalBuild = true;
|
2018-08-20 23:34:03 +00:00
|
|
|
|
2019-06-27 08:50:47 +00:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin $out/lib/minecraft
|
|
|
|
cp -v $src $out/lib/minecraft/server.jar
|
2018-08-20 23:34:03 +00:00
|
|
|
|
2019-06-27 08:50:47 +00:00
|
|
|
cat > $out/bin/minecraft-server << EOF
|
|
|
|
#!/bin/sh
|
|
|
|
exec ${jre}/bin/java \$@ -jar $out/lib/minecraft/server.jar nogui
|
|
|
|
EOF
|
2018-08-20 23:34:03 +00:00
|
|
|
|
2019-06-27 08:50:47 +00:00
|
|
|
chmod +x $out/bin/minecraft-server
|
|
|
|
'';
|
2019-04-26 12:01:23 +00:00
|
|
|
|
2019-06-27 08:50:47 +00:00
|
|
|
phases = "installPhase";
|
2014-03-29 09:48:08 +00:00
|
|
|
|
2019-06-27 08:50:47 +00: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
|
|
|
};
|
|
|
|
}
|