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

niv add git ... does not add checksum #214

Open
tokudan opened this issue Mar 14, 2020 · 3 comments
Open

niv add git ... does not add checksum #214

tokudan opened this issue Mar 14, 2020 · 3 comments

Comments

@tokudan
Copy link

tokudan commented Mar 14, 2020

niv does not add checksums for git repositories:

$ niv add git git@codeberg.org:tokudan/nur.git
Adding package nur
  Writing new sources file
Done: Adding package nur

$ niv update
Updating all packages
  Package: nur
Done: Updating all packages

$ cat nix/sources.json
{
    "nur": {
        "ref": "master",
        "repo": "git@codeberg.org:tokudan/nur.git",
        "rev": "acb95091fa2430c48bd654ad1940ca1dd30fac48",
        "type": "git"
    }
}
@nmattia
Copy link
Owner

nmattia commented Mar 23, 2020

That is correct. Those could be added, we need to figure out we we want to re implement the hashing or use nix-prefetch-git. Right now only builtins.fetchgit is supported which doesn't need checksums. Do you need checksums for e.g. pkgs.fetchGit?

@tfc
Copy link
Contributor

tfc commented Jul 1, 2020

Hi,

i just ran across the same thing. I would like to export the niv attrset to a json file like {"a": "/nix/store/a...", "b": "/nix/store/b...", ...} and calculate and store its closure in some offline-nixstore, so that machines that re-evaluate the expressions don't need to re-download.

This does generally work after mapping all those store paths through builtins.storePath, but it does not work for git packages in niv due to the missing sha hash (so there is no upfront-storepath calculation and it tries to download).

Speaking for myself, i would need some method to describe the hash in niv (so that niv update does something) and then get the stuff checked out from repos where i can only authenticate via git/ssh.

@nmattia
Copy link
Owner

nmattia commented Jul 27, 2020

@tfc so do you just need a sha256 field? that's definitely doable

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