nixpkgs-suyu/pkgs/games/minecraft-server/default.nix
Linus Heckemann 5d04dcf4f5 minecraft-server: 1.14 -> 1.14.3
Also removes older versions.
2019-07-12 07:40:37 +02:00

34 lines
950 B
Nix

{ stdenv, fetchurl, jre }:
stdenv.mkDerivation rec {
name = "minecraft-server-${version}";
version = "1.14.3";
src = fetchurl {
url = "https://launcher.mojang.com/v1/objects/d0d0fe2b1dc6ab4c65554cb734270872b72dadd6/server.jar";
sha256 = "0f0v0kqz2v5758551yji1vj6xf43lvbma30v3crz4h7cpzq5c8ll";
};
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;
maintainers = with stdenv.lib.maintainers; [ thoughtpolice tomberek costrouc];
};
}