Skip to content

Instantly share code, notes, and snippets.

@cyber-murmel
Last active May 11, 2023 08:01
Show Gist options
  • Save cyber-murmel/692ac72a807848ffb963ac047ef9ed57 to your computer and use it in GitHub Desktop.
Save cyber-murmel/692ac72a807848ffb963ac047ef9ed57 to your computer and use it in GitHub Desktop.
Dedicated Satisfactory 5 Server on NixOS
{config, pkgs, lib, ...}: {
users.users.satisfactory = {
home = "/var/lib/satisfactory";
createHome = true;
};
nixpkgs.config.allowUnfree = true;
systemd.services.satisfactory = {
wantedBy = [ "multi-user.target" ];
preStart = ''
${pkgs.steamcmd}/bin/steamcmd \
+login anonymous \
+force_install_dir /var/lib/satisfactory/SatisfactoryDedicatedServer \
+app_update 1690800 validate \
+quit
'';
script = ''
${pkgs.glibc}/lib/ld-linux-x86-64.so.2 /var/lib/satisfactory/SatisfactoryDedicatedServer/Engine/Binaries/Linux/UE4Server-Linux-Shipping FactoryGame
'';
serviceConfig = {
Nice = "-5";
Restart = "always";
User = "satisfactory";
WorkingDirectory = "/var/lib/satisfactory";
};
environment = {
LD_LIBRARY_PATH="SatisfactoryDedicatedServer/linux64:SatisfactoryDedicatedServer/Engine/Binaries/Linux:SatisfactoryDedicatedServer/Engine/Binaries/ThirdParty/PhysX3/Linux/x86_64-unknown-linux-gnu/";
};
};
}
@matejc
Copy link

matejc commented Jun 19, 2022

Hey, thanks for posting this. I have updated it a bit:

  • added the isSystemUser and add a group so that nixos rebuild does not complain on nixos-unstable
  • open default ports
  • add patchelf to set interpreter instead of running server with linker, this fixes the issue with server executable looking for files in wrong paths

https://github.com/matejc/helper_scripts/blob/master/nixes/satisfactory.nix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment