Skip to content

vendor dependencies #353

Open
Open
@jfroche

Description

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 ?

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions