Use axel to get source instead curl for fetchurl

I’m trying to start a shell with Cuda. I have following shell.nix file

{ pkgs ? import <nixpkgs> { } }:

pkgs.mkShell {
  name = "cuda-env-shell";
  buildInputs = with pkgs; [
    unzip
    # other packages
    cudatoolkit
    # other packages
    binutils
  ];
}

But this fails due to following error. I have faced this before with large files like davinci-resolve for example. For davinci-resolve, my solution was to create a new flake using axel with 10 connections and it worked nicely every single time. Right now I’m facing this issue with Cuda.

[1/0/3 built, 4 copied (183.8/183.8 MiB), 42.8 MiB DL] building cuda_11.8.0_520.61.05_linux.run:                                  Dload  Upload   Total   Spent    Left
error: builder for '/nix/store/idz14mzbsv4k5v5ims095jcjk2r50glr-cuda_11.8.0_520.61.05_linux.run.drv' failed with exit code 1;
       last 7 log lines:
       >
       > trying https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run
       >   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
       >                                  Dload  Upload   Total   Spent    Left  Speed
       >  49 4135M   49 2044M    0     0   772k      0  1:31:20  0:45:08  0:46:12     0
       > curl: (56) Recv failure: Connection reset by peer

I want to get Cuda but can I retrieve the src using axel instead of curl? I tried something like following but it doesn’t seem to be valid syntax?

    cudatoolkit.overrideAttrs
    (finalAttrs: previousAttrs: {
      pname = previousAttrs.pname + "-bar";
      src = runCommandLocal "${previousAttrs.pname}.run" rec { } ''
        axel \
          --num-connections=10 \
          --verbose \
          --insecure \
          --output $out \
          "https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run"
      '';
    })

Error:

        at /nix/store/0g53xyh39z3y90p4d8r341wbqyjy1zhl-source/pkgs/stdenv/generic/make-derivation.nix:395:7:

          394|       depsHostHost                = elemAt (elemAt dependencies 1) 0;
          395|       buildInputs                 = elemAt (elemAt dependencies 1) 1;
             |       ^
          396|       depsTargetTarget            = elemAt (elemAt dependencies 2) 0;

       error: Dependency is not of a valid type: element 13 of buildInputs for cuda-env-shell