Nixos-rebuild fails as curl can't fetch requested package due to redirect

I’m newbie here and started to use nixos today. As I tried to populate my profile with favourite programs I spotted that nixos-rebuild uses curl which won’t follow redirect without explicit --location option.

How should I pass this option to nixos-rebuild curl? I already tried .curlrc both in home dir and root dir - with no effect (however command line curl works like a charm)

Other option would be to replace curl with wget for fetching OR temporarily overriding url in .drv file, please, advise!

Are you saying that you added a package from nixpkgs, and that somehow nixos-rebuild fails because a redirect cannot be followed that is in the package you added?

Exactly. This package points to url which is not accessible without redirect, and now I’m struggling how to bypass this limitation. command line curl takes -L option to follow redirect. As far as I’ve been guided in Discord nixpkgs uses libcurl and according to source file it should take NIX_CURL_FLAGS as impure environment variable. nixpkgs/pkgs/build-support/fetchurl/default.nix at b6625b11a86adfb3f620400c4122d8bb48aeb628 · NixOS/nixpkgs · GitHub

however I don’t know how to set it. I already tried to do = “-L”;

with no effect

systemctl cat nix-daemon.service | grep NIX_ shows

If you happen to control the package, it is possible to use redirects in packages nixpkgs/pkgs/by-name/ar/arc-browser/package.nix at 2cf2f3a306f5ea1f0e184b4317c4d50679ec49b3 · NixOS/nixpkgs · GitHub

it is also possible to override or use an overlay to override attributes about a package, perhaps to set the URL

Also possibly maybe small chance this is relevant? can't find curl-config on NixOS - Stack Overflow