Need help constructing a cross-compiler toolchain for operating system development

So I’m trying to write a hobby OS on NixOS the Nix way. Normally I’d just follow the steps described here, but when doing so GCC/binutils can’t find the file utility (assuming its under /usr/bin). I’ve discussed this with people on the Matrix channels and they’ve told me that the best way would be to probably build my own custom stdenv, but I have no idea how to do that. What are the steps for custom stdenv creation and usage?

Hosted by Flying Circus.