Our depends build is currently broken in a nix env as the cmake toolchain does not pass along everything needed to build correctly. See bitcoin/bitcoin#32428 for more info.
Currently we use my PR branch to build using a dependency provider. This should be removed once that is merged, or another solution found.