Skip to content

Instantly share code, notes, and snippets.

@balsoft
Created November 17, 2022 18:24
Show Gist options
  • Save balsoft/f312b15a9d46400bd66d386a23015323 to your computer and use it in GitHub Desktop.
Save balsoft/f312b15a9d46400bd66d386a23015323 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