   defp do_download_file!(url, filename, retries \\ 0)
 
   defp do_download_file!(url, filename, 0) do
-    opts =
-      case check_proxy() do
-        nil ->
-          []
-        {var, url} ->
-          Mix.shell().info("- using proxy from #{var} (#{url})")
-          [{:proxy, url}]
-      end
-
-    case :hackney.request(:get, url, [], "", opts) do
+    case :hackney.request(:get, url, [], "", download_options()) do
       {:ok, 200, _, reference} ->
         case :hackney.body(reference) do
           {:ok, body} -> File.write(filename, body)

    if System.find_executable("gmake"), do: "gmake", else: "make"
  end

  def root? do
    uid() == 0
  end

    case do_download_file!(url, filename) do
      :ok -> :ok
      _ -> do_download_file!(url, filename, retries - 1)
    end
  end

  defp download_options do
    options = [ssl_options: [cacertfile: priv_path("cacert.pem"), ciphers: ciphers()]]

    case check_proxy() do
      nil ->
        options

      {var, url} ->
        Mix.shell().info("- using proxy from #{var} (#{url})")
        options ++ [proxy: url]
    end
  end

