Toss the broccoli together with the oil and sprinkle generously with salt and pepper. Spread the broccoli in an evenly spaced single layer onto a baking sheet. Roast until the florets just begin to char and the stems have softened slightly, 15 to 20 minutes.
In the meantime, add the bacon to a small skillet over medium heat. Cook, stirring occasionally until the fat has rendered and the bacon is almost crispy, about 5 minutes. Add the onion to the skillet and cook until slightly softened, 2 to 3 minutes. Add the vinegar and sugar and stir until the sugar has dissolved, about 1 minute.
Add the roasted broccoli to a large bowl and pour the bacon dressing over the top along with the walnuts, tossing to coat. Serve warm or at room temperature.