1 # Not part of the public API – for use within nixpkgs only
6 # sources = lib.importJSON ./sources.json;
7 # in mkMyDerivation rec {
8 # version = src.version; # This obviously only works for releases
9 # src = pkgs.npins.mkSource sources.mySource;
19 assert spec ? type; let
21 if spec.type == "Git" then mkGitSource spec
22 else if spec.type == "GitRelease" then mkGitSource spec
23 else if spec.type == "PyPi" then mkPyPiSource spec
24 else if spec.type == "Channel" then mkChannelSource spec
25 else throw "Unknown source type ${spec.type}";
27 spec // { outPath = path; };
29 mkGitSource = { repository, revision, url ? null, hash, ... }:
30 assert repository ? type;
31 # At the moment, either it is a plain git repository (which has an url), or it is a GitHub/GitLab repository
32 # In the latter case, there we will always be an url to the tarball
39 else assert repository.type == "Git"; fetchgit {
44 mkPyPiSource = { url, hash, ... }:
50 mkChannelSource = { url, hash, ... }: