Custom fetch with auth

Hi, new-ish to NixOS here. Trying to write my first derivation (is that the right term? still don’t quite get it), it’s basically a standard autoPatchelfHook wrapper around a binary but to fetch the binary I need to log in first i.e.

curl -c cookiestore --request POST --data 'auth data'
curl -b cookiestore --location -o

Is there any way to override something in fetchurl to do this? I haven’t been able to find anything like this.

I browsed around and found these custom fetchers… but since this is a one-off thing is there any simpler way to go about this?
I’d still like to make the auth data a parameter so I can make the nix file public.


I ended up writing a custom builder script

1 Like