I occasionally solve coding problems and participate in contests, so I sometimes need these compilers available alongside VS Code. My main goal is to have VS Code automatically detect these libraries. Is there a recommended way to make this work seamlessly on NixOS without having to launch the IDE from a devshell every time?
There is a way, but it isn’t recommended, as it basically defeats the purpose of nix.
The essence is to set a variety of environment variables that setup hooks would set for you in a shell and/or create symlinks at certain (default) locations.
The recommended way is to use devshells though, or a docker container/VM that works the way you want it to work.
Personally I have no problems with drive by contributions and ad-hoc shells or uncommitted shell.nixs.
PS: yes, I know, it can feel like an annoying limitation at the beginning of the journey, though once you got used to it, it really becomes a major strength of the ecosystem, in my opinion.