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

vendor dependencies #353

Open
jfroche opened this issue May 24, 2022 · 1 comment
Open

vendor dependencies #353

jfroche opened this issue May 24, 2022 · 1 comment

Comments

@jfroche
Copy link

jfroche commented May 24, 2022

Reading code in dependencies locally is sometimes useful while coding. Different language are coming with this notion of vendoring dependencies locally (go mod vendor, cargo vendor, ...).
I am using this script to access niv my dependencies locally:

#!/usr/bin/env nix-shell
#!nix-shell -i bash -p jq -p nix
mkdir -p vendor
jq -r 'to_entries[] | select( .value.url and .value.sha256 ) | [ .key, .value.url, .value.sha256 ] | @tsv' sources.json \
| while IFS=$'\t' read -r name url hash; do
  s=$(nix-prefetch-url --unpack --print-path "$url" "$hash" | tail -n 1)
  ln -n -f -s "$s" "vendor/$name"
done

I was wondering if a similar command (niv vendor ?) could be added to niv ?

@nmattia
Copy link
Owner

nmattia commented May 30, 2022

I could have sworn I created a ticket for this years ago, but I can't find it now. That's a great idea!

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

2 participants