dragnpkgs/pkgs/games/satisfactory-dedicated-server/default.nix

76 lines
1.6 KiB
Nix

{
lib,
stdenv,
fetchFromSteam,
SDL2
}:
let
appId = "1690800";
buildId = "19234106";
steamworks_sdk = fetchFromSteam {
name = "steamworks-sdk";
inherit appId;
depot = {
depotId = "1006";
manifestId = "5587033981095108078";
};
hash = "sha256-CjrVpq5ztL6wTWIa63a/4xHM35DzgDR/O6qVf1YV5xw=";
};
server_dist = fetchFromSteam {
name = "satisfactory-dedicated-server";
inherit appId;
depot = {
depotId = "1690802";
manifestId = "5693629351763493998";
};
hash = "sha256-0svLwO4JYKIPwoNCRfT9+pocZ0n1QpSEqP41DdUhEac=";
};
in stdenv.mkDerivation {
pname = "satisfactory-dedicated-server";
version = "build-${buildId}";
src = server_dist;
dontConfigure = true;
dontBuild = true;
installPhase = ''
mkdir -p $out
cp -r . $out/.
cp -r ${steamworks_sdk}/linux64 $out
mkdir -p $out/FactoryGame/Intermediate
mkdir -p $out/FactoryGame/Saved
mkdir -p $out/FactoryGame/Certificates
rm $out/FactoryServer.sh
'';
dontStrip = true;
dontPatchELF = true;
dontPatchShebangs = true;
dontPruneLibtoolFiles = true;
preFixup = ''
echo patching binaries
chmod +x $out/Engine/Binaries/Linux/FactoryServer-Linux-Shipping
patchelf \
--add-needed ${SDL2}/lib/libSDL2-2.0.so.0 \
$out/linux64/steamclient.so
patchelf \
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
--add-needed $out/linux64/steamclient.so \
$out/Engine/Binaries/Linux/FactoryServer-Linux-Shipping
'';
meta = with lib; {
description = "Satisfactory Dedicated Server";
license = licenses.unfree;
platforms = [ "x86_64-linux" ];
};
}