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
nixos/xonotic: init #98739
nixos/xonotic: init #98739
Conversation
@GrahamcOfBorg eval |
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.
Here are some comments I hope you find useful.
|
||
extraConfig = mkOption { | ||
type = types.lines; | ||
description = "extra config written to server.cfg"; |
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.
Descriptions should start with a capital letter and end with a period.
type = types.attrsOf (types.oneOf [ types.str types.int types.bool ]); | ||
description = '' | ||
server config, see | ||
<link xlink:href="https://github.com/xonotic/xonotic/wiki/basic-server-configuration">https://github.com/xonotic/xonotic/wiki/basic-server-configuration</link> |
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'm not very good with our documentation format but I thought you could avoid duplicating the link and it will show up the same way.
|
||
preStart = mkOption { | ||
type = types.lines; | ||
description = "command to execute before starting xonotic"; |
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.
It might be beneficial to explain this will run in a shell script before the service starts for some context. Additionally, naming this option to something a non developer/sysadmin would understand would be beneficial too. As it stands I feel like you need to be a NixOS developer to understand this option.
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'm not good with writing descriptions. Any suggestions?
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.
@davidak has a passion for UX, so I wonder if he could suggest a better name for this option.
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.
thanks for recognizing that. i think UX is the most important thing for the success of a project, but i'm not a professional in that area :D
"preStart" and the description seems descriptive. mentioning that it is a shell command would also help.
i would question why it's needed at all. for installing additional maps, packaging them and adding to some list would be more reproducible and intuitive. but when the user wants to add more content, a dataDir
option would be better
|
||
openFirewall = (mkEnableOption "open udp port for xonotic") // { default = true; }; | ||
|
||
package = mkOption { |
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.
This seems a bit overkill... but I won't complain if you really want to keep it.
|
||
networking.firewall.allowedUDPPorts = let | ||
firewallServers = lib.filterAttrs (name: host: host.openFirewall) cfg.servers; | ||
in lib.mapAttrsToList (name: host: host.config.port) cfg.servers; |
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.
You should probably assert this value exists. This might be problematic because you also have an extraConfig
in which the sysadmin could define this value...
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.
extra config is there, because there are cases in a xonotic config, which you cannot make as a key-value pair. But I hope everyone tries to not use it.
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.
That makes sense. A simple assertion
will go a long way.
94d5250
to
800ae30
Compare
800ae30
to
0efec09
Compare
I marked this as stale due to inactivity. → More info |
Motivation for this change
Xonotic server module
Rewrite of #83761
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)CC: @petabyteboy