2014-03-29 10:48:08 +01:00
|
|
|
{ stdenv, fetchurl, jre }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "minecraft-server-${version}";
|
2017-01-12 02:18:38 +01:00
|
|
|
version = "1.11.2";
|
2014-03-29 10:48:08 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://s3.amazonaws.com/Minecraft.Download/versions/${version}/minecraft_server.${version}.jar";
|
2017-01-12 02:18:38 +01:00
|
|
|
sha256 = "12nqcj6skwjfcywm3ah4jb1qn4r558ng9cchdc3hbz99nhv7vi6y";
|
2014-03-29 10:48:08 +01:00
|
|
|
};
|
|
|
|
|
2016-06-25 12:11:08 +02:00
|
|
|
preferLocalBuild = true;
|
|
|
|
|
2014-03-29 10:48:08 +01:00
|
|
|
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}/bin/java \$@ -jar $out/lib/minecraft/server.jar nogui
|
|
|
|
EOF
|
|
|
|
|
|
|
|
chmod +x $out/bin/minecraft-server
|
|
|
|
'';
|
|
|
|
|
|
|
|
phases = "installPhase";
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Minecraft Server";
|
|
|
|
homepage = "https://minecraft.net";
|
|
|
|
license = stdenv.lib.licenses.unfreeRedistributable;
|
|
|
|
platforms = stdenv.lib.platforms.unix;
|
2014-12-31 06:51:15 +01:00
|
|
|
maintainers = [ stdenv.lib.maintainers.thoughtpolice stdenv.lib.maintainers.tomberek ];
|
2014-03-29 10:48:08 +01:00
|
|
|
};
|
|
|
|
}
|