80 lines
1.8 KiB
Nix
80 lines
1.8 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
fetchFromSteam,
|
|
|
|
SDL2
|
|
}:
|
|
let
|
|
appId = "1690800";
|
|
buildId = "19876517";
|
|
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 = "7620210706575413121";
|
|
};
|
|
hash = "sha256-jQbtHSBFCDcdycrDjIJBY4DGV7EgITvwv3k3+htZ7io=";
|
|
};
|
|
in stdenv.mkDerivation {
|
|
pname = "satisfactory-dedicated-server";
|
|
version = "build-${buildId}";
|
|
|
|
src = server_dist;
|
|
|
|
dontConfigure = true;
|
|
dontBuild = true;
|
|
|
|
installPhase = ''
|
|
mkdir -p $out/opt
|
|
cp -r . $out/opt/.
|
|
cp -r ${steamworks_sdk}/linux64 $out/opt
|
|
|
|
mkdir -p $out/opt/FactoryGame/Intermediate
|
|
mkdir -p $out/opt/FactoryGame/Saved
|
|
mkdir -p $out/opt/FactoryGame/Certificates
|
|
|
|
mkdir -p $out/opt/Engine/Saved
|
|
|
|
rm $out/opt/FactoryServer.sh
|
|
'';
|
|
|
|
dontStrip = true;
|
|
dontPatchELF = true;
|
|
dontPatchShebangs = true;
|
|
dontPruneLibtoolFiles = true;
|
|
|
|
preFixup = ''
|
|
echo patching binaries
|
|
|
|
chmod +x $out/opt/Engine/Binaries/Linux/FactoryServer-Linux-Shipping
|
|
|
|
patchelf \
|
|
--add-needed ${SDL2}/lib/libSDL2-2.0.so.0 \
|
|
$out/opt/linux64/steamclient.so
|
|
|
|
patchelf \
|
|
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
|
--add-needed $out/opt/linux64/steamclient.so \
|
|
$out/opt/Engine/Binaries/Linux/FactoryServer-Linux-Shipping
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Satisfactory Dedicated Server";
|
|
homepage = "https://www.satisfactorygame.com/";
|
|
license = licenses.unfree;
|
|
platforms = [ "x86_64-linux" ];
|
|
sourceProvenance = [ sourceTypes.binaryNativeCode ];
|
|
};
|
|
}
|