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
gogs: init module #19363
gogs: init module #19363
Conversation
@schneefux, 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. |
type = mkOption { | ||
type = types.str; | ||
default = "sqlite3"; | ||
description = "Database engine to use. Either `mysql`, `postgres`or `sqlite3`."; |
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.
If there is only a limited number of possible values you can use types.enum
like for example 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.
Done, thank you.
|
||
buildGoPackage rec { | ||
name = "gogs-${version}"; | ||
version = "v0.9.97"; |
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.
please remove the v from version
49cb0a3
to
7ac0877
Compare
This includes the changes from #19361. |
7ac0877
to
09cb0df
Compare
@LnL7 Updated, this pull request includes only the module now. |
09cb0df
to
bebbc3b
Compare
bebbc3b
to
774d227
Compare
b316fd5
to
291d1d3
Compare
4191e28
to
cf696d9
Compare
|
||
repositoryRoot = mkOption { | ||
type = types.str; | ||
default = "${cfg.stateDir}/repositories"; |
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.
running without any options the service fails because this doesn't exist
|
||
# update all hooks' binary paths | ||
HOOKS=$(find ${cfg.repositoryRoot} -mindepth 4 -maxdepth 4 -type f -wholename "*git/hooks/*") | ||
sed -ri 's,/nix/store/[a-z0-9.-]+/bin/gogs,${pkgs.gogs.bin}/bin/gogs,g' $HOOKS |
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.
This fails when no hooks are present. What's this for, looks a little strange to me?
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.
Do these have to be absolute paths? Otherwise I would suggest this:
systemd.services.gogs.path = [ "${pkgs.gogs.bin}/bin" ];
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.
@LnL7 they do have a full path and it is no the gogs service who starts the hooks, but they are triggered from sshd for example, when somebody pushes commits.
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 understand it a bit better now, can't think of a nicer solution either.
cf696d9
to
67c4512
Compare
It may be also worth to take a look at https://github.com/go-gitea/gitea |
Gitea packaging should be also easier as they vendorize their dependencies better. |
Depends on #19361.
Implements a NixOS module for the Go Git Service. Based on @valeriangalliat's nixos-gogs.
Example usage:
cc @valeriangalliat @kamilchm @yorickvP