Pin minecraft server to 1.18.1
This commit is contained in:
parent
3911b91b47
commit
7645a19dcf
38
pkgs/minecraft-server/1_18_1.nix
Normal file
38
pkgs/minecraft-server/1_18_1.nix
Normal file
@ -0,0 +1,38 @@
|
||||
{ lib, stdenv, fetchurl, nixosTests, jre_headless }:
|
||||
stdenv.mkDerivation {
|
||||
pname = "minecraft-server";
|
||||
version = "1.18.1";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://launcher.mojang.com/v1/objects/125e5adf40c659fd3bce3e66e67a16bb49ecc1b9/server.jar";
|
||||
# sha1 because that comes from mojang via api
|
||||
sha1 = "125e5adf40c659fd3bce3e66e67a16bb49ecc1b9";
|
||||
};
|
||||
|
||||
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.sh;
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "Minecraft Server";
|
||||
homepage = "https://minecraft.net";
|
||||
license = licenses.unfreeRedistributable;
|
||||
platforms = platforms.unix;
|
||||
maintainers = with maintainers; [ thoughtpolice tomberek costrouc ];
|
||||
};
|
||||
}
|
@ -12,7 +12,7 @@
|
||||
enable = true;
|
||||
eula = true;
|
||||
|
||||
package = pkgs.callPackage ../../pkgs/minecraft-server-fabric { inherit (pkgs.unstable) minecraft-server; };
|
||||
package = pkgs.callPackage ../../pkgs/minecraft-server-fabric { minecraft-server = (pkgs.callPackage ../../pkgs/minecraft-server/1_18_1.nix { }); };
|
||||
jvmOpts = "-Xms10G -Xmx10G -XX:+UnlockExperimentalVMOptions -XX:+UseZGC -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:+ParallelRefProcEnabled";
|
||||
|
||||
serverProperties = {
|
||||
|
Loading…
Reference in New Issue
Block a user