Add user option in geth nixos module.#626
Open
thalin wants to merge 4 commits intonix-community:mainfrom
Open
Conversation
Contributor
Author
|
This could probably be more well-supported in the module directly of course - adding a user option would be nice. However, this is most expedient for what I needed so here it is. |
Contributor
Author
|
I updated this to add the user option, as mentioned above. |
9380bd8 to
d53e088
Compare
8073365 to
a1db5da
Compare
Also set all the settings DynamicUser automatically sets. This ensures that the environment between the two options stays consistent.
Default is true which leaves dynamicUser enabled, and when set to false the systemd service DynamicUser option is disabled but all of the other options which are automatically enabled by that option are set to default enabled.
Contributor
Author
|
OK I think I am happy with this now and think that it doesn't disrupt existing behavior. Any feedback would be appreciated! |
107c647 to
3ce8aee
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I wanted to manage the user that runs the geth service directly instead of relying on DynamicUser in the systemd config. The existing geth config didn't really allow this, but adding mkDefault to User let me override it in my own config. While I was there, I thought maybe it would be useful to be able to change StateDirectory and ExecStart too, so I went ahead and wrapped those with mkDefault too - but I'm not really sure ExecStart needs it. Looking for a second opinion there.
FWIW, I wrote a little
ethOverridefunction to change the user and add (most of) the settings that DynamicUser covers, which looks like this:Then I call the function like
systemd.services.<service-name>.serviceConfig = ethOverride myuser.