11 arch = if stdenv.hostPlatform.is64bit then "amd64" else "x86";
13 stdenv.mkDerivation rec {
14 pname = "teamspeak-server";
18 url = "https://files.teamspeak-services.com/releases/server/${version}/teamspeak3-server_linux_${arch}-${version}.tar.bz2";
20 if stdenv.hostPlatform.is64bit then
21 "sha256-d1pXMamAmAHkyPkGbNm8ViobNoVTE5wSSfKgdA1QBB4="
23 "sha256-aMEDOnvBeKfzG8lDFhU8I5DYgG53IsCDBMV2MUyJi2g=";
31 nativeBuildInputs = [ autoPatchelfHook ];
37 mkdir -p $out/lib/teamspeak
38 mv * $out/lib/teamspeak/
40 # Make symlinks to the binaries from bin.
42 ln -s $out/lib/teamspeak/ts3server $out/bin/ts3server
43 ln -s $out/lib/teamspeak/tsdns/tsdnsserver $out/bin/tsdnsserver
48 passthru.updateScript = writeScript "update-teampeak-server" ''
49 #!/usr/bin/env nix-shell
50 #!nix-shell -i bash -p common-updater-scripts curl gnugrep gnused jq pup
55 curl https://www.teamspeak.com/en/downloads/ \
56 | pup "#server .linux .version json{}" \
60 versionOld=$(nix-instantiate --eval --strict -A "teamspeak_server.version")
62 nixFile=pkgs/applications/networking/instant-messengers/teamspeak/server.nix
64 update-source-version teamspeak_server "$version" --system=i686-linux
66 sed -i -e "s/version = \"$version\";/version = $versionOld;/" "$nixFile"
68 update-source-version teamspeak_server "$version" --system=x86_64-linux
72 description = "TeamSpeak voice communication server";
73 homepage = "https://teamspeak.com/";
74 sourceProvenance = with sourceTypes; [ binaryNativeCode ];
75 # See distribution-permit.txt for a confirmation that nixpkgs is allowed to distribute TeamSpeak.
76 license = licenses.unfreeRedistributable;
77 platforms = platforms.linux;
78 maintainers = with maintainers; [