TLDR version, If you are trying to find how to inject the IConfiguration, Well you don't need to as it's already available in the builder.
If you are using dotnet 5 or the earlier version then you need to inject the configuration object into the startup and use the same.
Now with .net 6 its become quite easy.
Simply and good-looking code in dotnet 6.