Skip to content
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

Fallback on builtin fetchers whenever possible #46

Closed
nmattia opened this issue Apr 10, 2019 · 6 comments
Closed

Fallback on builtin fetchers whenever possible #46

nmattia opened this issue Apr 10, 2019 · 6 comments

Comments

@nmattia
Copy link
Owner

nmattia commented Apr 10, 2019

#45 (comment)

@nlewo what do we gain from using the builtins as much as possible? Allowing use-cases where no nixpkgs can be found?

@nlewo
Copy link
Collaborator

nlewo commented Apr 19, 2019

Some projects use Nix only to generate files (json, yaml...). In theory, they don't need nixpkgs. So, it would be nice to allow such kind of project to use Niv without relying on nixpkgs.
Actually, I was thinking of kubenix, but it already uses nixpkgs! So, I'm not sure this is relevant.

@michaelpj
Copy link
Contributor

Here's another use case: we have a repository X for org-specific nix stuff, which includes a default nixpkgs pin for people to use.

So I want to get my nixpkgs from there, which means that when I fetch X I need to do it with a builtin fetcher unless I want to fallback on the ambient nixpkgs (which I definitely do not want, in fact I'd like a way to turn it off).

@michaelpj
Copy link
Contributor

Couple of approaches I can think of:

  • Add extra types for the builtin versions of fetchers tarball-builtin, fetchurl-builtin etc.
  • Add a builtin attribute that controls whether we try and use the builtin version of something. Most of the commonly used fetchers have builtin versions, so this would usually make sense.

@nlewo
Copy link
Collaborator

nlewo commented May 28, 2019

Fetchers such as dockerTools.pullImage, fetchFromGithub, fetchFromGitlab don't have a builtin version. So, if we decide to add them, I think dedicated fetchers (tarball-builtin, fetchurl-builtin) would be more suitable.
More concretely, I have open a PR to add a Docker fetcher (wip). Some users would like to be able to fetch git submodules (nixpkgs.fetchgit). I don't think the builtin version support this feature.

@michaelpj
Copy link
Contributor

Yeah, that's the reason I went with dedicated names in #61.

@nmattia
Copy link
Owner Author

nmattia commented Jan 31, 2020

After long discussions we're now using the nixpkgs fetchers for all packages expect nixpkgs, at least when it comes to fetching tarballs and the like (i.e. not for git repos, where we use builtins.fetchGit to allow fetching private repos).

@nmattia nmattia closed this as completed Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants