Not a bad idea! guix has openjdk, gcc, clang, cmake etc. Seems a lot more mature than last I checked. How easily does this play with a dev environment? Am I gunna have to do weird things to make tools find their toolchains?
I tried to grok Nix a few times and never understood how it works (since it seems like a rolling release where every package can build against any version of its dependencies).
https://packages.debian.org/bullseye/guix
Likely, this is more preferable than unofficial apt repositories or Docker.