Open aciceri opened 1 year ago
seems like at least a first step would be to optionally generate with fetchGit with a flag then. i think your point of difference of when the fetch happens is a good point also, but maybe that's the preferred behavior with this.
I've some private packages in my
packages.dhall
with the followingrepo
:spago2nix generate
gives me derivations withsrc
s looking like:But
pkgs.fetchgit
cannot download private repos. My solution was to create awrapped-spago-packages.nix
that wraps the automatically generatedspago-pacakges.nix
usingbuiltins.fetchGit
instead ofpkgs.fetchgit
for predefined list of repos i.e. the private repos.And then, wherever I was using
./spago-packages.nix
I use./wrapped-spago-packages.nix
instead.Said this, one obvious solution would be directly generating
./spago-packages.nix
usingbuiltins.fetchGit
instead ofpkgs.fetchgit
but I'm not sure about consequences. As far as I knowbuiltins.fetchGit
doesn't return a derivation but directly a path, that means that the fetching is done at eval time and fetching all of this stuff at eval time could be a not good thing. Perhaps there should be anspago2nix
's argument to let people choose what they want to do?@justinwoo If you agree about this and you want to give me clear directives i would be happy to open a PR.