How to configure AddHangfireServer options.Queues if I need other services from within ConfigureServices()?

Hi guys,
I use this code to implement this:

private List<string> GetQueuesHangFire(IApplicationBuilder app)
    {
        using var serviceScope = app.ApplicationServices
        .GetRequiredService<IServiceScopeFactory>()
        .CreateScope();

        using var context = serviceScope.ServiceProvider.GetService<Models.DB.MyCustomContext>();
        var res = context.Queues.Select(x => x.Code).ToList();
        res.Add("default");
        return res;
    }

I hope that this help you.
Regards
Gon