In the bowl of a food processor or blender, combine the fresh basil leaves, salt, garlic, and your choice of nuts.
Add about half of the olive oil and pulse until the are roughly chopped.
With the processor running on low, slowly stream in the remaining olive oil.
Continue to process until the pesto is smooth but still has some texture. Scrape down the sides of the container as needed.
For a thinner consistency, add more olive oil one tablespoon at a time until you reach your desired texture.
Transfer the pesto to a bowl. If using, stir in the freshly grated cheese by hand just before serving.
Do not process the cheese.