diff --git a/pkgs/build-support/fetchurl/default.nix b/pkgs/build-support/fetchurl/default.nix index baa6c65b9d4..1ee4946c856 100644 --- a/pkgs/build-support/fetchurl/default.nix +++ b/pkgs/build-support/fetchurl/default.nix @@ -91,7 +91,11 @@ _EOF_ ''; message_ = if message != "" then message else '' You have to download ${name_} from ${stdenv.lib.concatStringsSep " " urls_} yourself, - and add it to the store using "nix-store --add-fixed ${hashAlgo_} ${name_}". + and add it to the store using either + nix-store --add-fixed ${hashAlgo_} ${name_} + or + ${if hashAlgo_ != "sha256" then "NIX_HASH_ALGO=${hashAlgo_} " else + ""}nix-prefetch-url file://path/to/${name_} ''; } else { @@ -119,4 +123,4 @@ else { "NIX_HASHED_MIRRORS" ] ++ (map (site: "NIX_MIRRORS_${site}") sites); }) -) \ No newline at end of file +)