-
-
Notifications
You must be signed in to change notification settings - Fork 15.5k
nixos/mindustry: init #85634
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/mindustry: init #85634
Conversation
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 contributing this service! I have a few suggestions which I hope are helpful.
The map that mindustry-server should host. Leaving both game-mode and game-map empty results in a random survival map. | ||
''; | ||
}; | ||
stateDirName = 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.
Given this uses DynamicUser
this option didn't seem very useful. I would recommend simply hard coding to /var/lib/mindustry
.
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.
Removed, thanks! Might make more sense if we also allow mods and maps to be included later on, but not currently as far as I can tell.
socketInput = true; | ||
}; | ||
description = '' | ||
Extra game configuration passed to mindustry-server via the config argument. |
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.
A link to configuration options would be great here.
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.
Agree, I have created an issue upstream at https://github.com/MindustryGame/wiki/issues/41. In the meantime I have appended the description string how to get available options.
default = [ ]; | ||
example = [ "playerlimit 8" "reloadmaps" ]; | ||
description = '' | ||
Extra commands passed to mindustry-server. |
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.
A link to command options would be great here.
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.
See extraConfig
options = { | ||
services.mindustry = { | ||
enable = mkEnableOption name; | ||
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.
Are there any variants of this package that make this option especially convenient?
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.
Yes, there's the version whitelist override, which is a compile-time 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.
It'd be cool to have maps
and mods
options of type list of paths. Then we could package the best ones in an overlay.
But this would require separating the mods and maps directories from the stateDir (hoping the server doesn't somehow need write access to them)
Edit: shouldn't there be a meta.maintainers in the module too?
|
I marked this as stale due to inactivity. → More info |
''; | ||
|
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 am no longer hosting a Mindustry server, if anyone wants to pick this one up this please feel free to do so. |
Motivation for this change
To host a Mindustry server on NixOS via services configuration.
Note that mindustry can open up a socket connection when setup via e.g.
This can then be used to send commands to the server (it only listens on localhost) with e.g. nc
I am not 100% happy with that, if anyone has gotten some ideas I'd be glad to hear them.
Also, I am not sure how I would be able to implement a graceful shutdown of mindustry-server, again feedback welcome.
CC: @fgaz maintainer of pkgs.mindustry
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)