nixos/services.factorio: fix escapeShellArg (#339115)

This commit is contained in:
Philip Taron 2024-09-03 13:32:36 -07:00 committed by GitHub
commit 9e244d3d92
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -275,7 +275,7 @@ in
"--create=${mkSavePath cfg.saveName}" "--create=${mkSavePath cfg.saveName}"
(lib.optionalString (cfg.mods != []) "--mod-directory=${modDir}") (lib.optionalString (cfg.mods != []) "--mod-directory=${modDir}")
]) ])
+ (lib.optionalString (cfg.extraSettingsFile != null) ("\necho ${lib.strings.lib.escapeShellArg serverSettingsString}" + (lib.optionalString (cfg.extraSettingsFile != null) ("\necho ${lib.strings.escapeShellArg serverSettingsString}"
+ " \"$(cat ${cfg.extraSettingsFile})\" | ${lib.getExe pkgs.jq} -s add" + " \"$(cat ${cfg.extraSettingsFile})\" | ${lib.getExe pkgs.jq} -s add"
+ " > ${stateDir}/server-settings.json")); + " > ${stateDir}/server-settings.json"));