Allow a "file" libfetcher type for plain files#4153
Allow a "file" libfetcher type for plain files#4153bqv wants to merge 2 commits intoNixOS:masterfrom
Conversation
Resolves NixOS#3785 Might help NixOS#3920
|
I'm the original issue author. Would really like to see this feature in Nix flakes. Thanks for working on this @bqv! |
|
@edolstra any thoughts? Do you have something else in the works? |
|
Second this. I think this is a great feature that allows flakes gets used in more places. |
|
I marked this as stale due to inactivity. → More info |
|
Really needed! Could somebody from the core team review it? 😃 |
|
duplicate? #5979 |
thufschmitt
left a comment
There was a problem hiding this comment.
Sorry for the very long delay @bqv . I’ve taken the liberty of merging master into your branch to fix the conflicts, but feel free to force-push over it if you don’t like it.
Feature-wise, that looks good. It’s not feature-complete − you can’t for example specify a file input as a url − but it’s already a strict improvement over the existing.
I’m a bit annoyed by the fact that this causes the “tarball” input scheme to fetch more than just tarballs. Maybe you could add the “file” support as its own scheme (by writing a FileInputScheme similar to TarballInputScheme and registering it the same way).
That shouldn’t cause a lot of duplication since most of the logic is already factored out in downloadFile and should make the whole thing more logical.
Also, can you add some tests? Both testing direct calls to builtins.fetchTree { type = "file"; ... } and flake inputs of type file.
|
(Assuming you’re still interested in pushing that further since the initial PR was already 18months ago ;) ) |
|
Not remotely ;) Left open because I honestly just forgot. Someone else can takeover this, I'm closing it but I'll leave the branch open. |
Fair enough 😄 Let’s hope that someone will then 🙏 (happy to provide guidance to any volunteer) |
|
still interested |
Resolves #3785
Hopefully isn't awful