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
gollum service: init #29476
gollum service: init #29476
Conversation
@erictapen, thanks for your PR! By analyzing the history of the files in this pull request, we identified @edolstra, @joachifm and @offlinehacker to be potential reviewers. |
mkdir -p ${cfg.stateDir} | ||
git init ${cfg.stateDir} | ||
chmod 755 ${cfg.stateDir} | ||
chown -R gollum:gollum ${cfg.stateDir} |
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.
Fixing ownership at startup seems to make allocating a static uid redundant. If a static uid must be used, this is at least a waste of time.
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! This part was meant as a temporarily solution I forgot to fix. I'd like to let users the choice of renaming the gollum
user. This means, that line 78 is supposed to look like this:
chown -R ${cfg.user}:${cfg.group} ${cfg.stateDir}
If you think, that with this solution I would'nt need a static UID/GID, I will remove them.
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.
With fixing the ownership, I expect a static uid is unnecessary. If updating the ownership is very expensive, however, perhaps stick with only static uid. Then again, I don't really know the software so I'll leave that to your judgement.
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.
Now I think I got what you said. I removed the static UID/GID. That generic userName/groupName feature i mentioned will be added later, as I don't see immediate need for it.
description = "Enable the Gollum service."; | ||
}; | ||
|
||
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.
Is there a use case for using a package other than the default?
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.
Nope, I just saw this pattern in other packages. Will remove it.
}; | ||
|
||
extraConfig = mkOption { | ||
type = types.str; |
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.
Consider using types.lines
, it has more sensible merge semantics for an option like this.
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. Updated the PR.
309d83d
to
8ed4a8c
Compare
createHome = false; | ||
}; | ||
|
||
users.groups.gollum.name = config.users.users.gollum.name; |
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 can also do simply
let # for syntax hl, ignore
users.groups.gollum = { };
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 nice. Added this (untested as it is trivial).
8ed4a8c
to
16d4877
Compare
Yeah, thanks alot! |
Motivation for this change
This introduces the already packaged
gollum
package as a nixos module. Example config:I mainly copied code from the
gitit
module (which I used beforegollum
). Asgitit
is commented out for quite some time, it may be that I used some outdated coding conventions. Also I'm not that familiar withsystemd
services. Feedback is welcome.As I use
gollum
personally, I will continue to add features to it and will do maintenance.Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)