1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-05 20:12:52 +00:00
nixpkgs/pkgs/games/minecraft-server/default.nix

35 lines
940 B
Nix
Raw Normal View History

{ stdenv, fetchurl, jre }:
stdenv.mkDerivation rec {
pname = "minecraft-server";
2019-07-20 18:46:47 +01:00
version = "1.14.4";
src = fetchurl {
2019-07-20 18:46:47 +01:00
url = "https://launcher.mojang.com/v1/objects/3dc3d84a581f14691199cf6831b71ed1296a9fdf/server.jar";
sha256 = "0aapiwgx9bmnwgmrra9459qfl9bw8q50sja4lhhr64kf7amyvkay";
};
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
'';
2019-04-26 13:01:23 +01:00
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];
};
}