3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/games/minecraft-server/default.nix
2016-03-04 00:17:13 -05:00

34 lines
937 B
Nix

{ stdenv, fetchurl, jre }:
stdenv.mkDerivation rec {
name = "minecraft-server-${version}";
version = "1.9";
src = fetchurl {
url = "http://s3.amazonaws.com/Minecraft.Download/versions/${version}/minecraft_server.${version}.jar";
sha256 = "0z9sgnal55ari1dj4vac975wi9gk5hq30nhkw8155xbi1ksrg9rq";
};
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;
maintainers = [ stdenv.lib.maintainers.thoughtpolice stdenv.lib.maintainers.tomberek ];
};
}