3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/games/minecraft-server/default.nix

36 lines
968 B
Nix
Raw Normal View History

{ stdenv, fetchurl, jre }:
stdenv.mkDerivation rec {
name = "minecraft-server-${version}";
2016-06-25 12:32:32 +01:00
version = "1.10.2";
src = fetchurl {
url = "http://s3.amazonaws.com/Minecraft.Download/versions/${version}/minecraft_server.${version}.jar";
2016-06-25 12:32:32 +01:00
sha256 = "08bss3laa265aavdgivzsv7asd5s2sdqnlqr767j3yf54y14cpqr";
};
2016-06-25 11:11:08 +01: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}/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 05:51:15 +00:00
maintainers = [ stdenv.lib.maintainers.thoughtpolice stdenv.lib.maintainers.tomberek ];
};
}