with import {}; fetchurl { url = "https://example.com/some-file"; sha256 = "0000000000000000000000000000000000000000000000000000"; downloadToTemp = true; recursiveHash = true; curlOpts = "-D headers"; postFetch = '' mkdir $out mv "$downloadedFile" $out mv headers $out ''; }