Need help on building aosp

Hello, I am new to nix and I am facing issue on building lineageos on my end. I have a build server which was running Arch Linux before, I thought to shift to nixos and after doing that I am facing issue on building aosp on it.

I got hold of this awesome gist which builds a FHS environment for me to build it. I am able to build emulator with it. But am facing issue on building Bramble and Beryllium device. I am using Lineage-22.1 (Android 15) as base. I am aware about Robotnix but the thing is I make a lot of changes over lineage os so can’t use that tool. I am using nix with flakes and am using nixpkgs-unstable. I am facing this error below when building the os. The guide to build lineageos for beryllium can be found here

ld.lld: error: cannot open crtbeginS.o: No such file or directory
ld.lld: error: unable to find library -lgcc
ld.lld: error: unable to find library -lgcc
ld.lld: error: cannot open crtendS.o: No such file or directory
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I tried both nix-shell --pure and impure both yield the same result. So any help would be appreciated. Thanks in advance.