Skip to content

Instantly share code, notes, and snippets.

@wiedzmin
Forked from balsoft/script.sh
Created January 22, 2023 17:59
Show Gist options
  • Save wiedzmin/6086d6ee2f6b1fb8e4a4dd6573ac3a36 to your computer and use it in GitHub Desktop.
Save wiedzmin/6086d6ee2f6b1fb8e4a4dd6573ac3a36 to your computer and use it in GitHub Desktop.
Nix: download all dependencies required for an offline build of a package
nix eval np#hello.drvPath --raw \
| xargs nix-store -qR \
| grep '\.drv$' \
| xargs -n1 nix show-derivation \
| jq -s '.[] | select(.[] | .env | has("outputHash")) | keys | .[]' -r \
| xargs nix build --no-link --print-out-paths
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment