diff --git a/pkgs/games/satisfactory-dedicated-server/default.nix b/pkgs/games/satisfactory-dedicated-server/default.nix new file mode 100644 index 0000000..60115b2 --- /dev/null +++ b/pkgs/games/satisfactory-dedicated-server/default.nix @@ -0,0 +1,74 @@ +{ + 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" ]; + }; +} diff --git a/pkgs/games/satisfactory-dedicated-server/repl-result-out b/pkgs/games/satisfactory-dedicated-server/repl-result-out new file mode 120000 index 0000000..69c467e --- /dev/null +++ b/pkgs/games/satisfactory-dedicated-server/repl-result-out @@ -0,0 +1 @@ +/nix/store/j0r1vyd1hd43rjzaday70wny2lhjkc1p-satisfactory-dedicated-server-build-15636842 \ No newline at end of file