Add gilgamesh NixOS config and spigot-server package
Check / Lint Ansible Files (push) Successful in 2m18s

This commit is contained in:
2023-11-18 05:28:33 +01:00
parent 11049a04d8
commit 8e0c6266af
8 changed files with 252 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
spigot-1.20.1.jar
+11
View File
@@ -0,0 +1,11 @@
# Packages
## `spigot-server`
In order to build `spigot-server.nix` you'll need a copy of the Spigot JAR.
For licensing reasons I won't check it into Git.
Just drop `spigot-${version}.jar` into this folder and change the `version = ` line in `spigot-server.nix` accordingly.
## TODO
- Make some more stuff in `spigot-server.nix` configurable
+27
View File
@@ -0,0 +1,27 @@
{
makeWrapper,
stdenv,
# Runtime Dependencies
jre
}:
let
# Copied from some forum thread without much thought.
# Let's see if they work out.
javaFlags = "-Xmx5G -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:MaxGCPauseMillis=50 -XX:+DisableExplicitGC -XX:TargetSurvivorRatio=90 -XX:G1NewSizePercent=50 -XX:G1MaxNewSizePercent=80 -XX:InitiatingHeapOccupancyPercent=10 -XX:G1MixedGCLiveThresholdPercent=50";
in stdenv.mkDerivation rec {
pname = "spigot-server";
version = "1.20.1";
src = ./spigot-${version}.jar;
nativeBuildInputs = [ makeWrapper ];
buildCommand = ''
install -Dm644 $src $out/lib/spigot-${version}.jar
mkdir -p $out/bin
makeWrapper ${jre}/bin/java $out/bin/spigot-server \
--argv0 spigot-server \
--add-flags "${javaFlags}" \
--add-flags "-jar $out/lib/spigot-${version}.jar"
'';
}