-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathderivation.nix
36 lines (30 loc) · 954 Bytes
/
derivation.nix
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
{ lib, stdenvNoCC, fetchurl, nixosTests, jre_headless, version, url, sha256, channel ? "default" }:
stdenvNoCC.mkDerivation {
pname = "velocity";
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/velocity << EOF
#!/bin/sh
exec ${jre_headless}/bin/java \$@ -jar $out/lib/minecraft/server.jar nogui
EOF
chmod +x $out/bin/velocity
'';
dontUnpack = true;
passthru = {
tests = { inherit (nixosTests) minecraft-server; };
updateScript = ./update.py;
};
meta = with lib; {
description = "A modern, next-generation Minecraft server proxy";
homepage = "https://papermc.io";
license = licenses.gpl3Only;
platforms = platforms.unix;
maintainers = with maintainers; [ misterio77 ];
branch = channel;
mainProgram = "velocity";
};
}