2021-12-10 12:45:19 +01:00
|
|
|
{ lib, stdenv, fetchurl, nixosTests, jre_headless, version, url, sha1 }:
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
pname = "minecraft-server";
|
|
|
|
inherit version;
|
|
|
|
|
|
|
|
src = fetchurl { inherit url sha1; };
|
|
|
|
|
|
|
|
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_headless}/bin/java \$@ -jar $out/lib/minecraft/server.jar nogui
|
|
|
|
EOF
|
|
|
|
|
|
|
|
chmod +x $out/bin/minecraft-server
|
|
|
|
'';
|
|
|
|
|
|
|
|
dontUnpack = true;
|
|
|
|
|
|
|
|
passthru = {
|
|
|
|
tests = { inherit (nixosTests) minecraft-server; };
|
|
|
|
updateScript = ./update.py;
|
|
|
|
};
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Minecraft Server";
|
|
|
|
homepage = "https://minecraft.net";
|
2022-06-02 15:38:41 +02:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryBytecode ];
|
2021-12-10 12:45:19 +01:00
|
|
|
license = licenses.unfreeRedistributable;
|
|
|
|
platforms = platforms.unix;
|
2023-01-15 05:14:19 +01:00
|
|
|
maintainers = with maintainers; [ thoughtpolice tomberek costrouc joelkoen ];
|
2021-12-10 12:45:19 +01:00
|
|
|
};
|
|
|
|
}
|