feat: zomboid to neuro

This commit is contained in:
2026-11-21 09:09:28 +00:00
parent 53d4ecc2bf
commit 1388a251cf
11 changed files with 707 additions and 128 deletions
@@ -57,6 +57,7 @@
${pkgs.coreutils}/bin/install -d -m 0700 \
"$staging_dir/Zomboid/Saves/Multiplayer/${cfg.serverName}" \
"$staging_dir/Zomboid/Server" \
"$staging_dir/Zomboid/mods" \
"$archive_dir"
exec 9>"$lock_file"
@@ -126,6 +127,9 @@
${pkgs.rsync}/bin/rsync -a --delete \
${lib.escapeShellArg "${saveDir}/"} \
"$staging_dir/Zomboid/Saves/Multiplayer/${cfg.serverName}/"
${pkgs.rsync}/bin/rsync -a --delete \
${lib.escapeShellArg "${zomboidDir}/mods/"} \
"$staging_dir/Zomboid/mods/"
${pkgs.rsync}/bin/rsync -a --delete --delete-excluded \
--include=${lib.escapeShellArg "/${cfg.serverName}_SandboxVars.lua"} \
--include=${lib.escapeShellArg "/${cfg.serverName}_spawnpoints.lua"} \
@@ -233,6 +237,12 @@ in {
description = "Steam beta branch, for example legacy41.";
};
updateOnStart = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Update and validate the game through SteamCMD on startup; disable to use an existing installation.";
};
memory = lib.mkOption {
type = lib.types.strMatching "[0-9]+[mMgG]";
default = "3g";
@@ -470,11 +480,16 @@ in {
${pkgs.coreutils}/bin/chown project-zomboid:project-zomboid ${lib.escapeShellArg rconPasswordFile}
${pkgs.coreutils}/bin/chmod 0600 ${lib.escapeShellArg rconPasswordFile}
''}
${pkgs.steamcmd}/bin/steamcmd \
+force_install_dir ${lib.escapeShellArg cfg.installDir} \
+login anonymous \
+app_update 380870 ${lib.optionalString (cfg.branch != null) "-beta ${lib.escapeShellArg cfg.branch}"} validate \
+quit
${if cfg.updateOnStart then ''
${pkgs.steamcmd}/bin/steamcmd \
+force_install_dir ${lib.escapeShellArg cfg.installDir} \
+login anonymous \
+app_update 380870 ${lib.optionalString (cfg.branch != null) "-beta ${lib.escapeShellArg cfg.branch}"} validate \
+quit
'' else ''
test -x ${lib.escapeShellArg "${cfg.installDir}/start-server.sh"}
test -s ${lib.escapeShellArg "${cfg.installDir}/ProjectZomboid64.json"}
''}
${pkgs.gnused}/bin/sed -i -E \
's/"-Xmx[0-9]+[mMgG]"/"-Xmx${cfg.memory}"/' \
${lib.escapeShellArg "${cfg.installDir}/ProjectZomboid64.json"}