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 at v0.9.97 #19361
gogs: init at v0.9.97 #19361
Conversation
|
||
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.
The version part of the name attribute must start with a digit (following a dash) — e.g., "hello-0.3.1rc2". nixpkgs manual - 10.2. Package naming
I made the same mistake a few days ago...
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.
src = fetchFromGitHub { | ||
owner = "gogits"; | ||
repo = "gogs"; | ||
rev = "${version}"; |
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 could use rev = "v${version}";
😉
}; | ||
} | ||
{ | ||
goPackagePath = "github.com/mattn/go-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.
this probably needs the sqlite package
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.
|
||
patchPhase = '' | ||
substituteInPlace models/repo.go \ | ||
--replace '#!/usr/bin/env %s\n' "#!${bash}/bin/bash\\n#%s\\n" |
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 doesn't look right, you probably want to use ${coreutils}/bin/env
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.
Thanks!
# ++ stdenv.lib.optional pamSupport pam | ||
; | ||
|
||
buildFlags = "-tags" |
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.
buildFlags
should be a list if you specify multiple arguments, then you don't have to worry about the space prefix.
ce4f24f
to
f944885
Compare
After updating and garbage collection, pushing fails with an error like |
@schneefux this will happen after every upgrade, right? |
@Mic92 Yes/No. After an update, the hooks will use the old Gogs version until the user does |
@schneefux could be those hooks fixed in the module on service restart? |
@schneefux the alternative would be sed regexp. |
What do you think about HOOKS=$(find ${cfg.repositoryRoot} -mindepth 4 -maxdepth 4 -type f -wholename "*git/hooks/*")
sed -i 's,"/nix/store/[a-z0-9.-]+/bin/gogs,${pkgs.gogs.bin}/bin/gogs,g' $HOOKS
sed -i 's,"/nix/store/[a-z0-9.-]+/bin/env,${pkgs.coreutils.bin}/bin/env,g' $HOOKS
sed -i 's,"/nix/store/[a-z0-9.-]+/bin/perl,${pkgs.perl.bin}/bin/perl,g' $HOOKS
sed -i 's,"/nix/store/[a-z0-9.-]+/bin/bash,${pkgs.bash.bin}/bin/bash,g' $HOOKS ? |
@schneefux by default only the |
Yes, but I think it's better to update all hooks - for example if a user copies the |
What's the status on this? Is there something needed to be done? I'd love to see this merged. |
Updated to latest release |
I lost track of this, I'll test this after my other stuff is done building. |
Thank you! |
I updated #13566 to the latest release and improved the code a bit.
Tested:
.tar.gz
downloadscc @valeriangalliat @kamilchm @yorickvP