-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
factorio: Add rcon paremeters to NixOS module #352267
base: master
Are you sure you want to change the base?
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.
Does it make sense to provide one of the options but not the other? If so, ideally we'd document what that means. If not, perhaps we could do something like rcon = { password = "..."; bind = "..."; };
so you're forced to specify both or neither. (An alternative would be to use an assertion, but I think the optional submodule approach is nicer.)
type = lib.types.nullOr lib.types.str; | ||
default = null; | ||
description = '' | ||
Sets the rcon server password. |
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.
Probably remind the user that this will be world-readable in the store. Perhaps consider if we want to provide a from-file option as well or instead?
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'll take a stab at those suggestions, I haven't made a module with a submodule like that before but I think it makes sense in this case since both arguments must be present together.
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; if you find it tricky I'm happy to try to come up with an implementation tomorrow or so; I haven't used submodules before either but I'm pretty sure I've seen examples around
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 managed to get it working with a submodule, but I am not sure how to get it to read the password from a file. I tried a naive implementation like --rcon-password=$(cat ${password_file})
but Nix kept inserting a backslash in front of the dollar sign for some reason and I wasn't able to figure out why. There is probably a more nix friendly way to accomplish this but I'm not sure what it was and I wasn't able to find any examples.
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.
ah, and in fact even if something like that $(cat ...)
worked it would be a pretty weak improvement since your process command line is visible in /proc
...
Sounds like we can't really make this secure from other users on the same host unless Factorio adds the ability to read the password from a file. Sorry for leading you down a doomed path :)
92e72bd
to
db5469d
Compare
db5469d
to
1254050
Compare
This adds rcon bind address and password options to the Factorio NixOS module. These unfortunately cannot be set in the config file, so adding these params is the only I'm aware to configure it.
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.