Once inside the nix-shell, it assumes that the correct dependencies have already been loaded especially if you have built it on top of the newly cloned plutus-apps repo. The nix files necessary are therefore already available for any new project that you would compile or run inside the nix shell.
In the Plutus Pioneer Program, there is an instruction to have to update (checkout) to the proper github commit tag of the plutus-apps repo that the current week's source codes is using. Follow this intruction, then enter the nix shell. Once inside the nix shell, you will be able to successfully compile and run the projects of the current week.
For a new project to work, there is an option to set a file as an executable in the cabal project file. You may want to watch a part of the Plutus Pioneer Program - Iteration #3 Week #4 Lecture #2 video. At time 09:55, Lars made an example on how to execute his source code using cabal run
command, and he also explained afterwards the needed changes in the cabal project file if you want to use that command.