Skip to content
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

Closed
wants to merge 1 commit into from
Closed

nixos/xonotic: init #98739

wants to merge 1 commit into from

Conversation

Kloenk
Copy link
Member

@Kloenk Kloenk commented Sep 25, 2020

Motivation for this change

Xonotic server module
Rewrite of #83761

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

CC: @petabyteboy

@jonringer
Copy link
Contributor

@GrahamcOfBorg eval

Copy link
Member

@aanderse aanderse left a 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.

nixos/modules/services/games/xonotic.nix Outdated Show resolved Hide resolved

extraConfig = mkOption {
type = types.lines;
description = "extra config written to server.cfg";
Copy link
Member

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.

nixos/modules/services/games/xonotic.nix Outdated Show resolved Hide resolved
nixos/modules/services/games/xonotic.nix Outdated Show resolved Hide resolved
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>
Copy link
Member

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.

nixos/modules/services/games/xonotic.nix Outdated Show resolved Hide resolved
nixos/modules/services/games/xonotic.nix Outdated Show resolved Hide resolved

preStart = mkOption {
type = types.lines;
description = "command to execute before starting xonotic";
Copy link
Member

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.

Copy link
Member Author

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?

Copy link
Member

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.

Copy link
Member

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 {
Copy link
Member

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;
Copy link
Member

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...

Copy link
Member Author

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.

Copy link
Member

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.

@Kloenk Kloenk force-pushed the xonotic-module branch 2 times, most recently from 94d5250 to 800ae30 Compare September 26, 2020 21:06
@stale
Copy link

stale bot commented Jun 9, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 9, 2021
@Kloenk Kloenk closed this Dec 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants