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

Add sources to override sources fetcher #123

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

juliens
Copy link

@juliens juliens commented Sep 4, 2023

This PR is a proposition to be able to override the source fetcher.

This can collide with #42 but I think it's a simpler solution to the problem.

User needs to define by itself how to fetch the dependency, but with that it works with all repository etc.. (no guessing).

The usage is pretty simple:

pkgs.buildGoApplication {
  pname = "my-app";
  version = "0.1";
  pwd = ./.;
  src = ./.;
  modules = ./gomod2nix.toml;
  sources = {
    "my-dependency_v0.10.0"= builtins.fetchGit {
      url = "[email protected]:test/my-dependency.git";
      ref = "master";
      rev = "xxxxxxxxx";
    };
  };
}

I just wonder if it is a problem that we don't verify the origin sha of the dependency and that we move the responsability of the "sha" on the fetchGit

WDYT?

@frederictobiasc
Copy link

frederictobiasc commented Feb 14, 2024

Hi, this works for my private repositories. Would also be interested in knowing what the maintainers think of this solution.

@anthr76
Copy link

anthr76 commented Apr 12, 2024

It would be nice to have support to pass in packages of private go modules so they can be easily re-used between derivations.

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

Successfully merging this pull request may close these issues.

3 participants