Personal Nix setup
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Extract Engine.ini

+258 -261
+1 -1
modules/games/default.nix
··· 49 49 }; 50 50 51 51 imports = [ 52 - ./palworld.nix 52 + ./palworld 53 53 ]; 54 54 }
-260
modules/games/palworld.nix
··· 1 - { lib, config, pkgs, ... } @ args: 2 - 3 - with lib; 4 - let 5 - isEnabled = config.modules.games.enable && config.modules.games.palworld.enable; 6 - baseCfg = config.modules.games; 7 - cfg = config.modules.games.palworld; 8 - 9 - name = "palworld-server"; 10 - scripts = (import ./lib/scripts.nix) args; 11 - 12 - generateSettings = name: value: let 13 - optionSettings = 14 - mapAttrsToList 15 - (optName: optVal: let 16 - optType = builtins.typeOf optVal; 17 - encodedVal = 18 - if optType == "string" 19 - then "\"${optVal}\"" 20 - else if optType == "bool" 21 - then 22 - if optVal 23 - then "True" 24 - else "False" 25 - else toString optVal; 26 - in "${optName}=${encodedVal}") 27 - value; 28 - in 29 - builtins.toFile name '' 30 - [/Script/Pal.PalGameWorldSettings] 31 - OptionSettings=(${concatStringsSep "," optionSettings}) 32 - ''; 33 - 34 - baseSettings = { 35 - ServerName = "Unnamed Server"; 36 - AllowConnectPlatform = "Steam"; 37 - CoopPlayerMaxNum = cfg.maxPlayers; 38 - bIsUseBackupSaveData = true; 39 - RCONEnabled = false; 40 - RESTAPIEnabled = false; 41 - }; 42 - 43 - engineSettings = '' 44 - [Core.System] 45 - Paths=../../../Engine/Content 46 - Paths=%GAMEDIR%Content 47 - Paths=../../../Engine/Plugins/2D/Paper2D/Content 48 - Paths=../../../Engine/Plugins/Animation/ControlRigSpline/Content 49 - Paths=../../../Engine/Plugins/Animation/ControlRig/Content 50 - Paths=../../../Engine/Plugins/Animation/IKRig/Content 51 - Paths=../../../Engine/Plugins/Animation/MotionWarping/Content 52 - Paths=../../../Engine/Plugins/Bridge/Content 53 - Paths=../../../Engine/Plugins/Compositing/Composure/Content 54 - Paths=../../../Engine/Plugins/Compositing/OpenColorIO/Content 55 - Paths=../../../Engine/Plugins/Developer/AnimationSharing/Content 56 - Paths=../../../Engine/Plugins/Developer/Concert/ConcertSync/ConcertSyncClient/Content 57 - Paths=../../../Engine/Plugins/Editor/BlueprintHeaderView/Content 58 - Paths=../../../Engine/Plugins/Editor/GeometryMode/Content 59 - Paths=../../../Engine/Plugins/Editor/ModelingToolsEditorMode/Content 60 - Paths=../../../Engine/Plugins/Editor/ObjectMixer/LightMixer/Content 61 - Paths=../../../Engine/Plugins/Editor/ObjectMixer/ObjectMixer/Content 62 - Paths=../../../Engine/Plugins/Editor/SpeedTreeImporter/Content 63 - Paths=../../../Engine/Plugins/Enterprise/DatasmithContent/Content 64 - Paths=../../../Engine/Plugins/Enterprise/GLTFExporter/Content 65 - Paths=../../../Engine/Plugins/Experimental/ChaosCaching/Content 66 - Paths=../../../Engine/Plugins/Experimental/ChaosClothEditor/Content 67 - Paths=../../../Engine/Plugins/Experimental/ChaosNiagara/Content 68 - Paths=../../../Engine/Plugins/Experimental/ChaosSolverPlugin/Content 69 - Paths=../../../Engine/Plugins/Experimental/CommonUI/Content 70 - Paths=../../../Engine/Plugins/Experimental/Dataflow/Content 71 - Paths=../../../Engine/Plugins/Experimental/FullBodyIK/Content 72 - Paths=../../../Engine/Plugins/Experimental/GeometryCollectionPlugin/Content 73 - Paths=../../../Engine/Plugins/Experimental/GeometryFlow/Content 74 - Paths=../../../Engine/Plugins/Experimental/ImpostorBaker/Content 75 - Paths=../../../Engine/Plugins/Experimental/Landmass/Content 76 - Paths=../../../Engine/Plugins/Experimental/MeshLODToolset/Content 77 - Paths=../../../Engine/Plugins/Experimental/PythonScriptPlugin/Content 78 - Paths=../../../Engine/Plugins/Experimental/StaticMeshEditorModeling/Content 79 - Paths=../../../Engine/Plugins/Experimental/UVEditor/Content 80 - Paths=../../../Engine/Plugins/Experimental/Volumetrics/Content 81 - Paths=../../../Engine/Plugins/Experimental/Water/Content 82 - Paths=../../../Engine/Plugins/FX/Niagara/Content 83 - Paths=../../../Engine/Plugins/JsonBlueprintUtilities/Content 84 - Paths=../../../Engine/Plugins/Media/MediaCompositing/Content 85 - Paths=../../../Engine/Plugins/Media/MediaPlate/Content 86 - Paths=../../../Engine/Plugins/MovieScene/SequencerScripting/Content 87 - Paths=../../../Engine/Plugins/PivotTool/Content 88 - Paths=../../../Engine/Plugins/PlacementTools/Content 89 - Paths=../../../Engine/Plugins/Runtime/AudioSynesthesia/Content 90 - Paths=../../../Engine/Plugins/Runtime/AudioWidgets/Content 91 - Paths=../../../Engine/Plugins/Runtime/GeometryProcessing/Content 92 - Paths=../../../Engine/Plugins/Runtime/Metasound/Content 93 - Paths=../../../Engine/Plugins/Runtime/ResonanceAudio/Content 94 - Paths=../../../Engine/Plugins/Runtime/SunPosition/Content 95 - Paths=../../../Engine/Plugins/Runtime/Synthesis/Content 96 - Paths=../../../Engine/Plugins/Runtime/WaveTable/Content 97 - Paths=../../../Engine/Plugins/Runtime/WebBrowserWidget/Content 98 - Paths=../../../Engine/Plugins/SkyCreatorPlugin/Content 99 - Paths=../../../Engine/Plugins/VirtualProduction/CameraCalibrationCore/Content 100 - Paths=../../../Engine/Plugins/VirtualProduction/LiveLinkCamera/Content 101 - Paths=../../../Engine/Plugins/VirtualProduction/Takes/Content 102 - Paths=../../../Engine/Plugins/Web/HttpBlueprint/Content 103 - Paths=../../../Pal/Plugins/DLSS/Content 104 - Paths=../../../Pal/Plugins/EffectsChecker/Content 105 - Paths=../../../Pal/Plugins/HoudiniEngine/Content 106 - Paths=../../../Pal/Plugins/PPSkyCreatorPlugin/Content 107 - Paths=../../../Pal/Plugins/PocketpairUser/Content 108 - Paths=../../../Pal/Plugins/SpreadSheetToCsv/Content 109 - Paths=../../../Pal/Plugins/Wwise/Content 110 - 111 - [/script/onlinesubsystemutils.ipnetdriver] 112 - LanServerMaxTickRate=60 113 - NetServerMaxTickRate=60 114 - 115 - [/script/engine.player] 116 - ConfiguredInternetSpeed=104857600 117 - ConfiguredLanSpeed=104857600 118 - 119 - [/script/socketsubsystemepic.epicnetdriver] 120 - MaxClientRate=104857600 121 - MaxInternetClientRate=104857600 122 - 123 - [/script/engine.engine] 124 - bSmoothFrameRate=true 125 - SmoothedFrameRateRange=(LowerBound=(Type=Inclusive,Value=30.000000),UpperBound=(Type=Exclusive,Value=60.000000)) 126 - bUseFixedFrameRate=false 127 - FixedFrameRate=60 128 - MinDesiredFrameRate=30 129 - NetClientTicksPerSecond=60 130 - ''; 131 - in 132 - { 133 - options.modules.games.palworld = { 134 - enable = mkOption { 135 - default = false; 136 - description = "Whether to enable Palworld Dedicated Server."; 137 - type = types.bool; 138 - }; 139 - 140 - package = mkOption { 141 - type = types.package; 142 - default = pkgs.palworld-server; 143 - }; 144 - 145 - public = mkOption { 146 - type = types.bool; 147 - default = false; 148 - description = "Whether to enable Community Server mode"; 149 - }; 150 - 151 - autostart = mkOption { 152 - default = false; 153 - type = types.bool; 154 - }; 155 - 156 - datadir = mkOption { 157 - type = types.path; 158 - default = "${baseCfg.datadir}/palworld"; 159 - }; 160 - 161 - ip = mkOption { 162 - type = types.nullOr types.str; 163 - default = "0.0.0.0"; 164 - }; 165 - 166 - port = mkOption { 167 - type = types.port; 168 - default = 8211; 169 - }; 170 - 171 - threads = mkOption { 172 - type = types.int; 173 - default = 4; 174 - }; 175 - 176 - maxPlayers = mkOption { 177 - type = types.int; 178 - default = 6; 179 - }; 180 - 181 - settings = mkOption { 182 - type = types.attrs; 183 - default = { }; 184 - }; 185 - }; 186 - 187 - config = mkIf isEnabled { 188 - modules.router.nftables.capturePorts = [ cfg.port ]; 189 - networking.firewall.allowedUDPPorts = [ cfg.port ]; 190 - 191 - systemd.tmpfiles.rules = [ 192 - "d ${cfg.datadir} 0755 ${baseCfg.user} ${baseCfg.group} - -" 193 - ]; 194 - 195 - systemd.services."${name}" = let 196 - dirs = { 197 - Pal = "${cfg.package}/Pal"; 198 - Engine = "${cfg.package}/Engine"; 199 - }; 200 - 201 - files = let 202 - settings = baseSettings // cfg.settings; 203 - in { 204 - "Pal/Binaries/Linux/steamclient.so" = "${pkgs.steamworks-sdk-redist}/lib/steamclient.so"; 205 - "Pal/Saved/Config/LinuxServer/PalWorldSettings.ini" = generateSettings "PalWorldSettings.ini" settings; 206 - "Pal/Saved/Config/LinuxServer/Engine.ini" = builtins.toFile "Engine.ini" engineSettings; 207 - }; 208 - 209 - script = let 210 - args = [ 211 - "Pal" 212 - "-port=${toString cfg.port}" 213 - "-useperfthreads" 214 - "-NoAsyncLoadingThread" 215 - "-UseMultithreadForDS" 216 - "-players=${toString cfg.maxPlayers}" 217 - "-NumberOfWorkerThreadsServer=${toString cfg.threads}" 218 - ] 219 - ++ optionals (cfg.ip != null) [ "-publicip=${cfg.ip}" ] 220 - ++ optionals cfg.public [ "-publiclobby" ]; 221 - bin = getExe (pkgs.mkSteamWrapper "${cfg.datadir}/Pal/Binaries/Linux/PalServer-Linux-Shipping"); 222 - in "${bin} ${concatStringsSep " " args}"; 223 - in { 224 - wantedBy = mkIf cfg.autostart [ "multi-user.target" ]; 225 - after = [ "network.target" ]; 226 - path = with pkgs; [ xdg-user-dirs util-linux ]; 227 - 228 - inherit script; 229 - preStart = '' 230 - ${scripts.mkDirs name dirs} 231 - ${scripts.mkFiles name files} 232 - ''; 233 - 234 - serviceConfig = { 235 - Restart = "on-failure"; 236 - User = "${baseCfg.user}"; 237 - Group = "${baseCfg.group}"; 238 - WorkingDirectory = "${cfg.datadir}"; 239 - 240 - CPUWeight = 80; 241 - CPUQuota = "${toString ((cfg.threads + 1) * 100)}%"; 242 - 243 - PrivateDevices = true; 244 - PrivateTmp = true; 245 - PrivateUsers = true; 246 - ProtectClock = true; 247 - ProtectProc = "noaccess"; 248 - ProtectKernelLogs = true; 249 - ProtectKernelModules = true; 250 - ProtectKernelTunables = true; 251 - RestrictRealtime = true; 252 - LockPersonality = true; 253 - 254 - # Palworld needs namespaces and system calls 255 - RestrictNamespaces = false; 256 - SystemCallFilter = []; 257 - }; 258 - }; 259 - }; 260 - }
+86
modules/games/palworld/Engine.ini
··· 1 + [Core.System] 2 + Paths=../../../Engine/Content 3 + Paths=%GAMEDIR%Content 4 + Paths=../../../Engine/Plugins/2D/Paper2D/Content 5 + Paths=../../../Engine/Plugins/Animation/ControlRigSpline/Content 6 + Paths=../../../Engine/Plugins/Animation/ControlRig/Content 7 + Paths=../../../Engine/Plugins/Animation/IKRig/Content 8 + Paths=../../../Engine/Plugins/Animation/MotionWarping/Content 9 + Paths=../../../Engine/Plugins/Bridge/Content 10 + Paths=../../../Engine/Plugins/Compositing/Composure/Content 11 + Paths=../../../Engine/Plugins/Compositing/OpenColorIO/Content 12 + Paths=../../../Engine/Plugins/Developer/AnimationSharing/Content 13 + Paths=../../../Engine/Plugins/Developer/Concert/ConcertSync/ConcertSyncClient/Content 14 + Paths=../../../Engine/Plugins/Editor/BlueprintHeaderView/Content 15 + Paths=../../../Engine/Plugins/Editor/GeometryMode/Content 16 + Paths=../../../Engine/Plugins/Editor/ModelingToolsEditorMode/Content 17 + Paths=../../../Engine/Plugins/Editor/ObjectMixer/LightMixer/Content 18 + Paths=../../../Engine/Plugins/Editor/ObjectMixer/ObjectMixer/Content 19 + Paths=../../../Engine/Plugins/Editor/SpeedTreeImporter/Content 20 + Paths=../../../Engine/Plugins/Enterprise/DatasmithContent/Content 21 + Paths=../../../Engine/Plugins/Enterprise/GLTFExporter/Content 22 + Paths=../../../Engine/Plugins/Experimental/ChaosCaching/Content 23 + Paths=../../../Engine/Plugins/Experimental/ChaosClothEditor/Content 24 + Paths=../../../Engine/Plugins/Experimental/ChaosNiagara/Content 25 + Paths=../../../Engine/Plugins/Experimental/ChaosSolverPlugin/Content 26 + Paths=../../../Engine/Plugins/Experimental/CommonUI/Content 27 + Paths=../../../Engine/Plugins/Experimental/Dataflow/Content 28 + Paths=../../../Engine/Plugins/Experimental/FullBodyIK/Content 29 + Paths=../../../Engine/Plugins/Experimental/GeometryCollectionPlugin/Content 30 + Paths=../../../Engine/Plugins/Experimental/GeometryFlow/Content 31 + Paths=../../../Engine/Plugins/Experimental/ImpostorBaker/Content 32 + Paths=../../../Engine/Plugins/Experimental/Landmass/Content 33 + Paths=../../../Engine/Plugins/Experimental/MeshLODToolset/Content 34 + Paths=../../../Engine/Plugins/Experimental/PythonScriptPlugin/Content 35 + Paths=../../../Engine/Plugins/Experimental/StaticMeshEditorModeling/Content 36 + Paths=../../../Engine/Plugins/Experimental/UVEditor/Content 37 + Paths=../../../Engine/Plugins/Experimental/Volumetrics/Content 38 + Paths=../../../Engine/Plugins/Experimental/Water/Content 39 + Paths=../../../Engine/Plugins/FX/Niagara/Content 40 + Paths=../../../Engine/Plugins/JsonBlueprintUtilities/Content 41 + Paths=../../../Engine/Plugins/Media/MediaCompositing/Content 42 + Paths=../../../Engine/Plugins/Media/MediaPlate/Content 43 + Paths=../../../Engine/Plugins/MovieScene/SequencerScripting/Content 44 + Paths=../../../Engine/Plugins/PivotTool/Content 45 + Paths=../../../Engine/Plugins/PlacementTools/Content 46 + Paths=../../../Engine/Plugins/Runtime/AudioSynesthesia/Content 47 + Paths=../../../Engine/Plugins/Runtime/AudioWidgets/Content 48 + Paths=../../../Engine/Plugins/Runtime/GeometryProcessing/Content 49 + Paths=../../../Engine/Plugins/Runtime/Metasound/Content 50 + Paths=../../../Engine/Plugins/Runtime/ResonanceAudio/Content 51 + Paths=../../../Engine/Plugins/Runtime/SunPosition/Content 52 + Paths=../../../Engine/Plugins/Runtime/Synthesis/Content 53 + Paths=../../../Engine/Plugins/Runtime/WaveTable/Content 54 + Paths=../../../Engine/Plugins/Runtime/WebBrowserWidget/Content 55 + Paths=../../../Engine/Plugins/SkyCreatorPlugin/Content 56 + Paths=../../../Engine/Plugins/VirtualProduction/CameraCalibrationCore/Content 57 + Paths=../../../Engine/Plugins/VirtualProduction/LiveLinkCamera/Content 58 + Paths=../../../Engine/Plugins/VirtualProduction/Takes/Content 59 + Paths=../../../Engine/Plugins/Web/HttpBlueprint/Content 60 + Paths=../../../Pal/Plugins/DLSS/Content 61 + Paths=../../../Pal/Plugins/EffectsChecker/Content 62 + Paths=../../../Pal/Plugins/HoudiniEngine/Content 63 + Paths=../../../Pal/Plugins/PPSkyCreatorPlugin/Content 64 + Paths=../../../Pal/Plugins/PocketpairUser/Content 65 + Paths=../../../Pal/Plugins/SpreadSheetToCsv/Content 66 + Paths=../../../Pal/Plugins/Wwise/Content 67 + 68 + [/script/onlinesubsystemutils.ipnetdriver] 69 + LanServerMaxTickRate=60 70 + NetServerMaxTickRate=60 71 + 72 + [/script/engine.player] 73 + ConfiguredInternetSpeed=104857600 74 + ConfiguredLanSpeed=104857600 75 + 76 + [/script/socketsubsystemepic.epicnetdriver] 77 + MaxClientRate=104857600 78 + MaxInternetClientRate=104857600 79 + 80 + [/script/engine.engine] 81 + bSmoothFrameRate=true 82 + SmoothedFrameRateRange=(LowerBound=(Type=Inclusive,Value=30.000000),UpperBound=(Type=Exclusive,Value=60.000000)) 83 + bUseFixedFrameRate=false 84 + FixedFrameRate=60 85 + MinDesiredFrameRate=30 86 + NetClientTicksPerSecond=60
+171
modules/games/palworld/default.nix
··· 1 + { lib, config, pkgs, ... } @ args: 2 + 3 + with lib; 4 + let 5 + isEnabled = config.modules.games.enable && config.modules.games.palworld.enable; 6 + baseCfg = config.modules.games; 7 + cfg = config.modules.games.palworld; 8 + 9 + name = "palworld-server"; 10 + scripts = (import ../lib/scripts.nix) args; 11 + 12 + generateSettings = name: value: let 13 + optionSettings = 14 + mapAttrsToList 15 + (optName: optVal: let 16 + optType = builtins.typeOf optVal; 17 + encodedVal = 18 + if optType == "string" 19 + then "\"${optVal}\"" 20 + else if optType == "bool" 21 + then 22 + if optVal 23 + then "True" 24 + else "False" 25 + else toString optVal; 26 + in "${optName}=${encodedVal}") 27 + value; 28 + in 29 + builtins.toFile name '' 30 + [/Script/Pal.PalGameWorldSettings] 31 + OptionSettings=(${concatStringsSep "," optionSettings}) 32 + ''; 33 + 34 + baseSettings = { 35 + ServerName = "Unnamed Server"; 36 + AllowConnectPlatform = "Steam"; 37 + CoopPlayerMaxNum = cfg.maxPlayers; 38 + bIsUseBackupSaveData = true; 39 + RCONEnabled = false; 40 + RESTAPIEnabled = false; 41 + }; 42 + in 43 + { 44 + options.modules.games.palworld = { 45 + enable = mkOption { 46 + default = false; 47 + description = "Whether to enable Palworld Dedicated Server."; 48 + type = types.bool; 49 + }; 50 + 51 + package = mkOption { 52 + type = types.package; 53 + default = pkgs.palworld-server; 54 + }; 55 + 56 + public = mkOption { 57 + type = types.bool; 58 + default = false; 59 + description = "Whether to enable Community Server mode"; 60 + }; 61 + 62 + autostart = mkOption { 63 + default = false; 64 + type = types.bool; 65 + }; 66 + 67 + datadir = mkOption { 68 + type = types.path; 69 + default = "${baseCfg.datadir}/palworld"; 70 + }; 71 + 72 + ip = mkOption { 73 + type = types.nullOr types.str; 74 + default = "0.0.0.0"; 75 + }; 76 + 77 + port = mkOption { 78 + type = types.port; 79 + default = 8211; 80 + }; 81 + 82 + threads = mkOption { 83 + type = types.int; 84 + default = 4; 85 + }; 86 + 87 + maxPlayers = mkOption { 88 + type = types.int; 89 + default = 6; 90 + }; 91 + 92 + settings = mkOption { 93 + type = types.attrs; 94 + default = { }; 95 + }; 96 + }; 97 + 98 + config = mkIf isEnabled { 99 + modules.router.nftables.capturePorts = [ cfg.port ]; 100 + networking.firewall.allowedUDPPorts = [ cfg.port ]; 101 + 102 + systemd.tmpfiles.rules = [ 103 + "d ${cfg.datadir} 0755 ${baseCfg.user} ${baseCfg.group} - -" 104 + ]; 105 + 106 + systemd.services."${name}" = let 107 + dirs = { 108 + Pal = "${cfg.package}/Pal"; 109 + Engine = "${cfg.package}/Engine"; 110 + }; 111 + 112 + files = let 113 + settings = baseSettings // cfg.settings; 114 + in { 115 + "Pal/Binaries/Linux/steamclient.so" = "${pkgs.steamworks-sdk-redist}/lib/steamclient.so"; 116 + "Pal/Saved/Config/LinuxServer/PalWorldSettings.ini" = generateSettings "PalWorldSettings.ini" settings; 117 + "Pal/Saved/Config/LinuxServer/Engine.ini" = builtins.readFile ./Engine.ini; 118 + }; 119 + 120 + script = let 121 + args = [ 122 + "Pal" 123 + "-port=${toString cfg.port}" 124 + "-useperfthreads" 125 + "-NoAsyncLoadingThread" 126 + "-UseMultithreadForDS" 127 + "-players=${toString cfg.maxPlayers}" 128 + "-NumberOfWorkerThreadsServer=${toString cfg.threads}" 129 + ] 130 + ++ optionals (cfg.ip != null) [ "-publicip=${cfg.ip}" ] 131 + ++ optionals cfg.public [ "-publiclobby" ]; 132 + bin = getExe (pkgs.mkSteamWrapper "${cfg.datadir}/Pal/Binaries/Linux/PalServer-Linux-Shipping"); 133 + in "${bin} ${concatStringsSep " " args}"; 134 + in { 135 + wantedBy = mkIf cfg.autostart [ "multi-user.target" ]; 136 + after = [ "network.target" ]; 137 + path = with pkgs; [ xdg-user-dirs util-linux ]; 138 + 139 + inherit script; 140 + preStart = '' 141 + ${scripts.mkDirs name dirs} 142 + ${scripts.mkFiles name files} 143 + ''; 144 + 145 + serviceConfig = { 146 + Restart = "on-failure"; 147 + User = "${baseCfg.user}"; 148 + Group = "${baseCfg.group}"; 149 + WorkingDirectory = "${cfg.datadir}"; 150 + 151 + CPUWeight = 80; 152 + CPUQuota = "${toString ((cfg.threads + 1) * 100)}%"; 153 + 154 + PrivateDevices = true; 155 + PrivateTmp = true; 156 + PrivateUsers = true; 157 + ProtectClock = true; 158 + ProtectProc = "noaccess"; 159 + ProtectKernelLogs = true; 160 + ProtectKernelModules = true; 161 + ProtectKernelTunables = true; 162 + RestrictRealtime = true; 163 + LockPersonality = true; 164 + 165 + # Palworld needs namespaces and system calls 166 + RestrictNamespaces = false; 167 + SystemCallFilter = []; 168 + }; 169 + }; 170 + }; 171 + }