nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ stdenv, lib, file, fetchurl, autoPatchelfHook, unzip }:
2
3stdenv.mkDerivation rec {
4 pname = "terraria-server";
5 version = "1.4.4.9";
6 urlVersion = lib.replaceStrings [ "." ] [ "" ] version;
7
8 src = fetchurl {
9 url = "https://terraria.org/api/download/pc-dedicated-server/terraria-server-${urlVersion}.zip";
10 sha256 = "sha256-Mk+5s9OlkyTLXZYVT0+8Qcjy2Sb5uy2hcC8CML0biNY=";
11 };
12
13 buildInputs = [ file stdenv.cc.cc.libgcc ];
14 nativeBuildInputs = [ autoPatchelfHook unzip ];
15
16 installPhase = ''
17 runHook preInstall
18
19 mkdir -p $out/bin
20 cp -r Linux $out/
21 chmod +x "$out/Linux/TerrariaServer.bin.x86_64"
22 ln -s "$out/Linux/TerrariaServer.bin.x86_64" $out/bin/TerrariaServer
23
24 runHook postInstall
25 '';
26
27 meta = with lib; {
28 homepage = "https://terraria.org";
29 description = "Dedicated server for Terraria, a 2D action-adventure sandbox";
30 platforms = [ "x86_64-linux" ];
31 license = licenses.unfree;
32 maintainers = with maintainers; [ ncfavier ];
33 };
34}