Rust tests in a nix shell

I am running a rust tests for my project, and it requires some dependencies to test it, and some flags, i do not want to install it on my host system, so is there any way in rust, to get those tests to run in a nix shell? When I click on run test, it runs it in a new terminal, I like/perfer that. So I want to set it to run in a nix shell somehow.

No. You’ll have to make your editor/IDE start the terminal in the correct environment. My solution to this is direnv, it supports starting nix shell envs.