If you’d like to build Firefox yourself the way that Nix does, try this:
$ mkdir ~/Code/firefox
$ cd ~/Code/firefox
$ nix-shell -I nixpkgs=flake:github:nixos/nixpkgs '<nixpkgs>' -A firefox-unwrapped --pure
<snipped, lots of tools downloading>
$ genericBuild
That’ll get you started with an environment that’s got everything you need to build Firefox.
Once you get started with actual development, there’s certain to be more questions and approaches, but if you just want to see the build work, this will do it.