-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
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
fetchipfs: draft #18296
fetchipfs: draft #18296
Conversation
@knupfer, thanks for your PR! By analyzing the annotation information on this pull request, we identified @edolstra, @vcunat and @domenkozar to be potential reviewers |
url = "mirror://gnu/hello/${name}.tar.gz"; | ||
sha256 = "0ssi1wpaf7plaswqqjwigppsg5fyh99vdlb9kzl7c9lng89ndq1i"; | ||
src = fetchipfs { | ||
url = "https://ftp.gnu.org/gnu/hello/hello-2.10.tar.gz"; |
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 think it would make sense to be able to specify a fetch*
function here so other fetchers would also be supported, like fetchFromGitHub
?
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 don't think that that would be possible. The hash must be a recursive hash of the unpacked source, so this part has to be hard coded and wouldn't be possible with other fetchers.
Re: `hello`:
Well, I got it as a «is there a better way» — «not a simple one» exchange.
It does build without IPFS daemon running, at least.
|
@cstrahan edit: Another thing is that to build |
At the moment, the usage of ipget is a bit problematic. It doesn't support getting tars added with My intention was, as stated in the first comment, not to alter |
Please revert. Switching to IPFS as a mechanism for fetching package sources is a major decision that should be done via the RFC process. |
You mean reverting the |
@vcunat I have reverted |
@knupfer could you add it again without touching hello? |
It is in master |
Motivation for this change
A first draft to start discussion for a
fetchipfs
fixed output derivation.Things done
nix-shell -p nox --run "nox-review wip"
./result/bin/
)This is a wip:
fetchipfs will take an ipfs path and an optional url. It tries first to download from ipfs via the localhost api and if that fails it'll try to download from the url and add the path to ipfs.
I've changed the
hello
program to showcase usage. After reaching consensus in discussion and filling holes, I'll force push to clean up the branch and remove the changes tohello
.The reasoning to not depend on
ipfs
is that it isn't that small and needs to be run as daemon, which would be only for nixos possible in an efficient manner.Limitations: