-
Notifications
You must be signed in to change notification settings - Fork 78
Expand file tree
/
Copy pathderivation.nix
More file actions
49 lines (41 loc) · 1.04 KB
/
derivation.nix
File metadata and controls
49 lines (41 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{
lib,
stdenvNoCC,
fetchurl,
nixosTests,
jre,
version,
url,
sha256,
minecraft-server,
}:
stdenvNoCC.mkDerivation {
pname = "paper";
inherit version;
src = fetchurl { inherit url sha256; };
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
'';
dontUnpack = true;
passthru = {
updateScript = ./update.py;
# If you plan on running paper without internet, be sure to link this jar
# to `cache/mojang_{version}.jar`.
vanillaJar = "${minecraft-server}/lib/minecraft/server.jar";
};
meta = with lib; {
description = "A high performance spigot fork";
homepage = "https://papermc.io";
license = licenses.gpl3Only;
platforms = platforms.unix;
maintainers = with maintainers; [ misterio77 ];
mainProgram = "minecraft-server";
};
}