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

75 lines
1.7 KiB
Nix

{
lib,
stdenv,
fetchFromSteam,
SDL2
}:
let
appId = "1690800";
buildId = "15636842";
steamworks_sdk = fetchFromSteam {
name = "steamworks-sdk";
inherit appId;
depot = {
depotId = "1006";
manifestId = "7138471031118904166";
};
hash = "sha256-OtPI1kAx6+9G09IEr2kYchyvxlPl3rzx/ai/xEVG4oM=";
};
server_dist = fetchFromSteam {
name = "satisfactory-dedicated-server";
inherit appId;
depot = {
depotId = "1690802";
manifestId = "1910179703516567959";
};
hash = "sha256-TxPegZFAwiAzuHgw9xLGr5sAP7KAVMMfPFYL7TRX1O0=";
};
in stdenv.mkDerivation {
pname = "satisfactory-dedicated-server";
version = "build-${buildId}";
src = server_dist;
buildInputs = [ steamworks_sdk ];
propagatedBuildInputs = [ SDL2 ];
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
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" ];
};
}