-
Notifications
You must be signed in to change notification settings - Fork 78
Description
Hi,
I have the following use case, but it seems like niv (currently) does not support it.
Here is the scenario:
- I want to add https://github.com/darktable-org/darktable to niv
- but only adding it as
type=tarballdoes not allow me to fetch submodules, therefore thesha256is incorrect (differs from the one with submodules) - using
type=gitand the unstable nix version as described in fetchGit and submodules #58 would work, but as I understand it, that means thatniv updateis a no-op on thejsonand everytime I import fromsources.nixit will download the repo again (which takes a lot time)
- but only adding it as
What I want is a json entry that also has the sha256 set, such that the evaluation of sources.nix does not download the huge git repo everytime.
As far as I see, the problem is that the builtins.fetchgit does not support adding a sha256, so this would require fetchFromGitHub which is not builtin. I could change my sources.nix to add this, which is nice, but what I don't get is that niv update works and updates the package...
Can you confirm my observations? What would be a good way to add this behavior to the code? It seems like we could add a case on type in:
Lines 346 to 349 in f73bf8d
| let cmd = case HMS.lookup "type" (unPackageSpec defaultSpec) of | |
| Just "git" -> gitCmd | |
| Just "local" -> localCmd | |
| _ -> githubCmd |
and for example use nix-prefetch-git for a github type?