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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
fetchFromGitHub: Always add meta.homepage to the derivation #29815
Conversation
pkgs/top-level/all-packages.nix
Outdated
@@ -223,7 +222,8 @@ with pkgs; | |||
EOF | |||
''; | |||
netrcImpureEnvVars = [ "${varBase}USERNAME" "${varBase}PASSWORD" ]; | |||
} // passthruAttrs) // { inherit rev; }; | |||
} // passthruAttrs) // { inherit rev; }) | |||
// { meta.homepage = "${baseUrl}/"; }; |
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.
Could you also extract passthruAttrs
down here?
Then I'd merge 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.
Did some refactoring in 5d0f7dc721997424c85624df0713c07b9cc79fc4 which makes it possible. If I didn't miss anything 5d0f7dc721997424c85624df0713c07b9cc79fc4 shouldn't change the result at all.
The refactoring was necessary to avoid the passthruAttrs
redundancy as these attributes are required for both fetchzip
and fetchgit
(e.g. the sha256
attribute).
pkgs/top-level/all-packages.nix
Outdated
netrcImpureEnvVars = [ "${varBase}USERNAME" "${varBase}PASSWORD" ]; | ||
})) | ||
// passthruAttrs // { inherit name; }; | ||
in fetcher fetcherArgs // { meta.homepage = "${baseUrl}/"; inherit rev; }; |
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 like this, thank you! (Although extracting the private section into privateAttrs
will make it even better.)
I just noticed that GitHub does not add the final slash when you navigate to a project page, so we shouldn't too.
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.
Good points, thanks! I've changed it accordingly.
The attribute meta.homepage was only added if "fetchFromGitHub = false" which might be unexpected. Now, it will be set unconditionally.
And remove the tailing slash from "meta.homepage" as suggested by @orivej (because GitHub doesn't add the final slash).
5d0f7dc
to
fe02d8c
Compare
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 have confirmed that nox-review pr 29815
rebuilds nothing.
Not sure if this is a good idea / worth it. Consider it an suggestion (could make it more foolproof a33402b 馃槃).