Revert "refactor(nixos): allow grouped SteamCMD arguments"
This reverts commit 46805be6de.
This commit is contained in:
@@ -77,12 +77,18 @@
|
|||||||
arguments = [
|
arguments = [
|
||||||
"-nographics"
|
"-nographics"
|
||||||
"-batchmode"
|
"-batchmode"
|
||||||
[ "-name" "main" ]
|
"-name"
|
||||||
[ "-port" "2456" ]
|
"main"
|
||||||
[ "-world" "main" ]
|
"-port"
|
||||||
[ "-savedir" "/pikachu/media/games/servers/valheim/main" ]
|
"2456"
|
||||||
[ "-password" "foobarbaz" ]
|
"-world"
|
||||||
[ "-public" "0" ]
|
"main"
|
||||||
|
"-savedir"
|
||||||
|
"/pikachu/media/games/servers/valheim/main"
|
||||||
|
"-password"
|
||||||
|
"foobarbaz"
|
||||||
|
"-public"
|
||||||
|
"0"
|
||||||
];
|
];
|
||||||
udpPorts = [
|
udpPorts = [
|
||||||
2456
|
2456
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ let
|
|||||||
cfg = config.modules.services.steamcmd;
|
cfg = config.modules.services.steamcmd;
|
||||||
|
|
||||||
libraryPath = lib.concatStringsSep ":" cfg.libraryDirs;
|
libraryPath = lib.concatStringsSep ":" cfg.libraryDirs;
|
||||||
arguments = lib.flatten cfg.arguments;
|
|
||||||
|
|
||||||
prepareScript = pkgs.writeShellScript "steamcmd-${cfg.serviceName}-prepare" ''
|
prepareScript = pkgs.writeShellScript "steamcmd-${cfg.serviceName}-prepare" ''
|
||||||
set -eu
|
set -eu
|
||||||
@@ -38,7 +37,7 @@ let
|
|||||||
|
|
||||||
cd ${lib.escapeShellArg cfg.installDir}
|
cd ${lib.escapeShellArg cfg.installDir}
|
||||||
${lib.optionalString (cfg.libraryDirs != [ ]) ''export LD_LIBRARY_PATH=${lib.escapeShellArg libraryPath}:''${LD_LIBRARY_PATH-}''}
|
${lib.optionalString (cfg.libraryDirs != [ ]) ''export LD_LIBRARY_PATH=${lib.escapeShellArg libraryPath}:''${LD_LIBRARY_PATH-}''}
|
||||||
exec ${lib.getExe pkgs.steam-run} ${lib.escapeShellArg cfg.executable} ${lib.escapeShellArgs arguments}
|
exec ${lib.getExe pkgs.steam-run} ${lib.escapeShellArg cfg.executable} ${lib.escapeShellArgs cfg.arguments}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
restartCommand =
|
restartCommand =
|
||||||
@@ -103,15 +102,13 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
arguments = lib.mkOption {
|
arguments = lib.mkOption {
|
||||||
type = lib.types.listOf (lib.types.oneOf [
|
type = lib.types.listOf lib.types.str;
|
||||||
lib.types.str
|
|
||||||
(lib.types.listOf lib.types.str)
|
|
||||||
]);
|
|
||||||
default = [ ];
|
default = [ ];
|
||||||
example = [
|
example = [
|
||||||
[ "-name" "main" ]
|
"-name"
|
||||||
|
"main"
|
||||||
];
|
];
|
||||||
description = "Arguments passed to the server executable. Nested lists group related arguments and are flattened before execution.";
|
description = "Arguments passed to the server executable.";
|
||||||
};
|
};
|
||||||
|
|
||||||
libraryDirs = lib.mkOption {
|
libraryDirs = lib.mkOption {
|
||||||
|
|||||||
Reference in New Issue
Block a user