mirror of
https://github.com/AsgardEternal/Squad.nix.git
synced 2025-01-02 14:29:25 -06:00
fix: ensure the rcon port is set in Rcon.cfg
This commit is contained in:
parent
043aa199f9
commit
8fe32f8d70
@ -15,8 +15,8 @@ in
|
|||||||
Defined as `servers.<name>`. By default the `<name>` will be used as the
|
Defined as `servers.<name>`. By default the `<name>` will be used as the
|
||||||
`servers.<name>.config.server.settings.ServerName`.
|
`servers.<name>.config.server.settings.ServerName`.
|
||||||
'';
|
'';
|
||||||
type = lib.types.attrsOf (lib.types.submodule ({ name, ... }: {
|
type = lib.types.attrsOf (lib.types.submodule ({ name, config, ... }: {
|
||||||
options = rec {
|
options = {
|
||||||
enable = lib.mkEnableOption "Enable Squad Server";
|
enable = lib.mkEnableOption "Enable Squad Server";
|
||||||
openFirewall = lib.mkOption {
|
openFirewall = lib.mkOption {
|
||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
||||||
@ -106,6 +106,16 @@ in
|
|||||||
type = lib.types.submodule {
|
type = lib.types.submodule {
|
||||||
freeformType = settingsFormat.type;
|
freeformType = settingsFormat.type;
|
||||||
options = {
|
options = {
|
||||||
|
Port = lib.mkOption {
|
||||||
|
type = lib.types.port;
|
||||||
|
default = builtins.elemAt config.rconPort 0;
|
||||||
|
visible = false;
|
||||||
|
readOnly = true;
|
||||||
|
description = ''
|
||||||
|
RCON port to define in the Rcon.cfg. This will always use the rcon port
|
||||||
|
defined in `rconPort`.
|
||||||
|
'';
|
||||||
|
};
|
||||||
IP = lib.mkOption {
|
IP = lib.mkOption {
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
default = "0.0.0.0";
|
default = "0.0.0.0";
|
||||||
@ -980,12 +990,7 @@ in
|
|||||||
${acc}
|
${acc}
|
||||||
# Handle the ${name} configuration
|
# Handle the ${name} configuration
|
||||||
printf "Generating the '%s' configuration file.\n" "${name}.cfg"
|
printf "Generating the '%s' configuration file.\n" "${name}.cfg"
|
||||||
cp -f "${path}" ./"${name}.cfg"
|
cp -f "${path}" ./"${name}.cfg"'') "" cfgs}
|
||||||
'') "" cfgs}
|
|
||||||
|
|
||||||
# Correct the permissions for the Squad Server cfgs. When the Squad Server is first
|
|
||||||
# installed it will include the configs by default with an overly open CHMOD.
|
|
||||||
chmod 0600 *.cfg
|
|
||||||
|
|
||||||
${lib.optionalString (cfg.config.server.passwordFile != null) ''
|
${lib.optionalString (cfg.config.server.passwordFile != null) ''
|
||||||
## Handle secrets for the `Server.cfg` file ##
|
## Handle secrets for the `Server.cfg` file ##
|
||||||
|
Loading…
Reference in New Issue
Block a user