-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add public, logFile and preset flags #14
base: main
Are you sure you want to change the base?
Conversation
Defaults to true when not set. This is apparently the default: "public 1 - Set the visibility of your server. 1 is default and will make the server visible in the browser. Set it to 0 to make the server invisible and only joinable via the ‘Join IP’-button." source: https://www.valheimgame.com/support/a-guide-to-dedicated-servers/
Maybe it is possible to create an enum for the |
You certainly could. I'm not sure about the log-file option. Is there a good reason to not use journald? |
I think that since the option is available for a regular valheim dedicated server that it could also be available here. Not sure if it is possible to redirect logs to another file without the |
logFile = lib.mkOption { | ||
type = with lib.types; nullOr str; | ||
default = null; | ||
example = "/var/lib/valheim/log/valheim-server.log"; | ||
description = lib.mdDoc '' | ||
The path where the server log file will be saved. | ||
|
||
When set, this will redirect all logs from stdout to the specified path. | ||
This means that the logs will not be captured by systemd's journal. | ||
Leave this option unset to keep console logging enabled. | ||
|
||
Make sure the valheim user has write access to the specified directory, otherwise | ||
the valheim service fail to start and exit. | ||
''; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think -logFile
is there because upstream expects you to run it using their wrapper script, from the commandline, where the log output will just go to your terminal scrollback buffer. The NixOS module provided by this flake instead runs it using systemd. Telling the underlying program to log to a file instead of standard out/error somewhat goes against the purpose of running as a systemd service, so I would rather not expose that function.
preset = lib.mkOption { | ||
type = with lib.types; nullOr str; | ||
default = null; | ||
example = "hardcore"; | ||
description = lib.mdDoc '' | ||
The preset world modifier, valid options are | ||
"easy", "hard", "hardcore", "casual", "hammer" and "immersive". | ||
''; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding your comment about using an enum type, you would change the type from nullOr str
to nullOr (enum ["easy" "hard" ...])
(replacing ...
with the rest of the enum values), and then remove the list of values from the description.
Reference: NixOS Manual
New options:
By default the
public
flag is set to true as per the docs.I think the
preset
flag is"normal"
by default, but leaving it out if the user does not specify it is a better idea imo.