Skip to content

Allow a "file" libfetcher type for plain files#4153

Closed
bqv wants to merge 2 commits intoNixOS:masterfrom
bqv:libfetcher
Closed

Allow a "file" libfetcher type for plain files#4153
bqv wants to merge 2 commits intoNixOS:masterfrom
bqv:libfetcher

Conversation

@bqv
Copy link
Contributor

@bqv bqv commented Oct 15, 2020

Resolves #3785

Hopefully isn't awful

@johnae
Copy link
Contributor

johnae commented Oct 31, 2020

I'm the original issue author. Would really like to see this feature in Nix flakes. Thanks for working on this @bqv!

@edolstra edolstra added feature Feature request or proposal flakes labels Nov 2, 2020
@bqv
Copy link
Contributor Author

bqv commented Dec 22, 2020

@edolstra any thoughts? Do you have something else in the works?

@junyi-hou
Copy link

Second this. I think this is a great feature that allows flakes gets used in more places.

@stale
Copy link

stale bot commented Nov 16, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the stale label Nov 16, 2021
@yajo
Copy link
Contributor

yajo commented Feb 22, 2022

Really needed! Could somebody from the core team review it? 😃

@stale stale bot removed the stale label Feb 22, 2022
@tomberek
Copy link
Contributor

duplicate? #5979

@tomberek tomberek requested a review from thufschmitt May 9, 2022 19:50
Copy link
Member

@thufschmitt thufschmitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@thufschmitt
Copy link
Member

(Assuming you’re still interested in pushing that further since the initial PR was already 18months ago ;) )

@bqv
Copy link
Contributor Author

bqv commented May 17, 2022

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.

@bqv bqv closed this May 17, 2022
@thufschmitt
Copy link
Member

Not remotely ;)

Fair enough 😄 Let’s hope that someone will then 🙏 (happy to provide guidance to any volunteer)

@tomberek
Copy link
Contributor

still interested

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Feature request or proposal flakes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

flakes: support downloading files (as opposed to github, git and tarball types)

7 participants