How to manual add tarball for fetchurl build

i use nix to install es 7.
it use fetchurl to download tarball, and the download break for several times.
but i can use wget to download successfully.

i wonder whether i can add manual tarball to nix-store and do some configuration to let it pass the fetchurl.
or i can add timeout or something to drive the download process more stability.

Add your file to the Nix store like so:

nix-store --add-fixed sha256 elasticsearch...tar.gz

Build your derivation normally and the file will be used.

A fetchurl derivation is a fixed-output derivation and Nix is happy to take any file or directory with the correct hash as a substitute for actually building the derivation. It is mentioned in the documentation that

This can be used for sources that are not available from a public url or broke since the download expression was written.

Which isn’t exactly what you’re looking for, but is close enough.

1 Like